add_cogs_persubj: Create a fittedTrajectory object with fits for a single...

Description Usage Arguments Value

View source: R/hbgd_fittedTrajectory.R

Description

Creates objects of class fittedTrajectory with growth curve predictions, one object for subject ID in the data. This can be used for further growth curve analysis with hbgd R package. Requires the the dataset containing the predicted growth curves for all subjects grid_fits_dat.

Usage

1
2
3
add_cogs_persubj(fit_dat, sex, method = "default",
  xy_pair_name = c("agedays", "htcm"), fun_y_to_raw = who_zscore2htcm,
  fun_y_to_z = function(x, y, ...) return(y))

Arguments

fit_dat

Subject specific data to be added to the final object. This must also contain the observed outcome on each subect under a nested dataset "fit", in column named "y". Similarly, the model predictions must be under the nested dataset "fit", in column named "preds". Additionally, the holdout and grid predictions can be stored in nested datasets "holdout" and "fitgrid", respectively.

sex

The gender (as character "Male" / "Female") for this subject.

method

A name of the modeling approach for future model comparison.

xy_pair_name

... Same as in hbgd package...

fun_y_to_raw

The function to convert the scale of the observed outcome and predictions into the raw scale (height / weight). If the fits are already on the raw scale then specify this argument as function(x, y, ...) return(y).

fun_y_to_z

The function to convert the scale of the observed outcome and predictions into the z-scale. If the fits are already on the z-scale then specify this argument as function(x, y, ...) return(y).

Value

...


osofr/growthcurveSL documentation built on May 24, 2019, 4:56 p.m.