Learn R Programming

RAMpath (version 0.5.1)

ramLCM: Conduct growth curve analysis

Description

Conduct growth curve analysis

Usage

ramLCM(data, outcome, model = c("all", "no", "linear", "quadratic", "latent"), 
basis = 0:(length(outcome) - 1), predictor, equal.var = TRUE, digits = 3, 
ram.out = FALSE, ...)

Value

model

The lavaan model specification of the bivariate latent change score model

lavaan

The lavaan output

ram

Output in terms of RAM matrices

fit

Model fit

Arguments

data

Data

outcome

Outcome variable indices

model

Models to fit

basis

Basis coefficients

predictor

Covariates as predictors

equal.var

Set residual variances to be equal

digits

Print digits

ram.out

Print ram matrices

...

Options can be used for lavaan

References

Zhang, Z., Hamagami, F., Grimm, K. J., & McArdle, J. J. (2015). Using R package RAMpath for tracing SEM path diagrams and conducting complex longitudinal data analysis. Structural Equation Modeling, 22(1), 132-147. https://doi.org/10.1080/10705511.2014.935257

Examples

Run this code
data(ex3)
## Example 3. Growth curve models
gcm.all<-ramLCM(ex3, 1:6, ram.out=TRUE)
## plot the path diagram
bridge<-ramPathBridge(gcm.all$ram$latent, FALSE, FALSE)
## uncomment to plot
## plot(bridge, 'latent')

##unequal variance
gcm.all<-ramLCM(ex3, 1:6, ram.out=TRUE, equal.var=FALSE)

## missing data
gcm.all<-ramLCM(ex3, c(1,2,4,6), basis=c(1,2,4,6), ram.out=TRUE)

gcm.l<-ramLCM(ex3, 1:6, model='linear', ram.out=TRUE)

## with a predictor
gcm.pred<-ramLCM(ex3, c(1,2,4,6), model='linear', basis=c(1,2,4,6), 
                 predictor=c(3,5), ram.out=TRUE)
bridge3<-ramPathBridge(gcm.pred$ram$linear)
## uncomment to plot
## plot(bridge3, 'gcmlinear')

Run the code above in your browser using DataLab