View source: R/specifications.R
fit_model | R Documentation |
Sets up the formula for the particular model using get_formula
and then
fits an an appropriate model using the data in study_frame
. An mmi_model object is
created by adding the model fit, and possibly additional needed information,
to the specification object.
fit_model(object, study_frame)
## S3 method for class 'spec_lm'
fit_model(object, study_frame)
## S3 method for class 'spec_lmm'
fit_model(object, study_frame)
## S3 method for class 'spec_logreg'
fit_model(object, study_frame)
## S3 method for class 'spec_nb'
fit_model(object, study_frame)
## S3 method for class 'spec_beta'
fit_model(object, study_frame)
object |
|
study_frame |
The data frame that includes all variables needed for the analysis |
spec_lm
: Constructs a mmi_lm
object.
Sets up the formula using get_formula
and then fits an
lm
using the formula and the data in study_frame.
spec_lmm
: Constructs a mmi_lmm
object by setting up a formula using get_formula
and then fitting a lmerMod
using the formula and the data in study_frame.
spec_logreg
: Constructs a mmi_logreg
object by setting up a formula using get_formula
and then fitting a glm
logistic regression using the formula and the data in study_frame.
spec_nb
: Constructs a mmi_nb
object by setting up a formula using get_formula
and then fitting a glm.nb
logistic regression using the formula and the data in study_frame.
spec_beta
: Constructs a mmi_beta
object by setting up a formula using get_formula
and then fitting a betareg
beta regression model using the formula and the data in study_frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.