alphaR | R Documentation |
alphaR
can generate a list of fungible correlation matrices with a
user-defined (standardized) coefficient \alpha
.
alphaR(alpha, k, Nmats, SEED)
alpha |
(numeric) A desired coefficient |
k |
(integer). The order of each R (correlation) matrix. |
Nmats |
(integer) The number of fungible R matrices with a known
|
SEED |
(numeric) The initial seed for the random number generator. If SEED is not supplied then the program will generate (and return) a randomly generated seed. |
alpha The desired (standardized) coefficient \alpha
.
R The initial correlation matrix with a desired
coefficient \alpha
.
Rlist A list with Nmats
fungible correlation
matrices with a desired coefficient \alpha
.
SEED The initial value for the random number generator.
Niels G. Waller
Waller, N. & Revelle, W. (2023). What are the mathematical
bounds for coefficient \alpha
? Psychological Methods.
doi.org/10.1037/met0000583
## Function to compute standardized alpha
Alphaz <- function(Rxx){
k <- ncol(Rxx)
k/(k-1) * (1 - (k/sum(Rxx)) )
}# END Alphaz
## Example 1
## Generate 25 6 x 6 R matrices with a standardized alpha of .85
alpha = .85
k = 6
Nmats = 25
SEED = 1
out = alphaR(alpha, k , Nmats, SEED)
Alphaz(out$Rlist[[1]])
## Example 2
## Generate 25 6 x 6 R matrices with a standardized alpha of -5
alpha = -5
k = 6
Nmats = 25
SEED = 1
out = alphaR(alpha, k , Nmats, SEED)
Alphaz(out$Rlist[[5]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.