| p_glm | R Documentation |
A wrapper function for glm(), with the data argument listed first to support piping.
p_glm(data, formula, ...)
data |
the data |
formula |
the formula |
... |
additional arguments passed to |
a glm object
# load the data
data(nhanes)
# define asthma
nhanes<-nhanes |> transform(
asthma=base_match(mcq010,'No'=2,'History of asthma'=1)
)
# define smoking
nhanes<-nhanes |> transform(
smoking=base_match(smq020,'No'=2,'History of smoking'=1)
)
# fit a model
my_model<-nhanes |> p_glm(asthma~smoking,family=binomial(link='logit'))
# obtain model details
my_model |> summary()
# obtain confidence interval
my_model |> confint() |> exp()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.