recalib: Recalibrate x, y data using SITAR random effects

View source: R/sitarlib.R

recalibR Documentation

Recalibrate x, y data using SITAR random effects

Description

A function to recalibrate x,y data using SITAR random effects

Usage

recalib(xc, yc, id = NULL, data, xcnew = NULL, ycnew = NULL, model, from, to)

Arguments

xc

character vector defining column name(s) of x data to be recalibrated.

yc

character vector defining column name(s) of y data to be recalibrated.

id

factor defining from and to rows. If NULL then recalibrate all rows.

data

dataframe containing xc, yc and id.

xcnew

column names for replacement columns xc. If default NULL then use names xcnew1... .

ycnew

column names for replacement columns yc. If default NULL then use names ycnew1... .

model

sitar model defining the random effects to be used for recalibration.

from

level of id defining existing data (must be a single row in coef{model}).

to

level of id defining data to be recalibrated (a single row in coef{model}).

Details

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'].

Value

Returns the dataframe data with the from rows of xc and yc recalibrated.

Author(s)

Tim Cole tim.cole@ucl.ac.uk


statist7/sitar documentation built on Feb. 7, 2024, 2:08 a.m.