Title: | Congeneric Normal-Ogive Model |
Version: | 1.0.0 |
Description: | The congeneric normal-ogive model is a popular model for psychometric data (McDonald, R. P. (1997) <doi:10.1007/978-1-4757-2691-6_15>). This model estimates the model, calculates theoretical and concrete reliability coefficients, and predicts the latent variable of the model. This is the companion package to Moss (2020) <doi:10.31234/osf.io/nvg5d>. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
URL: | https://github.com/JonasMoss/conogive |
BugReports: | https://github.com/JonasMoss/conogive/issues |
RoxygenNote: | 7.1.0 |
Imports: | psych, mvtnorm, checkmate, assertthat |
Suggests: | testthat (≥ 2.1.0), psychTools, covr |
NeedsCompilation: | no |
Packaged: | 2020-06-30 10:02:28 UTC; jonas |
Author: | Jonas Moss |
Maintainer: | Jonas Moss <jonas.gjertsen@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2020-06-30 10:30:02 UTC |
Estimate a Congeneric Normal-Ogive Model
Description
conogive
is used to estimate congeneric normal-ogive models
(McDonald, R. P. (1997)).
Usage
conogive(data, use = "complete.obs", ...)
Arguments
data |
A data frame of observations or a named list with elements
|
use |
Passed to |
... |
Passed to |
Details
The data
argument can be either a list containing the parameters of
a normal-ogive model, or raw data. If actual data is passed to data
,
it is passed to psych::polychoric
to estimate its polychoric correlation
matrix and cutoffs. This is passed to psych::fa
to do a barebones
multivariate normal-ogive model. The ...
arguments are passed to
psych::fa
, which is called with fm = "ml"
by default.
Likert data should start with 1, not 0.
Value
An object of class conogive
.
References
McDonald, R. P. (1997). Normal-ogive multidimensional model. In W. J. van der Linden & R. K. Hambleton (Eds.), Handbook of Modern Item Response Theory (pp. 257–269). Springer. https://doi.org/10.1007/978-1-4757-2691-6_15 Moss, J. (2020). Please avoid the standardized alpha and the ordinal alpha. https://psyarxiv.com/nvg5d
Examples
if(require("psychTools")) {
extraversion = psychTools::bfi[c("E1", "E2", "E3", "E4", "E5")]
extraversion[, "E1"] = 7 - extraversion[, "E1"] # Reverse-coded item.
extraversion[, "E2"] = 7 - extraversion[, "E2"] # Reverse-coded item.
fit = conogive(extraversion)
}
Massage Cuts to the Desired Shape
Description
Massage Cuts to the Desired Shape
Usage
massage_cuts(cuts, k)
Arguments
cuts |
A matrix, list, or vector of cuts |
k |
Optional |
Transform y Into a Form Where Each Category is An Positive Integer
Description
Transform y Into a Form Where Each Category is An Positive Integer
Usage
ordered_y(y)
Arguments
y |
An array or data frame of observations. |
Value
A matrix.
Predict Method for Conogive Objects
Description
Predict the latent variable in a congeneric normal-ogive model using the formula of ((arxiv ref.))
Usage
## S3 method for class 'conogive'
predict(object, newdata, weights = c("optimal", "equal"), ...)
Arguments
object |
An object of class " |
newdata |
An optional data frame with variables to predict with. The fitted values are used if omitted. |
weights |
Weights to use; choose between optimal weights and equal weights. |
... |
Ignored. |
Examples
if(require("psychTools")) {
extraversion = psychTools::bfi[c("E1", "E2", "E3", "E4", "E5")]
extraversion[, "E1"] = 7 - extraversion[, "E1"] # Reverse-coded item.
extraversion[, "E2"] = 7 - extraversion[, "E2"] # Reverse-coded item.
object = conogive(extraversion)
hist(predict(object, extraversion)) # Plot distribution of predictions.
}
Calculate the Ordinal Reliabiltiy
Description
The function ordinal_r
calculates the concrete ordinal reliability.
The functions theoretical_ordinal_r
and theoretical_ordinal_alpha
calculates the theoretical ordinal reliability and alpha based on the
polychoric correlation matrix.
Usage
ordinal_r(
object,
xi = c("sample", "theoretical"),
weights = c("optimal", "equal")
)
theoretical_ordinal_r(object, weights = c("optimal", "equal", "sigma"))
theoretical_ordinal_alpha(object)
Arguments
object |
An object of class |
xi |
How to calculate the Xi matrix. Option |
weights |
The weights used to calculate the ordinal reliability.
Option |
Details
The population value of theoretical ordinal alpha equals the theoretical ordinal reliability when the underlying multivariate normal is parallel. The concrete ordinal reliability is the sqaured correlation between the true latent variable and the best linear predictor of the observed Likert-type data. See ((ref)) for definitions.
Value
The concrete ordinal reliability, theoretical ordinal reliability, or theoretical ordinal alpha.
Examples
if(require("psychTools")) {
agreeableness = psychTools::bfi[c("A1", "A2", "A3", "A4", "A5")]
agreeableness[, "A1"] = 7 - agreeableness[, "A1"] # Reverse-coded item.
object = conogive(agreeableness)
ordinal_r(object, weights = "equal") # 0.6394087
theoretical_ordinal_alpha(object) # 0.7589922
theoretical_ordinal_r(object, weights = "equal") # 0.7689878
ordinal_r(object, weights = "optimal") # 0.6763742
theoretical_ordinal_r(object) # 0.8101108
}
Standardize Parameter Vectors
Description
The function standardize_lambda
standardizes lambda
and
standardize_sigma
standardizes sigma
.
Usage
standardize_lambda(lambda, sigma)
standardize_sigma(lambda, sigma)
Arguments
lambda |
Vector of loadings. |
sigma |
Vector of standard deviations. |
Value
Standardized vector.
Thurstone weights
Description
Thurstone weights
Usage
thurstone(lambda, sigma)
Arguments
lambda |
Vector of loadings. |
sigma |
Vector of standard deviations. |
Value
The Thurstone weights.
Trace of matrix
Description
Trace of matrix
Usage
tr(A)
Arguments
A |
A square matrix. |
Value
Trace of the matrix.
Remove Infinities from Vector, Append and Prepend -Inf
and Inf
, and Sort
Description
Remove Infinities from Vector, Append and Prepend -Inf
and Inf
, and Sort
Usage
trim_vector(x)
Arguments
x |
Numeric vector with no |
Value
Vector with -Inf`` prepended and
Inf' appended
Transform Likert data to X_hats.
Description
Transform Likert data to X_hats.
Usage
x_hat(y, cuts)
Arguments
y |
Vector of observations. |
cuts |
Vector of cuts. |
Value
The X_hats associated with y
and cuts
.
Calculate Sample Xi
Description
Calculate Sample Xi
Usage
xi_sample(y, cuts, use = "complete.obs")
Arguments
y |
An array or data frame of observations. |
cuts |
A matrix, list, or vector of cuts. |
use |
Passed to |
Value
Sample xi matrix.
Calculate the Theoretical Xi
Description
Calculate the Theoretical Xi
Usage
xi_theoretical(cuts, rho)
Arguments
cuts |
A matrix, list, or vector of cuts. |
rho |
The polychoric correlation matrix; a numeric matrix with no missing entries. |
Value
Theoretical xi matrix.