The mplm
function computes a multivariate piecewise regression model.
mplm(
data,
dvar,
mvar,
pvar,
model = "W",
contrast = "first",
contrast_level = NA,
contrast_slope = NA,
trend = TRUE,
level = TRUE,
slope = TRUE,
formula = NULL,
update = NULL,
na.action = na.omit,
...
)
Character string from function call (see
Arguments
above).
Full regression model list
A single-case data frame. See scdf
to learn about
this format.
Character string with the name of the dependent variable. Defaults to the attributes in the scdf file.
Character string with the name of the measurement time variable. Defaults to the attributes in the scdf file.
Character string with the name of the phase variable. Defaults to the attributes in the scdf file.
Model used for calculating the dummy parameters (see Huitema &
McKean, 2000). Default is model = "W"
. Possible values are:
"B&L-B"
, "H-M"
, "W"
, and deprecated "JW"
.
Sets contrast_level and contrast_slope. Either "first", "preceding" or a contrast matrix.
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast.
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast.
A logical indicating if a trend parameters is included in the model.
A logical indicating if a level parameters is included in the model.
A logical indicating if a slope parameters is included in the model.
Defaults to the standard piecewise regression model. The parameter phase followed by the phase name (e.g., phaseB) indicates the level effect of the corresponding phase. The parameter 'inter' followed by the phase name (e.g., interB) adresses the slope effect based on the method provide in the model argument (e.g., "B&L-B"). The formula can be changed for example to include further variables into the regression model.
An easier way to change the regression formula (e.g., . ~ . + newvariable).
Defines how to deal with missing values
Further arguments passed to the lm function.
Juergen Wilbert
Other regression functions:
corrected_tau()
,
hplm()
,
plm()
res <- mplm(Leidig2018$`1a1`, dvar = c("academic_engagement", "disruptive_behavior"))
print(res)
## also report standardized coefficients:
print(res, std = TRUE)
Run the code above in your browser using DataLab