regsim.glm simulates quantities of interest from a generalized linear model

# S3 method for glm
regsim(object, x, num = 1000, link = NULL, ...)

Arguments

object

a regression model, usually, a result of a call to glm

x

a list of explanatory variables

num

number of iterations to run

link

model link function

...

additional arguments passed to class-specific functions

Examples

library(regsim) y <- swiss$Fertility > median(swiss$Fertility) model <- glm(y ~ Education + Agriculture, family = binomial, data = swiss) x <- list(Agriculture = seq(1, 100, 5)) sim <- regsim(model, x) summary(sim)
#> Profile 1 #> Agriculture 1.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p1 0.2222597 0.6236746 0.9125982 #> -------------------------------- #> #> Profile 2 #> Agriculture 6.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p2 0.2324344 0.6077768 0.8916673 #> -------------------------------- #> #> Profile 3 #> Agriculture 11.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p3 0.2448367 0.5855008 0.8640736 #> -------------------------------- #> #> Profile 4 #> Agriculture 16.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p4 0.2630375 0.5640366 0.8321044 #> -------------------------------- #> #> Profile 5 #> Agriculture 21.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p5 0.2715854 0.5446202 0.7988124 #> -------------------------------- #> #> Profile 6 #> Agriculture 26.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p6 0.2827414 0.5212124 0.7678111 #> -------------------------------- #> #> Profile 7 #> Agriculture 31.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p7 0.2913283 0.5027772 0.7382362 #> -------------------------------- #> #> Profile 8 #> Agriculture 36.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p8 0.2997298 0.4833239 0.7019393 #> -------------------------------- #> #> Profile 9 #> Agriculture 41.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p9 0.298412 0.4607184 0.6553078 #> ------------------------------- #> #> Profile 10 #> Agriculture 46.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p10 0.2860039 0.4378075 0.6295652 #> --------------------------------- #> #> Profile 11 #> Agriculture 51.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p11 0.2627246 0.419153 0.6000553 #> -------------------------------- #> #> Profile 12 #> Agriculture 56.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p12 0.2387403 0.3964575 0.5974851 #> --------------------------------- #> #> Profile 13 #> Agriculture 61.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p13 0.2050746 0.3791175 0.6005325 #> --------------------------------- #> #> Profile 14 #> Agriculture 66.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p14 0.1696549 0.358685 0.6072546 #> -------------------------------- #> #> Profile 15 #> Agriculture 71.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p15 0.1401612 0.3416929 0.6271709 #> --------------------------------- #> #> Profile 16 #> Agriculture 76.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p16 0.1149167 0.3201892 0.6500415 #> --------------------------------- #> #> Profile 17 #> Agriculture 81.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p17 0.09288251 0.3010565 0.6687899 #> ---------------------------------- #> #> Profile 18 #> Agriculture 86.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p18 0.07595796 0.2819459 0.6890683 #> ---------------------------------- #> #> Profile 19 #> Agriculture 91.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p19 0.06042827 0.2678169 0.699669 #> --------------------------------- #> #> Profile 20 #> Agriculture 96.00000 #> Education 10.97872 #> #> 2.5% 50% 97.5% #> p20 0.04930531 0.2499461 0.7161089 #> ---------------------------------- #>