fit_model: S3 Generic function fit_model to construct mmi_model objects.

View source: R/specifications.R

fit_modelR Documentation

S3 Generic function fit_model to construct mmi_model objects.

Description

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.

Usage

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)

Arguments

object

spec object.

study_frame

The data frame that includes all variables needed for the analysis

Methods (by class)

  • 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.


JacobBergstedt/mmi documentation built on March 8, 2024, 8:25 a.m.