spec_model: Model specification for G-formula

Description Usage Arguments

View source: R/medlong.R

Description

Add a specified regression model for the exposure. This is used for natural course estimation of the Monte Carlo g-formula. This must be specified before calling the fit function.

Usage

1
2
3
4
5
6
7
spec_model(
  formula,
  subset = NULL,
  family = "gaussian",
  order,
  type = c("exposure", "covariate", "mediator", "outcome", "censor", "survival")
)

Arguments

formula

Formula for specified models passed to glm. Must be contained within the input dataframe when initialized.

subset

an optional vector specifying a subset of observations to be used in the fitting process (see glm).

family

A description of the error distribution and link function to be used in the glm model.

order

Numeric, temporal ordering of the Covariates.

type

Model type. Exposure model (exposure), covariate model (covariate), mediator model (mediator), outcome model (outcome), mediator model (survival) or censoring model (censor)


adayim/causalMed documentation built on June 2, 2020, 4:11 p.m.