simulate_alpha {psychmeta} | R Documentation |
Generate a vector of simulated sample alpha coefficients
Description
This function generates inter-item covariance matrices from a population matrix and computes a coefficient alpha reliability estimate for each matrix.
Usage
simulate_alpha(
item_mat = NULL,
alpha = NULL,
k_items = NULL,
n_cases,
k_samples,
standarized = FALSE
)
Arguments
item_mat |
Item correlation/covariance matrix. If item_mat is not supplied, the user must supply both |
alpha |
Population alpha value. Must be supplied if |
k_items |
Number of items on the test to be simulated. Must be supplied if |
n_cases |
Number of cases to simulate in sampling distribution of alpha. |
k_samples |
Number of samples to simulate. |
standarized |
Should alpha be computed from correlation matrices ( |
Value
A vector of simulated sample alpha coefficients
Examples
## Define a hypothetical matrix:
item_mat <- reshape_vec2mat(cov = .3, order = 12)
## Simulations of unstandardized alphas
set.seed(100)
simulate_alpha(item_mat = item_mat, n_cases = 50, k_samples = 10, standarized = FALSE)
set.seed(100)
simulate_alpha(alpha = mean(item_mat[lower.tri(item_mat)]) / mean(item_mat),
k_items = ncol(item_mat), n_cases = 50, k_samples = 10, standarized = FALSE)
## Simulations of standardized alphas
set.seed(100)
simulate_alpha(item_mat = item_mat, n_cases = 50, k_samples = 10, standarized = TRUE)
set.seed(100)
simulate_alpha(alpha = mean(item_mat[lower.tri(item_mat)]) / mean(item_mat),
k_items = ncol(item_mat), n_cases = 50, k_samples = 10, standarized = TRUE)
[Package psychmeta version 2.7.0 Index]