- Notifications
You must be signed in to change notification settings - Fork2
Creates simulated data from structural equation models with standardized loadings
License
wjschne/simstandard
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Sometimes you have a structural model with standardized pathcoefficients, structural coefficients, and correlations, but you do notknow the error and disturbance variances. The purpose ofsimstandardis to calculate these variances and then simulate multivariate normaldata based on your model.
You can either install simstandard from CRAN or install the developmentversion of simstandard from github.
You can install simstandard from CRAN by running this code:
install.packages("simstandard")To install the development version of simstandard, you need to check ifthe remotes packages is installed. If not, run this:
install.packages("remotes")Once you are sure you have the remotes package installed, you caninstall the development version of simstandard from GitHub by runningthis code:
remotes::install_github("wjschne/simstandard")
Thesimstandard package useslavaansyntax to specifymodels.
library(simstandard)model<-"A =~ 0.5 * A1 + 0.8 * A2B =~ 0.6 * B1 + 0.7 * B2B ~ 0.8 * AC ~~ 0.5 * A"data<- sim_standardized(m=model,n=500)knitr::kable(head(data),digits=2)
| A1 | A2 | B1 | B2 | C | A | B | e_A1 | e_A2 | e_B1 | e_B2 | d_B |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.95 | -0.20 | -0.48 | 0.64 | -0.07 | 0.25 | 0.62 | 0.83 | -0.40 | -0.85 | 0.21 | 0.42 |
| -0.58 | -0.47 | 0.60 | 0.87 | 1.03 | 0.43 | -0.83 | -0.80 | -0.82 | 1.10 | 1.46 | -1.18 |
| -0.06 | -1.82 | -1.45 | -1.34 | 0.10 | -1.46 | -2.38 | 0.67 | -0.66 | -0.02 | 0.33 | -1.21 |
| -2.50 | -0.51 | -0.95 | -1.75 | -0.68 | -1.18 | -1.90 | -1.92 | 0.43 | 0.19 | -0.42 | -0.96 |
| 1.05 | -0.64 | 0.19 | 0.22 | 1.36 | -0.36 | -0.28 | 1.23 | -0.36 | 0.35 | 0.42 | 0.01 |
| -0.01 | -0.83 | -0.67 | -0.86 | 0.49 | -0.75 | -0.32 | 0.36 | -0.24 | -0.47 | -0.63 | 0.27 |
See more in thetutorial for thispackage.
About
Creates simulated data from structural equation models with standardized loadings
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
