adjwgt               package:spsurvey               R Documentation

_A_d_j_u_s_t _I_n_i_t_i_a_l _S_u_r_v_e_y _D_e_s_i_g_n _W_e_i_g_h_t_s

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

     This function adjusts initial survey design weights when
     implementation results in use of oversample sites or when it is
     desired to have final weights sum to a known frame size.  Adjusted
     weights are equal to initial weight times the frame size divided
     by the sum of the initial weights.  The adjustment is done 
     separately for each category specified in argument wtcat.

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

     adjwgt(sites, wgt, wtcat, framesize)

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

   sites: the logical value for each site, where TRUE = include the
          site and FALSE = do not include the site.

     wgt: the initial weight (inverse of the sample inclusion
          probability) for each site.

   wtcat: the weight adjustment category name for each site.

framesize: the known size of the frame for each category name in 
          wtcat, which must have the names attribute set to match the
          category  names used in wtcat.

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

     A vector of adjusted weights, where the adjusted weight is set to
     zero for  sites that have the logical value in the sites argument
     set to FALSE.

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

     Tony Olsen Olsen.Tony@epa.gov

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

     sites <- as.logical(rep(rep(c("TRUE","FALSE"), c(9,1)), 5))
     wgt <- runif(50, 10, 100)
     wtcat <- rep(c("A","B"), c(30, 20))
     framesize <- c(15, 10)
     names(framesize) <- c("A","B")
     adjwgt(sites, wgt, wtcat, framesize)

