fit_all_trajectories: Apply trajectory fitting to each subject in a dataset

Description Usage Arguments Examples

View source: R/analysis_fit_traj.R

Description

Apply trajectory fitting to each subject in a dataset

Usage

1
2
fit_all_trajectories(dat, fit, xg = NULL, checkpoints = 365 * c(1:2),
  z_bins = -2)

Arguments

dat

a data frame containing data for several subjects or a data frame with one row per subject, as obtained from by_subject

fit

an object returned from get_fit

xg

grid of x points at which the fit should be evaluated for plotting (if NULL it will be set to an equally-spaced grid of 150 points across x)

checkpoints

x values at which to compute "checkpoints" of the subjects's growth trajectory to compare to other subjects

z_bins

a vector indicating binning of z-scores for the subject's trajectory at each checkpoint with respect to the the WHO growth standard

Examples

1
2
3
4
5
6
7
## Not run: 
cppfit <- get_fit(cpp, y_var = "wtkg", method = "rlm")
cpptr  <- fit_all_trajectories(cpp, cppfit)
cpptr$fit[[1]]
plot(cpptr$fit[[1]])

## End(Not run)

hafen/hbgd documentation built on March 1, 2020, 5:31 p.m.