MyNixOS website logo
Description

Bayesian Reliability Estimation.

Functionality for reliability estimates. For 'unidimensional' tests: Coefficient alpha, 'Guttman's' lambda-2/-4/-6, the Greatest lower bound and coefficient omega_u ('unidimensional') in a Bayesian and a frequentist version. For multidimensional tests: omega_t (total) and omega_h (hierarchical). The results include confidence and credible intervals, the probability of a coefficient being larger than a cutoff, and a check for the factor models, necessary for the omega coefficients. The method for the Bayesian 'unidimensional' estimates, except for omega_u, is sampling from the posterior inverse 'Wishart' for the covariance matrix based measures (see 'Murphy', 2007, <https://groups.seas.harvard.edu/courses/cs281/papers/murphy-2007.pdf>. The Bayesian omegas (u, t, and h) are obtained by 'Gibbs' sampling from the conditional posterior distributions of (1) the single factor model, (2) the second-order factor model, (3) the bi-factor model, (4) the correlated factor model ('Lee', 2007, <doi:10.1002/9780470024737>).

R build status codecov

Installation

You can install the released version of Bayesrel from CRAN with:

install.packages("Bayesrel")

or install the latest version of Bayesrel from [github] (https://github.com) with the help of the remotes-package:

remotes::install_github("juliuspfadt/Bayesrel")

Example

Unidimensional data

This is a basic example which shows you how to compute alpha, lambda2, the glb, and omega for an example real data set. The output includes both Bayesian and frequentist estimates.

library(Bayesrel)
## basic example code
## load example data set from the package
## run the main reliability function
res <- strel(data = asrm)
## get a full result output
summary(res)
## return the probability that coefficient alpha is larger than .70
pStrel(x = res, estimate = "alpha", low.bound = .70)

## get the posterior median of, e.g., alpha instead of the mean:
median(res$Bayes$samp$Bayes_alpha)

Multidimensional data

Bayesian estimation

Second-order model

This is a basic example which shows you how to compute omega_t and omega_h for an example real data set. The data follow a second-order factor model with no crossloadings:

library(Bayesrel)
## basic example code
## run the Bayesian omegas, specify 5 group factors
res <- bomegas(data = upps, n.factors = 5, missing = "impute")
## get a full result output
summary(res)
## return the probability that coefficient omega_t is larger than .70
pOmegas(x = res, cutoff.t = .70)
## plot posterior predictive check for the higher-order (second-order) factor model
multiFit(x = res, data = upps)

In the example above we implicitly assumed that the items of the data set were ordered so that, with 5 group factors, the first four items load on the first factor, items 5-8 load on the second factor and so on. When the data is not organized this way and/or the items cannot be distributed among the factors evenly, one can specify a model syntax relating the items to the group factors in lavaan style. The item names need to equal the variable names in the data:

model <- "
  f1 =~ U17_r + U22_r + U29_r + U34_r
  f2 =~ U4 + U14 + U19 + U27
  f3 =~ U6 + U16 + U28 + U48
  f4 =~ U23_r + U31_r + U36_r + U46_r
  f5 =~ U10_r + U20_r + U35_r + U52_r
  "
res <- bomegas(data = upps, n.factors = 5, model = model, missing = "impute")

Crossloadings

If crossloadings are to be specified, you need a model syntax file to pass to the bomegas function. For instance, assume that item U29_r and U34_r load on f3 and f4, respectively.

model <- "
  f1 =~ U17_r + U22_r + U29_r + U34_r
  f2 =~ U4 + U14 + U19 + U27
  f3 =~ U6 + U16 + U28 + U48 + U29_r
  f4 =~ U23_r + U31_r + U36_r + U46_r + U34_r
  f5 =~ U10_r + U20_r + U35_r + U52_r
  "
res <- bomegas(data = upps, n.factors = 5, model = model, missing = "impute")

Bi-factor and correlated factor model

The necessary code to infer omega_t and omega_h from a bi-factor model is analogue to the second-order model, except that the model.type changes from the default second-order to bi-factor. Note, that crossloadings are not permitted in the bi-factor model at this point. If model.type = "correlated" the correlated factor model is fit to the data. Crosslaodings are allowed. Only omega_t may be estimated. The remaining code stays the same as in the examples above. Which factor model is appropriate for the data is up to theoretical considerations and model fit.

Frequentist estimation

The frequentist estimation roughly follows the same steps as the Bayesian one. For instance, with the correlated factor model:

res <- omegasCFA(data = upps, n.factors = 5, model.type = "correlated")
res
Metadata

Version

0.7.7

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows