framesum              package:spsurvey              R Documentation

_S_u_m_m_a_r_i_z_e _F_r_a_m_e _S_i_z_e _f_o_r _a _S_u_r_v_e_y _D_e_s_i_g_n

_D_e_s_c_r_i_p_t_i_o_n:

     This function summarizes the frame for a survey design.  When
     type.frame equals "finite", summary is a count of number of units
     in att.frame for cross-tabulation of stratum, mdcaty, and auxvar. 
     When type.frame equals "linear" or "area", summary is the sum of
     length or area for units for cross-tabulation of stratum, mdcaty,
     and auxvar.  Note that length and area are taken from length_mdm
     and area_mdm, which are calculated by the function read.dbf and
     added to att.frame.  If argument mdcaty or argument stratum equals
     NULL or if both arguments equal NULL, then the cross-tabulation is
     performed without use of the design variable(s).

_U_s_a_g_e:

     framesum(att.frame, design, type.frame="finite", stratum=NULL, mdcaty=NULL,
       auxvar=NULL, units.in="Number", scale=1, units.out="Number")

_A_r_g_u_m_e_n_t_s:

att.frame: a data frame composed of attributes associated with elements
          in the frame, which must contain the columns used for stratum
          and mdcaty (if required by the survey design).

  design: named list of stratum design specifications which are also
          lists.  Stratum names must be subset of values in stratum
          argument.  Each stratum list has four list components:
           panel = named vector of sample sizes for each panel in
          stratum;
           seltype = the type of random selection, which must be one of
          following: "Equal" - equal probability selection, "Unequal" -
          unequal probability selection by the categories specified in
          caty.n and mdcaty, or "Continuous" - unequal probability
          selection proportional to auxiliary variable mdcaty;
           caty.n = if seltype equals "Unequal", a named vector of
          sample sizes for each category specified by mdcaty, where sum
          of the sample sizes must equal sum of the panel sample sizes,
          and names must be a subset of values in mdcaty;
           over = number of replacement sites ("oversample" sites) for
          the entire design, which is set equal to 0 if none are
          required.

type.frame: the type of frame, which must be one of following:
          "finite", "linear", or "area".  The default is "finite"

 stratum: name of the column from att.frame that identifies stratum
          membership for each element in the frame.  If stratum equals
          NULL, the design is unstratified and a column named stratum
          with all its elements equal to "None" is added to att.frame. 
          The default is NULL.

  mdcaty: name of the column from att.frame that identifies the unequal
          probability category for each element in the frame.  The
          default is NULL.

  auxvar: a vector containing the names of columns from sites that
          identify auxiliary variables to be used to summarize frame
          size.  The default is NULL.

units.in: a character string giving the name of units used to measure
          size in the frame.  The default is "Number".

   scale: the scale factor used to change units.in to units.out.  For
          example, use 1000 to change "Meters" to "Kilometers".  The
          default is 1.

units.out: a character string giving the name of units used to measure
          size in the results.  The default is "Number".

_V_a_l_u_e:

     A list containing the following components: 

DesignSize: a table (for type.frame equals "finite") or an array (for
          type.frame equals "linear" or "area") that contains the
          cross-tabulation of frame extent for design variables
          multidensity category (mdcaty) and stratum, where extent of
          the frame is the number of sites for type.frame equals
          "finite", the sum of site length for type.frame equals
          "linear", or the sum of site area for type.frame equals
          "area".

AuxVarSize: a list containing a component for each auxiliary variable,
          where each component of the list is one of the following: (1)
          if the type of random selection does not equal "Continuous"
          for any stratum, each component is either a table (for
          type.frame equals "finite") or an array (for type.frame
          equals "linear" or "area") that contains the cross-tabulation
          of frame extent for mdcaty, stratum, and the auxiliary
          variable or (2) if the type of random selection equals
          "Continuous" for all strata, each component is either a table
          (finite frame) or an array (linear or area frame) containing
          the cross-tabulation of frame extent for stratum and the
          auxiliary variable.

     In addition the output list plus labeling information is printed
     to the console.

_A_u_t_h_o_r(_s):

     Tony Olsen Olsen.Tony@epa.gov
      Tom Kincaid Kincaid.Tom@epa.gov

_R_e_f_e_r_e_n_c_e_s:

     Stevens, D.L., Jr., and A.R. Olsen. (2004). Spatially-balanced
     sampling of natural resources. Journal of the American Statistical
     Association *99*: 262-278.

_S_e_e _A_l_s_o:

     'grts' 'dsgnsum'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     test.attframe <- read.dbf("test.shapefile")
     test.design <- list(Stratum1=list(panel=c(PanelOne=50),
        seltype="Equal", over=10), Stratum2=list(panel=c(PanelOne=50,
        PanelTwo=50), seltype="Unequal", caty.n=c(CatyOne=25, CatyTwo=25,
        CatyThree=25, CatyFour=25), over=75)
     framesum(att.frame=test.attframe, design=test.design, type.frame="area",
        stratum="test.stratum", mdcaty="test.mdcaty", auxvar=c("test.ecoregion",
        "test.state"), units.in="Meters", scale=1000, units.out="Kilometers")
     ## End(Not run)

