rmse_calculate: Calculate RMSE for Covariate, Outcome, and Competing Risk...

Description Usage Arguments Value

View source: R/comparisons.R

Description

This internal function calculates root mean square error (RMSE) for the covariate (and the outcome and competing event, if applicable) models fit on the observed data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rmse_calculate(
  i,
  fits,
  covnames,
  covtypes,
  obs_data,
  outcome_name,
  time_name,
  restrictions,
  yrestrictions,
  compevent_restrictions
)

Arguments

i

Integer specifying the index of fits.

fits

List of fitted models.

covnames

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

covtypes

Vector of character strings specifying the "type" of each time-varying covariate included in covnames. The possible "types" are: "binary", "normal", "categorical", "bounded normal", "zero-inflated normal", "truncated normal", "absorbing", "categorical time", and "custom".

obs_data

Data table containing the observed data.

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.

restrictions

List of vectors. Each vector contains as its first entry a covariate for which a priori knowledge of its distribution is available; its second entry a condition under which no knowledge of its distribution is available and that must be TRUE for the distribution of that covariate given that condition to be estimated via a parametric model or other fitting procedure; its third entry a function for estimating the distribution of that covariate given the condition in the second entry is false such that a priori knowledge of the covariate distribution is available; and its fourth entry a value used by the function in the third entry. The default is NA.

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.

compevent_restrictions

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

Value

The RMSE for the model.


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