Calculation of linear regressions for given combination of events
Usage
hsCombiLinReg(
data,
combi,
uselm = FALSE,
clever = FALSE,
prep = FALSE,
calc.rmse = TRUE,
dbg = FALSE
)Arguments
- data
dataframe containing columns tstamp (time stamp), pval (probe value), lval (lab value), evtID (event ID)- combi
combination of events for which linear regressions are to be calculated in the following way: the first event numbers in
combi, at positionsseq_len(length(combi) - 1), are considered to be "base" events, i.e. events of which alldatapoints are considered for the linear regression. Thedatapoints belonging to the event given at the last position ofcombiare added "point by point" to these "base points" and each time a separate regression is calculated- uselm
if TRUE, the lm function is used to calculate the linear regression, otherwise (
uselm== FALSE) the regression is calculated "manually" which is much faster. default: FALSE- clever
if TRUE, sums and means are updated by knowledge of previous values with the current
datapoint, otherwise they are always recalculated for all datapoints to be considered- prep
if TRUE,
datais expected to contain columns x2 (squares of x), xy (product of x and y values). Unfortunately, this does not give a better performance...- calc.rmse
if TRUE, the root mean square error (RMSE) is calculated
- dbg
If
TRUE, debug messages are shown