# A small test data set with ten respondents
# and responses to three survey questions
# with response scales from 1 to 5.
testdata <- data.frame(
var_a = c(1,4,3,5,3,2,3,1,3,NA),
var_b = c(2,5,2,3,4,1,NA,2,NA,NA),
var_c = c(1,2,3,NA,3,4,4,5,NA,NA))
# Calculate response nondifferentiation indicators
resp_nondifferentiation(x = testdata) |>
round(2)
# Include respondents with NA values by decreasing the
# necessary number of valid responses per respondent.
resp_nondifferentiation(
x = testdata,
min_valid_responses = 0.2) |>
round(2)
resp_nondifferentiation(
x = testdata,
min_valid_responses = 0.2) |>
summary() # To obtain aggregate measures of response nondifferentiation
Run the code above in your browser using DataLab