# Test for SPMI using the second-order Rao-Scott adjustment
test.stat.rs2 <- SPMI.test(data = farmer2, I = 3, J = 4, type = "rs2")
test.stat.rs2
# Test for SPMI using all three approaches
# A small B is used for demonstration purposes; normally, a larger B should be used
test.stat.all <- SPMI.test(data = farmer2, I = 3, J = 4, type = "all", B = 99,
plot.hist = TRUE)
test.stat.all
# Use SPMI.test() with summary data
# Convert raw data file to summary file for this example
farmer.irdframe <- item.response.table(data = farmer2, I = 3, J = 4, create.dataframe =
TRUE)
# Test for SPMI using the Bonferroni adjustment
test.stat.bon <- SPMI.test(data = farmer.irdframe, I = 3, J = 4, type = "bon",
summary.data = TRUE)
test.stat.bonRun the code above in your browser using DataLab