Item Analysis of a Scale or an Index"

knitr::opts_chunk$set(collapse = TRUE, comment = "#>")

if (!requireNamespace("dplyr", quietly = TRUE) ||
    !requireNamespace("sjmisc", quietly = TRUE) ||
    !requireNamespace("parameters", quietly = TRUE) ||
    !requireNamespace("psych", quietly = TRUE)) {
  knitr::opts_chunk$set(eval = FALSE)
} else {
  knitr::opts_chunk$set(eval = TRUE)
}

This document shows examples for using the tab_itemscale() function of the sjPlot package.

Performing an item analysis of a scale or index

This function performs an item analysis with certain statistics that are useful for scale or index development. Following statistics are computed for each variable (column) of a data frame:

Optional, following statistics can be computed as well:

If the argument factor.groups is not NULL, the data frame df will be splitted into groups, assuming that factor.groups indicate those columns (variables) of the data frame that belong to a certain factor (see, for instance, return value of function tab_pca() or parameters::principal_components() as example for retrieving factor groups for a scale). This is useful when you have perfomed a principal component analysis or factor analysis as first step, and now want to see whether the found factors / components represent a scale or index score.

To demonstrate this function, we first need some data:

library(sjPlot)
library(sjmisc)
library(dplyr)
data(efc)
# create data frame with COPE-index scale
mydf <- dplyr::select(efc, contains("cop"))

Index score with one component

The simplest function call is just passing the data frame as argument. In this case, the function assumes that all variables of the data frame belong to one factor only.

tab_itemscale(mydf)

To interprete the output, we may consider following values as rule-of-thumbs for indicating a reliable scale:

Index score with more than one component

The items of the COPE index used for our example do not represent a single factor. We can check this, for instance, with a principle component analysis. If you know, which variable belongs to which factor (i.e. which variable is part of which component), you can pass a numeric vector with these group indices to the argument factor.groups. In this case, the data frame is divided into the components specified by factor.groups, and each component (or factor) is analysed.

library(parameters)
# Compute PCA on Cope-Index, and retrieve 
# factor indices for each COPE index variable
pca <- parameters::principal_components(mydf)
factor.groups <- parameters::closest_component(pca)

The PCA extracted two components. Now tab_itemscale() ...

  1. performs an item analysis on both components, showing whether each of them is a reliable and useful scale or index score
  2. builds an index of each component, by standardizing each scale
  3. and adds a component-correlation-matrix, to see whether the index scores (which are based on the components) are highly correlated or not.
tab_itemscale(mydf, factor.groups)

Adding further statistics

tab_itemscale(mydf, factor.groups, show.shapiro = TRUE, show.kurtosis = TRUE)


Try the sjPlot package in your browser

Any scripts or data that you put into this service are public.

sjPlot documentation built on Aug. 17, 2023, 5:11 p.m.