strel {Bayesrel} | R Documentation |
Estimate single test reliability coefficients for unidimensional scales
Description
Reliability estimation of alpha, lambda2, the glb, and omega in a Bayesian an frequentist way. The results include posterior and bootstrapped distributions, point estimates, credible intervals, and confidence intervals.
Usage
strel(
data = NULL,
estimates = c("alpha", "lambda2", "glb", "omega"),
interval = 0.95,
n.iter = 1000,
n.burnin = 50,
thin = 1,
n.chains = 3,
n.boot = 1000,
cov.mat = NULL,
n.obs = NULL,
freq = TRUE,
Bayes = TRUE,
para.boot = FALSE,
item.dropped = FALSE,
missing = "pairwise",
omega.freq.method = "cfa",
omega.int.analytic = TRUE,
alpha.int.analytic = TRUE,
callback = function() {
},
k0 = 1e-10,
df0 = NULL,
a0 = 2,
b0 = 1,
m0 = 0,
disableMcmcCheck = FALSE
)
Arguments
data |
The dataset to be analyzed, observations are rows, items are columns |
estimates |
A character vector containing the estimands, we recommend using lambda4 with only a few items due to the computation time |
interval |
A number specifying the uncertainty interval |
n.iter |
A number for the iterations of the Gibbs Sampler |
n.burnin |
A number for the burnin in the Gibbs Sampler |
thin |
A number for the thinning of the MCMC samples |
n.chains |
A number for the chains to run for the MCMC sampling |
n.boot |
A number for the bootstrap samples |
cov.mat |
A covariance matrix can be supplied instead of a dataset, but number of observations needs to be specified |
n.obs |
A number for the sample observations when a covariance matrix is supplied and the factor model is calculated |
freq |
A logical for calculating the frequentist estimates |
Bayes |
A logical for calculating the Bayesian estimates |
para.boot |
A logical for calculating the parametric bootstrap, the default is the non-parametric |
item.dropped |
A logical for calculating the if-item-dropped statistics |
missing |
A string specifying the way to handle missing data, 'listwise' is self-explanatory, 'pairwise' in the Bayesian paradigm means sampling the missing values as additional parameters from the joint conditional distribution, in the frequentist paradigm this means using the 'pairwise' covariance matrix, except the full information ML method for omega |
omega.freq.method |
A character string for the method of frequentist omega, either "cfa" (confirmatory factor analysis), or "pfa" (principal factor analysis), with "pfa" the interval is always bootstrapped |
omega.int.analytic |
A logical for calculating the omega confidence interval analytically, only works with cfa as the omega.freq.method |
alpha.int.analytic |
A logical for calculating the alpha confidence interval analytically |
callback |
Empty function call for external use |
k0 |
A scalar multiplier for the diagonal of the scaling matrix of the inverse Wishart prior distribution for alpha, lambda2, and the glb |
df0 |
The degrees of freedom of the inverse Wishart prior distribution for alpha, lambda2, and the glb, the default is NULL, which sets the df as the number of items |
a0 |
The shape parameter of the inverse gamma prior distribution for the residual variances in the single factor model for omega |
b0 |
The scale parameter of the inverse gamma prior distribution for the residual variances in the single factor model for omega |
m0 |
The prior mean of the normal distribution on the factor loadings for omega |
disableMcmcCheck |
A logical disabling the MCMC settings check for running tests and the likes |
Details
Reported are point estimates (posterior mean), Bayesian credible intervals (highest posterior density) and frequentist confidence intervals (non parametric or parametric bootstrap). The estimates supported are Cronbach alpha, Guttman's lambda2/4/6, the glb, and Mcdonald's omega_u (unidimensional). Beware of lambda4 with many indicators, the computational effort is considerable. The glb method uses adjusted code from the 'Rcsdp' package by 'Hector Corrada Bravo', <https://CRAN.R-project.org/package=Rcsdp>. This process applies a slightly adjusted solving algorithm from the 'CSDP' library by 'Brian Borchers' <https://github.com/coin-or/Csdp/wiki>, <doi:10.1080/10556789908805765>, but is wrapped in 'RcppArmadillo'. Guttman's Lambda-4 method is from 'Benton' (2015) <doi:10.1007/978-3-319-07503-7_19>. The principal factor analysis (pfa) for a version of frequentist omega_u can be found in 'Rencher' (2007) and is described in 'Schlegel' (2017) <https://www.r-bloggers.com/2017/03/iterated-principal-factor-method-of-factor-analysis-with-r/>. Coefficients alpha, lambda2/4, and the glb are estimated from the data covariance matrix. Coefficient omega is estimated from the centered data matrix. The analytic confidence interval of alpha is from 'Bonett' and 'Wright' (2015) <doi:10.1002/job.1960>.
The prior distribution on Cronbach’s alpha (as well as lambda2 and the glb) is induced by the prior distribution on the covariance matrix, which is an inverse Wishart distribution with the identity matrix (multiplied by a scalar) as a scaling matrix and the number of items k as the degrees of freedom. The prior distribution on McDonald’s omega is induced by the prior distributions on the single-factor model parameters, which are: a normal distribution centered on zero for the factor loadings and scores; an inverse gamma distribution with shape=2 and scale=1 for the residuals; and for the variance of the latent variables an inverse Wishart distribution with the number of items k as a scaling matrix (scalar, since it is of dimension one) and the sum k+2 as the degrees of freedom.
Value
The basic output displays the interval bounds of the coefficients, highest posterior density intervals for the Bayesian coefficients, and confidence intervals for the frequentist coefficients. The summary output shows the point estimates of the coefficients together with the interval bounds. The point estimates for the Bayesian coefficients are posterior means.
References
Bonett DG, Wright TA (2015). “Cronbach's alpha reliability: Interval estimation, hypothesis testing, and sample size planning.” Journal of Organizational Behavior, 36(1), 3–15. doi:10.1002/job.1960.
Murphy KP (2007). “Conjugate Bayesian analysis of the Gaussian distribution.” University of British Columbia.
Lee S (2007). Structural equation modeling: A Bayesian approach. John Wiley & Sons.
Pfadt JM, van den Bergh D, Sijtsma K, Moshagen M, Wagenmakers E (2021). “Bayesian estimation of single-test reliability coefficients.” Multivariate Behavioral Research, 1–30. doi:10.1080/00273171.2021.1891855.
Rencher AC (2002). Methods of multivariate analysis. John Wiley & Sons, Inc. doi:10.1002/0471271357.
Examples
# note that these are very few iterations just for the example execution,
# you should use the defaults at least
summary(strel(asrm, estimates = "lambda2", n.chains = 2, n.iter = 200, n.boot = 200))
summary(strel(asrm, estimates = "lambda2", item.dropped = TRUE, n.chains = 2,
n.iter = 200, freq = FALSE))