3

How do we get a standard error for an odds ratio obtained from output produced by the svyglm() function in the R package "survey"?

The model fitted with svyglm is of the form:

svyglm(Outcome ~ Treatment,design=design.object,family=quasibinomial(link=logit))

The odds ratio comparing the two levels of Treatment can be easily obtained by exponentiating the coefficients produced by the summary() command applied to the above model.

Not clear how to produce standard errors associated with this odds ratio?

thelatemail
  • 91,185
  • 12
  • 128
  • 188
Isabella Ghement
  • 715
  • 6
  • 14
  • http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – npjc May 27 '14 at 03:51
  • Maybe something like: `predict(fit, newdata = data.frame(Treatment = mean(datasetname$Treatment)), se.fit = T)` - based on this page: http://www.ats.ucla.edu/stat/r/faq/deltamethod.htm and saving your `svyglm()` results to `fit`. I'm really guessing though as I'm not sure what your data/analysis exactly is. – thelatemail May 27 '14 at 04:38
  • 1
    You can use `confint()` on the model to get confidence intervals of the coefficients; the antilog of those are the confidence limits of the odds ratios. That isn't the same as standard errors, but it is one measure of uncertainty. – Brian Diggs May 27 '14 at 04:42
  • @BrianDiggs - probably simpler and more common. I thought I'd *try* to answer the question as is, but it might well make more sense to just use CI's. – thelatemail May 27 '14 at 04:44
  • Thank you very much - I already got the confidence interval for the odds ratio, but I was hoping to also get a standard error. – Isabella Ghement May 27 '14 at 05:44

2 Answers2

1

Here is an answer to your elderly question. If model is your svyglm output use:

SE(model)

phdscm
  • 233
  • 1
  • 8
0

You can use svycontrast to get SEs for linear and nonlinear functions of a statistics, such as the odds ratio from svyglm

> data(api)
> dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
> model<-svyglm(sch.wide~ell+meals+mobility, design=dstrat,family=quasibinomial())
> coef(model)
 (Intercept)          ell        meals     mobility 
 0.835836525 -0.002489636 -0.003152365  0.060896779 
> exp(coef(model))
(Intercept)         ell       meals    mobility 
  2.3067429   0.9975135   0.9968526   1.0627892 
> 
> svycontrast(model, quote(exp(ell)))
           nlcon     SE
contrast 0.99751 0.0132
> SE(svycontrast(model, quote(exp(ell))))
  contrast 
0.01321955 
Thomas Lumley
  • 1,893
  • 5
  • 8