exdataz: Do interpolation for original time measurements and...

Description Usage Arguments Details Value Author(s) Examples

Description

This function evenly partitions time measurements and produces additional ones for an individual in his/her age range. It then uses predict.gmusim to obtain additional fitted values to calculate age at peak velocity (apv), peak velocity (pv) and height (or weight) at peak velocity (ypv).

Usage

1
exdataz(x, z, p, id, idmat, n = round(365 * diff(range(x))))

Arguments

x

vector of ages (assume x is centered).

z

data.frame of time independent covariates (assume z is centered).

p

number of columns in data.frame z.

id

factor of subject identifiers.

idmat

matrix of unique id, note that this matrix has been setted to 1 column.

n

time (age) measures after extension for computing aphv (default is round(365*diff(range(x)))).

Details

For some individuals, the number of measurements is small. In order to calculate accurate apv (age at peak velocity), pv (peak velocity) and ypv (height at peak velocity or weight at peak velocity), it is necessary to perform interpolation for original time measurements and obtain additional predictions for each individual. This function extends time (age) measurements between min(time) and max(time), as well as covariates z, note that output of z has been centralized.

Value

a data frame including expanded x(age), centralization covariates z and corresponding id.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require(sitar)
data(heights)
x <- heights$age
h <- heights$height
id <- heights$id
men <- heights$men
men <- abs(men)-mean(abs(men))
z <- data.frame(z1=men)
p <- 1
idmat <- matrix(unique(id), ncol = 1)
newdata <- exdataz(x, z, p, id, idmat)

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