Description Usage Arguments Details Value Author(s) References See Also Examples
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. This function can deal with time independent covariates affecting both subject's size and growth rate, note that every covariate in data.frame z must have both size and growth rate effects.
1 2 3 4 |
x |
vector of ages. |
y |
vector of measurements. |
z |
data.frame of time independent covariates. |
p |
number of columns in data.frame z. |
n |
length of x. |
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 |
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 |
correlation |
optional corStruct object describing the within-group correlation structure (see |
weights |
optional varFunc object or one-sided formula describing the within-group heteroscedasticity structure (see |
subset |
optional expression indicating the subset of the rows of data that should be used
in the fit (see |
method |
character string, either "REML" or "ML" (default) (see |
na.action |
function for when the data contain NAs (see |
control |
list of control values for the estimation algorithm (see |
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.
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_both 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: APHV(age at phv), PHV(peak height velocity) and HPHV(height at phv).
fitted.values: a data frame, including expanded x, 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_both's components.
Zhiqiang Cao zcaoae@connect.ust.hk, Man-Yu Wong mamywong@ust.hk
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.
sitar
,gmusim
,gmusim_com
,gmusim_gr
,gmusim_size
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | require(sitar)
data(heights)
x <- heights$age
y <- heights$height
men <- heights$men
id <- heights$id
df <- 5
#since negative value are censored, here use absolute value
z <- data.frame(z1=abs(men))
p <- 1
n <- length(x)
## Do not calculate phv, aphv and hphv
resu1 <- gmusim_both(x,y,z,p,n,id,df)
summary(resu1)
## Calculate phv, aphv and height at phv (hphv)
resu2 <- gmusim_both(x,y,z,p,n,id,df,cal=TRUE)
summary(resu2)
aphv <- resu2$calindex
fitted.values <- resu2$fitted.values
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.