svyglm                package:survey                R Documentation

_S_u_r_v_e_y-_w_e_i_g_h_t_e_d _g_e_n_e_r_a_l_i_s_e_d _l_i_n_e_a_r _m_o_d_e_l_s.

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

     Fit a generalised linear model to data from a complex survey
     design, with inverse-probability weighting and with standard
     errors corrected for cluster sampling.

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

     svyglm(formula, design, subset=NULL, ...)
     svrepglm(formula, design, subset=NULL, ..., rho=NULL,
     return.replicates=FALSE, na.action)
     ## S3 method for class 'svyglm':
     summary(object, correlation = FALSE,  ...) 

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

 formula: Model formula

  design: Survey design from 'svydesign' or 'svrepdesign'. Must contain
          all variables in the formula

  subset: Expression to select a subpopulation

     ...: Other arguments passed to 'glm' or 'summary.glm' 

     rho: For replicate BRR designs, to specify the paramter for Fay's
          variance method

return.replicates: Return the replicates as a component of the result?

  object: A 'svyglm' object

correlation: Include the correlation matrix of parameters?

na.action: Handling of NAs

_D_e_t_a_i_l_s:

     In 'svyglm', standard errors for cluster-sampled designs are
     computed using a linearisation estimate (in the absence of strata
     this is equivalent to the Huber/White sandwich formula in GEEs). 
     Most of these computations are done in 'svyCprod'.  In 'svrepglm',
     replicate weight methods are used.

     There is no 'anova' method for 'svyglm' as the models are not
     fitted by maximum likelihood. The function 'regTermTest' may be
     useful for testing sets of regression terms.

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

     An object of class 'svyglm'.

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

     Thomas Lumley

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

     'svydesign', 'svrepdesign','as.svrepdesign', 'glm', 'svyCprod',
     'svy.varcoef','regTermTest'

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

       data(api)

       glm(api00~ell+meals+mobility, data=apipop)

       dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
       dclus2<-svydesign(id=~dnum+snum, weights=~pw, data=apiclus2)
       rstrat<-as.svrepdesign(dstrat)
       rclus2<-as.svrepdesign(dclus2)

       summary(svyglm(api00~ell+meals+mobility, design=dstrat))
       summary(svyglm(api00~ell+meals+mobility, design=dclus2))
       summary(svrepglm(api00~ell+meals+mobility, design=rstrat))
       summary(svrepglm(api00~ell+meals+mobility, design=rclus2))

       ## use quasibinomial, quasipoisson to avoid warning messages
       summary(svyglm(sch.wide~ell+meals+mobility, design=dstrat, family=quasibinomial()))

      

