Skip to contents

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

data frame 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 positions seq_len(length(combi) - 1), are considered to be "base" events, i.e. events of which all data points are considered for the linear regression. The data points belonging to the event given at the last position of combi are 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 data point, otherwise they are always recalculated for all datapoints to be considered

prep

if TRUE, data is 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