12  Multivariate piecewise regression

Note

Read Chapter 10 before you start with this chapter.

The mplm function call:

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,
  
)

Figure 12.1: Example dataset
fit <- mplm(exampleAB_add, dvar = c("wellbeing", "depression"))
fit
Multivariate piecewise linear model

Dummy model: W level = first, slope = first
Type III MANOVA 
Pillai = 0.42; F(6, 72) = 3.20; p = 0.008 

                 wellbeing depression Pillai       F     p
Intercept           48.417      4.200  0.915 188.949 0.000
Trend                0.379      0.114  0.055   1.009 0.375
Level Medication     3.588     -0.945  0.033   0.588 0.561
Slope Medication    -0.275     -0.165  0.039   0.712 0.498

Formula: y ~ 1 + day + phaseMedication + interMedication
print(fit, std = TRUE)
Multivariate piecewise linear model

Dummy model: W level = first, slope = first
Type III MANOVA 
Pillai = 0.42; F(6, 72) = 3.20; p = 0.008 

                 wellbeing depression Pillai       F     p
Intercept            0.000      0.000  0.915 188.949 0.000
Trend                0.694      0.441  0.055   1.009 0.375
Level Medication     0.276     -0.153  0.033   0.588 0.561
Slope Medication    -0.356     -0.449  0.039   0.712 0.498

Coefficients are standardized
Formula: y ~ 1 + day + phaseMedication + interMedication