rIG | R Documentation |

Using the IG method to simulate non-normal data

```
rIG(N, sigma.target, skewness, excesskurtosis, reps = 1, typeA = "triang")
```

`N` |
Number of observations to simulate. |

`sigma.target` |
Target population covariance matrix |

`skewness` |
Target skewness |

`excesskurtosis` |
Target excess kurtosis |

`reps` |
Number of simulated samples |

`typeA` |
Symmetrical or triangular (default) A matrix |

A list of simulated samples

Njål Foldnes (njal.foldnes@gmail.com)

Foldnes, N. and Olson, U. H. (2016). A simple simulation technique for nonnormal data with prespecified skewness, kurtosis, and covariance matrix. Multivariate behavioral research, 51(2-3), 207-219

```
set.seed(1234)
model <- '
# measurement model
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + y2 + y3 + y4
dem65 =~ y5 + y6 + y7 + y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8'
fit <- lavaan::sem(model, data=lavaan::PoliticalDemocracy)
population.sigma <- lavaan::lavInspect(fit, "sigma.hat")
population.skew <- c(0, 0, 0, 0, 1, 1, 1, 1, 2,2,2 )
population.excesskurt <- c( 1 , 1, 1, 1, 3, 3, 3, 3, 15, 15, 15)
my.samples <- rIG(N=10^3, sigma=population.sigma,
skewness=population.skew,
excesskurt=population.excesskurt,
reps=5)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.