Description Usage Arguments Value Examples
This function calculates the proportion using either a raw data frame or a simulated common factor or network model. Based on procedure described by van Bork et al. (2019)
1 | CorPcorProp(df, type = "obs", n = NULL, seed = NULL)
|
df |
input data frame consisting of variables in the measurement model |
type |
input character to (arbitrarily) name LV X in lavaan syntax. Defaults to "obs" for observed proportion but can simulate "ufm" (unidimensional factor model ) or "snm" (sparse network model) |
n |
optional input number of simulated samples to use if specifying latent or network model. If comparing ufm and snm, the same n should be specified. |
seed |
optional input number to set random seed for simulations. If comparing ufm and snm, the same seed should be specified. |
the observed proportion (for raw data) or a vector of simuluated proportions (based on specified model type)
1 2 3 | obs <- CorPcorProp(df, type = "obs")
ufm <- CorPcorProp(df, type = "ufm", n = 100, seed = 123)
snm <- CorPcorProp(df, type = "snm", n = 100, seed = 123)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.