| mplm | R Documentation |
The mplm() function computes a multivariate piecewise regression model. The
function automatically creates the regression formula based on the provided
data and the selected options. The default model includes trend, level, and
slope effects for each dependent variable. The regression formula can be
changed by providing a custom formula to the update argument.
mplm(
data,
dvar,
mvar,
pvar,
model = c("W", "H-M", "B&L-B", "JW"),
contrast = c("first", "preceding"),
contrast_level = c(NA, "first", "preceding"),
contrast_slope = c(NA, "first", "preceding"),
trend = TRUE,
level = TRUE,
slope = TRUE,
formula = NULL,
update = NULL,
na.action = na.omit,
...
)
## S3 method for class 'sc_mplm'
print(x, digits = "auto", std = FALSE, ...)
## S3 method for class 'sc_mplm'
export(
object,
caption = NA,
footnote = NA,
filename = NA,
nice = TRUE,
std = FALSE,
decimals = 2,
...
)
data |
A single-case data frame. See |
dvar |
Character string with the name of the dependent variable. Defaults to the attributes in the scdf file. |
mvar |
Character string with the name of the measurement time variable. Defaults to the attributes in the scdf file. |
pvar |
Character string with the name of the phase variable. Defaults to the attributes in the scdf file. |
model |
Model used for calculating the dummy parameters (see Huitema &
McKean, 2000). Default is |
contrast |
Sets contrast_level and contrast_slope. Either "first", "preceding" or a contrast matrix. If NA contrast is ignored. |
contrast_level |
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast. |
contrast_slope |
Either "first", "preceding" or a contrast matrix. If NA contrast_level is a copy of contrast. |
trend |
A logical indicating if a trend parameters is included in the model. |
level |
A logical indicating if a level parameters is included in the model. |
slope |
A logical indicating if a slope parameters is included in the model. |
formula |
Defaults to the standard piecewise regression model. The
parameter phase followed by the phase name (e.g., |
update |
An easier way to change the regression formula (e.g., |
na.action |
Defines how to deal with missing values. |
... |
Further arguments passed to the |
x |
Object returned from |
digits |
The minimum number of significant digits to be use. If set to "auto" (default), values are predefined. |
std |
If TRUE, a table with standardized estimates is included. |
object |
An scdf or an object exported from a scan function. |
caption |
Character string with table caption. If left NA (default) a caption will be created based on the exported object. |
footnote |
Character string with table footnote. If left NA (default) a footnote will be created based on the exported object. |
filename |
String containing the file name. If a filename is given the output will be written to that file. |
nice |
If set TRUE (default) output values are rounded and optimized for publication tables. |
decimals |
Decimal places that are reported. |
The function currently only supports single-case data (i.e., one case per dataset). For multilevel piecewise regression models, please use the hplm function.
model | Character string from function call (see arguments above). |
contrast | List with contrast definitions. |
full.model | Full regression model list. |
formula | Formula of the mplm model. |
print(sc_mplm): Print results
export(sc_mplm): Export results as html
Juergen Wilbert
Other regression functions:
bplm(),
fetch(),
hplm(),
plm(),
print.sc_ac(),
print.sc_bctau(),
trend()
res <- mplm(Leidig2018$`1a1`,
dvar = c("academic_engagement", "disruptive_behavior")
)
print(res)
## also report standardized coefficients:
print(res, std = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.