simulate_alpha | R Documentation |
This function generates inter-item covariance matrices from a population matrix and computes a coefficient alpha reliability estimate for each matrix.
simulate_alpha( item_mat = NULL, alpha = NULL, k_items = NULL, n_cases, k_samples, standarized = FALSE )
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 ( |
A vector of simulated sample alpha coefficients
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.