pred_fun_Y: Fit Outcome Model

View source: R/pred.R

pred_fun_YR Documentation

Fit Outcome Model

Description

This internal function fits a generalized linear model (GLM) for the outcome variable using the observed data.

Usage

pred_fun_Y(
  model,
  yrestrictions,
  outcome_type,
  outcome_name,
  time_name,
  obs_data,
  model_fits
)

Arguments

model

Model statement for the outcome variable.

yrestrictions

List of vectors. Each vector containins as its first entry a condition and its second entry an integer. When the condition is TRUE, the outcome variable is simulated according to the fitted model; when the condition is FALSE, the outcome variable takes on the value in the second entry.

outcome_type

Character string specifying the "type" of the outcome. The possible "types" are: "survival", "continuous_eof", and "binary_eof".

outcome_name

Character string specifying the name of the outcome variable in obs_data.

time_name

Character string specifying the name of the time variable in obs_data.

obs_data

Data on which the model is fit.

model_fits

Logical scalar indicating whether to return the fitted models. The default is FALSE.

Value

Fitted model for the outcome variable.


gfoRmula documentation built on May 31, 2023, 9:46 p.m.