obs_calculate: Calculate Observed Covariate Means and Risk

Description Usage Arguments Value

View source: R/comparisons.R

Description

This internal function calculates the mean observed values of covariates at each time point, as well as mean observed risk.

Usage

1
2
3
4
5
6
7
8
9
obs_calculate(
  outcome_name,
  compevent_name,
  time_name,
  covnames,
  comprisk,
  outcome_type,
  obs_data
)

Arguments

outcome_name

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

compevent_name

Character string specifying the name of the competing event variable in obs_data.

time_name

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

covnames

Vector of character strings specifying the names of the time-varying covariates in obs_data.

comprisk

Logical scalar indicating the presence of a competing event.

outcome_type

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

obs_data

Data table containing the observed data.

Value

A list. Its first entry is a list of mean covariate values at each time point; its second entry is a vector of the mean observed risk (for "survival" outcome types) or the mean observed outcome (for "continuous_eof" and "binary_eof" outcome types); for "survival" outcome types, its third entry is a vector of mean observed survival.


gfoRmula documentation built on July 13, 2021, 9:07 a.m.