generateCovItems | R Documentation |
If you need access to the correlation matrix used to generate the absolute latent scores then you will need to generate them yourself. This is not difficult. See how in the example.
generateCovItems(df, numItems, th = 0.5, name, ..., scale = 1, alpha = 1)
df |
a data frame with pairs of vertices given in columns |
numItems |
how many items to create |
th |
a vector of thresholds |
name |
a vector of item names |
... |
Not used. Forces remaining arguments to be specified by name. |
scale |
a vector of scaling constants |
alpha |
a vector of item discriminations |
The given data.frame df
with additional columns for each item.
In addition, you can obtain the correlation matrix used
to generate the latent worths from attr(df, "cor")
and
and latent worths from attr(df, "worth")
.
See cmp_probs for details.
Other item generators:
generateFactorItems()
,
generateItem()
,
generateSingleFactorItems()
library(mvtnorm)
df <- twoLevelGraph(letters[1:10], 100)
df <- generateCovItems(df, 3)
# generateCovItems essentially does the same thing as:
numItems <- 3
palist <- letters[1:10]
trueCor <- cov2cor(rWishart(1, numItems, diag(numItems))[,,1])
theta <- rmvnorm(length(palist), sigma=trueCor)
dimnames(theta) <- list(palist, paste0('i', 3 + 1:numItems))
df <- generateItem(df, theta)
attr(df, "cor")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.