Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function to automatically define layout matrix for semPlot #2

Closed
milanwiedemann opened this issue Mar 6, 2019 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@milanwiedemann
Copy link
Owner

milanwiedemann commented Mar 6, 2019

at the moment the matrix needs to be specified manually, see the following for a univariate an bivariate lcsm with seven time points.

# Create layout matrix for univariate LCSM without intercepts
layout_uni_lcsm <- matrix(
  c(NA, "g2", NA, NA, NA, NA, NA, 
    NA, "dx2", "dx3", "dx4", "dx5", "dx6", "dx7",
    "lx1", "lx2", "lx3", "lx4", "lx5", "lx6", "lx7",
    "x1", "x2", "x3", "x4", "x5", "x6", "x7"),
  4, byrow = TRUE)

# Create layout matrix for bivariate LCSM without intercepts
layout_bi_lcsm <- matrix(
  c(NA, NA, "y1", "y2", "y3", "y4", "y5", "y6", "y7",
    NA, NA, "ly1", "ly2", "ly3", "ly4", "ly5", "ly6", "ly7",
    NA, NA, NA, "dy2", "dy3", "dy4", "dy5", "dy6", "dy7",
    NA, "j2",NA,NA, NA,  NA, NA, NA, NA, 
    NA, "g2", NA,NA, NA,  NA, NA, NA, NA, 
    NA, NA, NA, "dx2", "dx3", "dx4", "dx5", "dx6", "dx7", 
    NA, NA, "lx1", "lx2", "lx3", "lx4", "lx5", "lx6", "lx7",
    NA, NA, "x1", "x2", "x3", "x4", "x5", "x6", "x7"),
  8, byrow = TRUE)
@milanwiedemann milanwiedemann added the enhancement New feature or request label Mar 6, 2019
@milanwiedemann
Copy link
Owner Author

working on it, idea to create matrix from lavaan syntax, using lavaanify to get all info about manifest and latent vars and change factors

@milanwiedemann
Copy link
Owner Author

done a long time ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant