pop_mod | R Documentation |

Helper function to obtain population model for simulation based on data and model

```
pop_mod(mod, x, type = "NM", standardized = TRUE, afl = 0.7, aco = 0.3)
```

`mod` |
A lavaan model (only CFA supported so far) |

`x` |
A dataset for the model of nrow observations (minimum: 50) and ncol indicators (minimum: 4) |

`type` |
Type of population model. NM (the default): Uses the factor loadings and covariances from Niemand & Mai's (2018) simulation study. HB: Uses the factor loadings and covariances from Hu & Bentler's (1999) simulation study. EM: Empirical, uses the given factor loadings and covariances. EM is not recommended for confirmative use as it leads to the least generalizable cutoffs. |

`standardized` |
Are factor loadings assumed to be standardized and covariances to be correlations (default: TRUE)? |

`afl` |
Average factor loading of indicators per factor, only relevant for type = "NM" (default: .7). |

`aco` |
Average correlation between factors, only relevant for type = "NM" (default: .3). |

List of population model type, standardized, average factor loading and average correlation. All values are round to three decimals.

```
mod <- "
F1 =~ Q5 + Q7 + Q8
F2 =~ Q2 + Q4
F3 =~ Q10 + Q11 + Q12 + Q13 + Q18 + Q19 + Q20 + Q21 + Q22
F4 =~ Q1 + Q17
F5 =~ Q6 + Q14 + Q15 + Q16
"
pop_mod(mod, x = bb1992, type = "NM")$pop.mod
pop_mod(mod, x = bb1992, type = "HB")$pop.mod
pop_mod(mod, x = bb1992, type = "EM")$pop.mod
pop_mod(mod, x = bb1992, type = "NM", afl = .9)$pop.mod
pop_mod(mod, x = bb1992, type = "NM", aco = .5)$pop.mod
pop_mod(mod, x = bb1992, type = "EM", standardized = FALSE)$pop.mod
```

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.