Reporting OR from glm with binomial link and glm predictions

summaryGLM(object, id = NULL, fun = NULL, ...)

Arguments

object

glm output

id

possible id for cluster corrected standard errors

fun

possible function for non-standard predictions based on object

...

arguments of estimate of lava for example level=0.95

Author

Thomas Scheike

Examples

data(sTRACE)
sTRACE$id <- sample(1:100,nrow(sTRACE),replace=TRUE)

model <- glm(I(status==9)~sex+factor(diabetes)+age,data=sTRACE,family=binomial)
summaryGLM(model)
#> $coef
#>                   Estimate Std.Err     2.5%   97.5%   P-value
#> (Intercept)       -6.65169 0.82284 -8.26442 -5.0389 6.278e-16
#> sex                0.25832 0.22418 -0.18107  0.6977 2.492e-01
#> factor(diabetes)1  0.63305 0.30486  0.03553  1.2306 3.785e-02
#> age                0.09591 0.01099  0.07436  0.1175 2.707e-18
#> 
#> $or
#>                      Estimate         2.5%      97.5%
#> (Intercept)       0.001291843 0.0002575172 0.00648057
#> sex               1.294751030 0.8343769033 2.00914026
#> factor(diabetes)1 1.883341432 1.0361638586 3.42317957
#> age               1.100659282 1.0771942608 1.12463545
#> 
#> $fout
#> NULL
#> 
summaryGLM(model,id=sTRACE$id)
#> $coef
#>                   Estimate Std.Err     2.5%   97.5%   P-value
#> (Intercept)       -6.65169 0.79610 -8.21202 -5.0914 6.527e-17
#> sex                0.25832 0.22581 -0.18427  0.7009 2.526e-01
#> factor(diabetes)1  0.63305 0.28730  0.06994  1.1962 2.757e-02
#> age                0.09591 0.01043  0.07547  0.1163 3.689e-20
#> 
#> $or
#>                      Estimate         2.5%      97.5%
#> (Intercept)       0.001291843 0.0002713719 0.00614971
#> sex               1.294751030 0.8317153621 2.01556964
#> factor(diabetes)1 1.883341432 1.0724453838 3.30737117
#> age               1.100659282 1.0783905477 1.12338787
#> 
#> $fout
#> NULL
#> 

nd <- data.frame(sex=c(0,1),age=67,diabetes=1)
predictGLM(model,nd)
#> $coef
#>                   Estimate Std.Err     2.5%   97.5%   P-value
#> (Intercept)       -6.65169 0.82284 -8.26442 -5.0389 6.278e-16
#> sex                0.25832 0.22418 -0.18107  0.6977 2.492e-01
#> factor(diabetes)1  0.63305 0.30486  0.03553  1.2306 3.785e-02
#> age                0.09591 0.01099  0.07436  0.1175 2.707e-18
#> 
#> $pred
#>     Estimate      2.5%     97.5%
#> p1 0.6004375 0.4494731 0.7344613
#> p2 0.6605188 0.5194651 0.7778730
#>