A function to recalibrate x,y data using SITAR random effects
recalib(xc, yc, id = NULL, data, xcnew = NULL, ycnew = NULL, model, from, to)
Returns the dataframe data
with the from
rows of
xc
and yc
recalibrated.
character vector defining column name(s) of x
data to be
recalibrated.
character vector defining column name(s) of y
data to be
recalibrated.
factor defining from
and to
rows. If NULL
then recalibrate all rows.
dataframe containing xc
, yc
and id
.
column names for replacement columns xc
. If default
NULL
then use names xcnew1... .
column names for replacement columns yc
. If default
NULL
then use names ycnew1... .
sitar
model defining the random effects to be used for
recalibration.
level of id
defining existing data (must be a single row
in coef{model}
).
level of id
defining data to be recalibrated (a single row
in coef{model}
).
Tim Cole tim.cole@ucl.ac.uk
recalib
recalibrates the values of xc
and yc
based on
model
. xc
values are changed to:
(xc-c(coef[from,'b']))*exp(coef[from,'c']-coef[to,'c'])+coef[to,'b'].
yc
values are changed to: yc-coef[from,'a']+coef[to,'a']
.