Learn R Programming

growcurves (version 0.2.4.1)

growthCurve: Within subject model-predicted growth curve

Description

Produces a set of predicted response values, by subject, at T time points. The response values are predicted by employing the posterior samples of model parameters where the resultant response values for each subject are composed by averaging over all posterior samples in a Rao-Blackwellizing fashion.

Usage

growthCurve(y.case, B, Alpha, Beta, U = NULL, aff.clients = NULL, W.subj = NULL, X.n = NULL, Z.n = NULL, trt.case, trt.lab, subject.case, subject.lab, T, min.T, max.T, n.thin, n.waves = NULL, time.case, n.fix_degree, Nrandom = NULL)

Arguments

y.case
The N x 1 (subject-time case) vector of data response values.
B
The M x P*q matrix of subject random effect posterior samples. M = number of MCMC samples, P = number of subjects, q = number of random effect parameters, per subject.
Alpha
The M x 1 vector for the model intercept parameter.
Beta
The M x F matrix of model fixed effects parameters, where F = number of fixed effects
U
The M x S matrix of univariate multiple membership random effects, where S = number of random effects. U is multivariate, then the input is of dimension M x Nmv*S, where Nmv is the multivariate dimension. Leave NULL is don't require the multiple membership effects. Input as list of M x S matrices if have more than one mutiple membership term.
aff.clients
Vector of length P.aff that identifies subjects affected by U. Identical to subj.aff from dpgrowmm. Input as list of vectors, each comprised of affected subjects attached to the equivalent multiple membership term if have more than one term.
W.subj
A P x S multiple membership weight matrix for U that expands W.subj.aff of dpgrowmm from affected subjects, Paff to all subjects, P. Input as list of P[i] x S[i] matrices, where i indexes an MM term, if have more than one multiple membership term.
X.n
A design matrix with N rows (for subject-measure) cases providing nuisance fixed effects. Will be expanded to the T within sample predictions, but held constant between successive observed values (for generating expanded predictions).
Z.n
A design matrix with N rows providing nuisance random effects. Grouping is assumed to be by-subject.
trt.case
The treatment group membership vector of length N (subject-time cases). Assumed numeric with lowest group level == 0; .e.g. (0,0,0,1,1,2,2,2,2,).
trt.lab
Associated labels for the numeric treatment groups. Each distinct treatment group assumed to have a unique label.
subject.case
Vector of length N providing subject-measure cases. Must be in numerical format with unique subjects sequential starting at 1.
subject.lab
N x 1 case length vector with user desired labels that map 1:1 to subject.case.
T
Number of time points to build each subject curve. T = 10 is typically sufficient.
min.T
The minimum time value that T will take.
max.T
The maximum time value that T will take.
n.thin
The gap between each MCMC sample used for the growth curve.
n.waves
The maximum number of observed measurement waves, per subject.
time.case
A vector of length N providing times for associated subject-measure observations. Identical to time from dpgrowmm.
n.fix_degree
The highest polynomial degree to employ for constructing time-based fixed effects covariates.
Nrandom
A scalar input providing the number of by-subject time-based random effect parameters. Only need to input if employ nuisance random effects.

Value

A list object containing the following data.frames and plots:

See Also

dpgrowmm, dpgrow, dpgrowmult