Detrends the phase B part of time series y.
detrend B is optional and not validated.
The mean of the detrended signal will be set to the predicted value based on detrend_B_position:
detrend_B_position = "first" : take predicted value for first valid observation
detrend_B_position = "center" : take predicted value for center observation
detrend_B_position = "last" : take predicted value for last valid observation.
Usage
detrend_B(x, x_values, y, detrend_B_position = "center")
Value
List with the trend and the detrended y values:
x_values_B_trend = vector with distance (time markers) between B-detrended signal,
y_B_trend = vector with computed B-trend,
y_detrended = vector with computed B-detrended y values.
Arguments
x
factor vector to indicate conditions or phases (e.g., "A" and "B")
x_values
numerical vector with distance (time markers) between observations