| item.stats | R Documentation |
This function conducts item analysis for dichotomous, polytomous, and continuous items by computing corrected item-total correlations with confidence intervals and coefficient alphas if the item is deleted. The default setting for computing the item-total correlations is depending on the type of the data, i.e., point-biserial correlation for dichotomous data, polyserial correlation for polytomous data, and product-moment correlation for continuous data.
item.stats(data, ..., exclude = NULL, correct = TRUE,
method = c("pearson", "pbiser", "biser", "polyser"),
adjust = c("none", "joint", "approx"),
missing = c("listwise", "pairwise", "fiml"),
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, na.omit = FALSE, digits = 2, r.digits = 3,
as.na = NULL, write = NULL, append = TRUE,
check = TRUE, output = TRUE)
data |
a data frame. Note that dichotomous items must be coded
with |
... |
an expression indicating the variable names in |
exclude |
a character vector indicating items to be excluded from the analysis. |
correct |
logical: if |
method |
a character string indicating which correlation coefficient
is used for the item-total correlation, i.e., |
adjust |
a character string specifying the non-normality adjustment
method (see 'Details' in the |
missing |
a character string indicating how to deal with missing data
when computing coefficient alphas if the item is deleted,
i.e., |
alternative |
a character string specifying the alternative hypothesis
for the confidence intervals for the item-total correlation,
i.e., |
conf.level |
a numeric value between 0 and 1 indicating the confidence level of the interval for the item-total correlation. |
na.omit |
logical: if |
digits |
an integer value indicating the number of decimal places to be used to display display item difficulty, mean, median, and standard deviation. |
r.digits |
an integer value indicating the number of decimal places to be used to display item-total correlation, and coefficient alpha if the item is deleted. |
as.na |
a numeric vector indicating user-defined missing values,
i.e. these values are converted to |
write |
a character string naming a file for writing the output into
either a text file with file extension |
append |
logical: if |
check |
logical: if |
output |
logical: if |
The confidence
interval for the point-biserial correlation is based on Bonett (2020), while
the confidence interval for the biserial and polyserial correlation is based
on the maximum likelihood standard error provided by the function polyserial
from the polycor package (Fox, 2025). The confidence interval for the
Pearson product-moment correlation uses the ci.cor function from the
misty package that computes a confidence interval with non-normality
adjustment via approximate distribution by skewness and kurtosis by default.
Returns an object of class misty.object, which is a list with following
entries:
call |
function call |
type |
type of analysis |
data |
data frame including all variables used in the analysis |
dtype |
type of the data, i.e., |
args |
specification of function arguments |
result |
result table |
This function uses a modified copy of the polyserial() function in the
polycor package by John Fox (2025) when requesting item-total biserial
correlation.
Takuya Yanagida
Bonett D. G. (2020). Point-biserial correlation: Interval estimation, hypothesis testing, meta-analysis, and sample size determination. The British Journal of Mathematical and Statistical Psychology, 73 Suppl 1, 113–144. https://doi.org/10.1111/bmsp.12189
Fox, J. (2025). polycor: Polychoric and polyserial correlations. R package version 0.8-2. https://doi.org/10.32614/CRAN.package.polycor
item.distract, item.alpha, item.omega,
item.cfa, item.reverse, item.scores
## Not run:
#————————————————————————————————————————————————————————————————————————————
# Dichotomous Data
# Example 1a: Corrected item-total point-biserial correlation
item.stats(data.items, +ditem)
# Example 1b: Corrected item-total biserial correlation
item.stats(data.items, +ditem, method = "biser")
# Example 1c: Uncorrected item-total point-biserial correlation
item.stats(data.items, +ditem, correct = FALSE)
# Example 1d: Display item-total correlation and coefficient alpha with 2 digits
item.stats(data.items, +ditem, r.digits = 2)
#————————————————————————————————————————————————————————————————————————————
# Polytomous Data
# Reverse code inverted item
data.items <- item.reverse(data.items, pitem2, pitem3, min = 0, max = 3)
# Example 2a: Corrected item-total polyserial correlation
item.stats(data.items, pitem1, pitem2.r, pitem3.r, pitem4::pitem6, method = "polyser")
# Example 2b: One-sided confidence intervals
item.stats(data.items, +pitem, method = "polyser", alternative = "greater")
#————————————————————————————————————————————————————————————————————————————
# Continuous Data
# Load data set "HolzingerSwineford1939" in the lavaan package
data("HolzingerSwineford1939", package = "lavaan")
# Example 3a: Corrected item-total product-moment correlation
item.stats(HolzingerSwineford1939, x1::x9)
# Example 3a: Exclude items 'x2' and 'x7'
item.stats(HolzingerSwineford1939, x1::x9, exclude = c("x2", "x7"))
#————————————————————————————————————————————————————————————————————————————
# Write Results
# Example 4a: Write Results into a text file
item.stats(data.items, +ditem, write = "Item-Stats.txt", output = FALSE)
# Example 4b: Write Results into an Excel file
item.stats(data.items, +ditem, write = "Item-Stats.xlsx", output = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.