MyNixOS website logo
Description

Generate Standardized Data.

Creates simulated data from structural equation models with standardized loading. Data generation methods are described in Schneider (2013) <doi:10.1177/0734282913478046>.

simstandard

CRANstatus Rdoc
R-CMD-check

Sometimes you have a structural model with standardized path coefficients, structural coefficients, and correlations, but you do not know the error and disturbance variances. The purpose of simstandard is to calculate these variances and then simulate multivariate normal data based on your model.

Installation

You can either install simstandard from CRAN or install the development version 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 if the remotes packages is installed. If not, run this:

install.packages("remotes")

Once you are sure you have the remotes package installed, you can install the development version of simstandard from GitHub by running this code:

remotes::install_github("wjschne/simstandard")

Example

The simstandard package uses lavaan syntax to specify models.

library(simstandard)
model <- "
A =~ 0.5 * A1 + 0.8 * A2
B =~ 0.6 * B1 + 0.7 * B2
B ~ 0.8 * A
C ~~ 0.5 * A
"
data <- sim_standardized(m = model, n = 500)

knitr::kable(head(data), digits = 2)
A1A2B1B2CABe_A1e_A2e_B1e_B2d_B
-1.31-1.03-0.80-0.971.08-0.110.55-1.26-0.94-1.13-1.350.63
0.381.240.640.75-0.730.001.200.381.24-0.08-0.081.20
-0.83-0.552.121.21-0.250.121.02-0.88-0.651.510.500.93
1.13-0.231.511.400.920.401.310.93-0.550.730.480.99
0.90-0.62-0.85-0.28-0.30-0.19-0.430.99-0.47-0.600.02-0.28
0.050.630.901.141.030.460.76-0.180.260.450.610.39

See more in the tutorial for this package.

Metadata

Version

0.6.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows