Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Creates simulated data from structural equation models with standardized loadings

License

NotificationsYou must be signed in to change notification settings

wjschne/simstandard

Repository files navigation

R-CMD-checkCRAN statusLifecycle: stableCodecov test coverageR-CMD-check

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.

Installation

You can either install simstandard from CRAN or install the developmentversion of simstandard from github.

Option 1: Install the most recent stable release from CRAN

You can install simstandard from CRAN by running this code:

install.packages("simstandard")

Option 2: Install the development version from GitHub

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

Example

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)
A1A2B1B2CABe_A1e_A2e_B1e_B2d_B
0.95-0.20-0.480.64-0.070.250.620.83-0.40-0.850.210.42
-0.58-0.470.600.871.030.43-0.83-0.80-0.821.101.46-1.18
-0.06-1.82-1.45-1.340.10-1.46-2.380.67-0.66-0.020.33-1.21
-2.50-0.51-0.95-1.75-0.68-1.18-1.90-1.920.430.19-0.42-0.96
1.05-0.640.190.221.36-0.36-0.281.23-0.360.350.420.01
-0.01-0.83-0.67-0.860.49-0.75-0.320.36-0.24-0.47-0.630.27

See more in thetutorial for thispackage.

About

Creates simulated data from structural equation models with standardized loadings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp