Ken Kleinman

Biostatistician

  • Increase font size
  • Default font size
  • Decrease font size

Monte Carlo experiment from blog-- R notes

E-mail Print PDF

These are brief notes on where to find the CI or the standard errors in the objects resulting from calls to glm(), logistf(), elrm(), and MCMClogit().  Editorially, I find looking through various R code and functions to find this kind of information to be challenging, and it seems to me that the need for standard errors of estimates is so common that package authors should note prominently where they can be found. 

summary(glm(yw ~ xw, weights=ww, binomial))$coefficients[2,2]   # has the std err for GLM

logistf(yw ~ xw, weights=ww)$ci.upper
logistf(yw ~ xw, weights=ww)$ci.lower  # has upper and lower for firth

elrm(events/trials ~ x, interest = ~ x, iter = 11000, burnIn = 1000, data = elrmdata, r = 2)$coeffs.ci
                 # has upper and lower ci for exact

(summary(logmcmc))$quantiles[2,c(1,5)] # has 2.5 and 97.5 from MCMC

 

Contents