svyratio               package:survey               R Documentation

_R_a_t_i_o _e_s_t_i_m_a_t_i_o_n

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

     Ratio estimation and estimates of totals based on ratios for
     complex survey samples.

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

     svyratio(numerator, denominator, design)
     svrepratio(numerator, denominator, design)
     ## S3 method for class 'svyratio':
     predict(object, total, se=TRUE,...)

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

numerator: formula, expression, or data frame giving numerator
          variable(s)

denominator: formula, expression, or data frame giving denominator
          variable(s) 

  design: from 'svydesign' for 'svyratio', from 'svrepdesign' for
          'svrepratio'

  object: result of 'svyratio'

   total: vector of population totals for the denominator variables in
          'object'

      se: Return standard errors?

     ...: Other unused arguments to 'predict'

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

     'svyratio' returns an object of class 'svyratio'. The 'predict'
     method returns a matrix of population totals and optionally a
     matrix of standard errors.

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

     Thomas Lumley

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

     Levy and Lemeshow. "Sampling of Populations" (3rd edition). Wiley

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

     'svydesign'

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

     data(scd)

     ## survey design objects
     scddes<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
     nest=TRUE, fpc=rep(5,6))
     scdnofpc<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA,
     nest=TRUE)

     # convert to BRR replicate weights
     scd2brr <- as.svrepdesign(scdnofpc, type="BRR")

     # use BRR replicate weights from Levy and Lemeshow
     repweights<-2*cbind(c(1,0,1,0,1,0), c(1,0,0,1,0,1), c(0,1,1,0,0,1),
     c(0,1,0,1,1,0))
     scdrep<-svrepdesign(data=scd, type="BRR", repweights=repweights)

     # ratio estimates
     svyratio(~alive, ~arrests, design=scddes)
     svyratio(~alive, ~arrests, design=scdnofpc)
     svrepratio(~alive, ~arrests, design=scd2brr)
     svrepratio(~alive, ~arrests, design=scdrep)

