The hplm
function computes a hierarchical piecewise regression model.
hplm(
data,
dvar,
pvar,
mvar,
model = "B&L-B",
method = "ML",
control = list(opt = "optim"),
random.slopes = FALSE,
lr.test = FALSE,
ICC = TRUE,
trend = TRUE,
level = TRUE,
slope = TRUE,
fixed = NULL,
random = NULL,
update.fixed = NULL,
data.l2 = NULL,
...
)
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 phase 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.
Model used for calculating the slope parameter (see Huitema &
McKean, 2000). Default is model = "B&L-B"
. Possible values are:
"B&L-B"
, "H-M"
, "Mohr#1"
, "Mohr#2"
, "JW"
, "JW2"
, and
"Manly"
.
Method used to fit your model. Pass "REML"
to maximize
the restricted log-likelihood or "ML"
for maximized log-likelihood.
Default is "ML"
.
A list of settings for the estimation algorithm, replacing
the default values passed to the function lmeControl
of the
nlme
package.
If random.slopes = TRUE
random slope effects of
the level, trend, and treatment parameter are estimated.
If set TRUE likelihood ratio tests are calculated comparing model with vs. without random slope parameters.
If ICC = TRUE
an intraclass-correlation is estimated.
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 fixed part of 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 L1 or L2 variables into the regression model.
The random part of the model.
An easier way to change the fixed model part (e.g., . ~ . + newvariable).
A dataframe providing additional variables at Level 2. The scdf File has to have names for all cases and the Level 2 dataframe has to have a column named 'cases' with the names of the cases the Level 2 variables belong to.
Further arguments passed to the lme function.
List containing infromation about the applied model
Number of single-cases.
A list containing the fixed and the random formulas of the hplm model.
Object of class lme contaning the multilevel model
Object of class lme containing the Zero Model.
List containing intraclass correlation and test parameters.
Object of class gls containing the fixed effect model.
Other regression functions:
corrected_tau()
,
mplm()
,
plm()
# NOT RUN {
## Compute hplm model on a MBD over fifty cases (restricted log-likelihood)
hplm(exampleAB_50, method = "REML", random.slopes = FALSE)
## Analyzing with additional L2 variables
hplm(Leidig2018, data.l2 = Leidig2018_l2,
update.fixed = .~. + gender + migration + ITRF_TOTAL*phaseB,
slope = FALSE, random.slopes = FALSE, lr.test = FALSE)
# }
Run the code above in your browser using DataLab