Example 1: Fit multivariate bilinear spline LGCMs fixed knots to
evaluate the development of reading and mathematics ability from
Kindergarten to Grade 5.
RM_PLGCM.r <- getMGM(
dat = RMS_dat0, t_var = c("T", "T"), y_var = c("R", "M"), curveFun = "BLS",
intrinsic = FALSE, records = list(1:9, 1:9), y_model = "LGCM",
tries = 10, paramOut = TRUE
)
Figure1 <- getFigure(
model = RM_PLGCM.r@mxOutput, sub_Model = "MGM", y_var = c("R", "M"), curveFun = "BLS",
y_model = "LGCM", t_var = c("T", "T"), records = list(1:9, 1:9), xstarts = xstarts,
xlab = "Month", outcome = c("Reading", "Mathematics")
)
#> Treating first argument as an object that stores a character
#> Treating first argument as an object that stores a character
show(Figure1)
#> figOutput Object
#> --------------------
#> Trajectories: 2
#>
#> Trajectory 1 :
#> Figure 1:
#> `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

#>
#> Trajectory 2 :
#> Figure 1:
#> `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

Example 2: Fit multivariate bilinear spline LGCMs with random knots
to evaluate the development of reading and mathematics ability from
Kindergarten to Grade 5.
RM_PLGCM.f <- getMGM(
dat = RMS_dat0, t_var = c("T", "T"), y_var = c("R", "M"), curveFun = "BLS",
intrinsic = TRUE, records = list(1:9, 1:9), y_model = "LGCM",
tries = 10, paramOut = TRUE
)
Figure2 <- getFigure(
model = RM_PLGCM.f@mxOutput, sub_Model = "MGM", y_var = c("R", "M"), curveFun = "BLS",
y_model = "LGCM", t_var = c("T", "T"), records = list(1:9, 1:9), xstarts = xstarts,
xlab = "Month", outcome = c("Reading", "Mathematics")
)
#> Treating first argument as an object that stores a character
#> Treating first argument as an object that stores a character
show(Figure2)
#> figOutput Object
#> --------------------
#> Trajectories: 2
#>
#> Trajectory 1 :
#> Figure 1:
#> `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

#>
#> Trajectory 2 :
#> Figure 1:
#> `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'
