gmusim: Fit a growth curve model using the Shape Invariant Model with...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

The basis of the Shape Invariant Model is that a population has a common characteristic curve or function, which by shifting and scaling can be made to have the form of any individual curve. After fitting a growth model using the Shape Invariant Model, this function can compute apv, pv and ypv of each individual by the numerical method.

Usage

1
2
3
4
gmusim(x, y, id, df, knots, len, cal = FALSE, fixed = random,
  random = "a+b+c", bounds = 0.04, start, bstart, verbose = FALSE,
  correlation = NULL, weights = NULL, subset = NULL, method = "ML",
  na.action = na.fail, control = nlmeControl(returnObject = TRUE))

Arguments

x

vector of ages.

y

vector of measurements.

id

factor of subject identifiers.

df

degrees of freedom for cubic regression spline.

knots

vector of values for knots (default df quantiles of x distribution).

len

time (age) measures after extension for computing aphv, if it is missing, then it equals round(365*diff(range(x))); if cal=FALSE, it is useless.

cal

control for whether to calculate pv, apv and height at pv or not (default FALSE).

fixed

character string specifying a, b, c fixed effects (default random).

random

character string specifying a, b, c random effects (default "a+b+c").

bounds

span of x for regression spline, or fractional extension of range (default 0.04).

start

optional numeric vector of initial estimates for the fixed effects, or list of initial estimates for the fixed and random effects (see nlme).

bstart

optional starting value for fixed effect b, if it is missing, then it equals to mean(x) when calculating.

verbose

optional logical value to print information on the evolution of the iterative algorithm (see nlme).

correlation

optional corStruct object describing the within-group correlation structure (see nlme).

weights

optional varFunc object or one-sided formula describing the within-group heteroscedasticity structure (see nlme).

subset

optional expression indicating the subset of the rows of data that should be used in the fit (see nlme).

method

character string, either "REML" or "ML" (default) (see nlme).

na.action

function for when the data contain NAs (see nlme).

control

list of control values for the estimation algorithm (see nlme).

Details

Start is an initial estimation vector for fixed effect parameters, it is suggested that the initial values for a, b, c are 0, mean(x) and 0, respectively. Note that a, b, c are corresponding to $alpha_0$, $beta_0$ and -$beta_1$ in model (7) of Beath (2007). One method for improving the initial guess for coefficients of fixed effects is to fit the model without random effects to the pooled data using a standard nonlinear least squares package. bstart allows the origin of b to be varied. Changing the original of b affects its random effect variance.

Value

An object inheriting from class gmusim representing the nonlinear mixed-effects model fit, includes all the components returned by nlme (see nlmeObject for a full description) plus the following components:

bstart: the value of arg bstart.

call.gmusim: the internal gmusim call that produced the object.

fitnlme: the function returning the predicted value of y.

ns: the lm object providing starting values for the B-spline curve.

calindex: APV(age at pv), PV(peak velocity) and HPV(height at pv).

fitted.values: a data frame, including expanded x (age), fitted values (y) for corresponding expanded x and id.

Generic functions such as print, plot, anova and summary can be used to show the results of the fit. The functions resid, coef, fitted, fixed.effects, random.effects, predict, getData, getGroups, getCovariate and getVarCov can be used to extract some of gmusim's components.

Author(s)

Zhiqiang Cao zcaoae@connect.ust.hk, Man-Yu Wong mamywong@ust.hk

References

Beath KJ. Infant growth modelling using a shape invariant model with random effects. Statistics in Medicine 2007;26:2547-2564.

Cole TJ, Donaldson MD, Ben-Shlomo Y. SITAR–a useful instrument for growth curve analysis. Int J Epidemiol 2010;39:1558-66.

See Also

sitar,gmusim_both,gmusim_com,gmusim_gr,gmusim_size.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
require(sitar)
data(heights)
x <- heights$age
y <- heights$height
id <- heights$id
df <- 5
## Do not calculate phv, aphv and hphv
resu1 <- gmusim(x,y,id,df)
summary(resu1)
## Calculate phv, aphv and height at phv (hphv)
resu2 <- gmusim(x,y,id,df,cal=TRUE)
summary(resu2)
aphv <- resu2$calindex
fitted.values <- resu2$fitted.values

Zhiqiangcao/gmusim documentation built on May 10, 2019, 1:58 a.m.