rm(list=ls())library(tidyverse)library(dexter)# load in the datasetresponses <-read_csv('data/maths/responses.csv')responses <- responses %>%filter(!is.na(gender))keys <-read_csv('data/maths/key.csv')# Create the rulesrules <-keys_to_rules(keys, include_NA_rule =TRUE)db <-start_new_project(rules, db_name =":memory:", person_properties=list(gender=""))# Add item propertiesproperties <-read_csv('data/maths/properties.csv')add_item_properties(db, item_properties = properties, default_values =NULL)add_booklet(db, responses, "maths-workshop") #| label: tbl-test#| tbl-cap: Test statistics# check the number of items, the persons and the max scoreget_booklets(db)knitr::kable(get_booklets(db), digits =2)# get the item scores for later use in other packagesitem_scores <-get_resp_matrix(db)item_scores <-as_tibble(item_scores)item_scores <- item_scores %>%select( Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15)
23.1 Summary item analysis
# produce the item tablestt =tia_tables(db)knitr::kable(tt$booklets, digits =2)## save the output so you can open it in Excelwrite_csv(tt$booklets, file='tables/booklets.csv')
Table 23.1: item summary
booklet_id
n_items
alpha
mean_pvalue
mean_rit
mean_rir
max_booklet_score
n_persons
maths-workshop
15
0.73
0.54
0.44
0.32
15
1665
23.2 Item descriptive stats
# get the item descriptive statsknitr::kable(tt$items, digits =2)## save the output so you can open it in Excelwrite_csv(tt$items, file='tables/items.csv')
Table 23.2: Item statistics
booklet_id
item_id
mean_score
sd_score
max_score
pvalue
rit
rir
n_persons
maths-workshop
Q1
0.86
0.35
1
0.86
0.44
0.34
1665
maths-workshop
Q10
0.03
0.16
1
0.03
-0.05
-0.10
1665
maths-workshop
Q11
0.48
0.50
1
0.48
0.63
0.51
1665
maths-workshop
Q12
0.57
0.50
1
0.57
0.52
0.39
1665
maths-workshop
Q13
0.50
0.50
1
0.50
0.53
0.40
1665
maths-workshop
Q14
0.22
0.41
1
0.22
0.31
0.18
1665
maths-workshop
Q15
0.54
0.50
1
0.54
0.59
0.47
1665
maths-workshop
Q2
0.90
0.30
1
0.90
0.41
0.32
1665
maths-workshop
Q3
0.84
0.37
1
0.84
0.48
0.37
1665
maths-workshop
Q4
0.30
0.46
1
0.30
0.37
0.23
1665
maths-workshop
Q5
0.64
0.48
1
0.64
0.51
0.37
1665
maths-workshop
Q6
0.50
0.50
1
0.50
0.40
0.24
1665
maths-workshop
Q7
0.64
0.48
1
0.64
0.51
0.38
1665
maths-workshop
Q8
0.55
0.50
1
0.55
0.49
0.35
1665
maths-workshop
Q9
0.57
0.50
1
0.57
0.47
0.33
1665
23.3 Distractor analysis
# Look at all the distractor plotsn_items <-nrow(keys)for(i in1:n_items){distractor_plot(db, keys$item_id[i])}
The item test correlations in Table 23.2 suggest an issue with item 10. Let’s look at the distractor plot for that item Figure 23.1.
# produce the distractor plots# Look at distractor plots for all items# Something is odd about Q10, so let's look at the distractor plot for that itemdistractor_plot(db, 'Q10')
Warning: In density.default(bkl_scores$booklet_score, n = 512, weights = bkl_scores$n/N,
adjust = adjust, from = 0, to = max(bkl_scores$booklet_score),
warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
Warning: In density.default(.$booklet_score, weights = .$n/sum(.$n), n = 512,
bw = dAll$bw, from = min(dAll$x), to = max(dAll$x), warnWbw = FALSE) :
extra argument 'warnWbw' will be disregarded
23.4 Rasch analysis
# run a traditional Rasch analysis using the item scores produced abovelibrary(TAM)# All the results of the Rasch analysis are stored in the object called "mod1"mod1 <- TAM::tam.jml(item_scores)summary(mod1)
# plot the item infit against the item difficultyp <-ggplot(item_fit, aes(x=infitItem, y=xsi, size=se.xsi,label=item))p <- p +geom_point()p <- p +geom_text(data=item_fit %>%filter(infitItem>1.1),aes(x=infitItem, y=xsi,label=item,size=4),nudge_y=0.15, nudge_x =-0.005)print(p)
# plot the item outfit against the item difficultyp <-ggplot(item_fit, aes(x=outfitItem, y=xsi, size=se.xsi,label=item))p <- p +geom_point()p <- p +geom_text(data=item_fit %>%filter(outfitItem>1.1),aes(x=outfitItem, y=xsi,label=item,size=4),nudge_y=0.15, nudge_x =-0.005)print(p)
`summarise()` has grouped output by 'gender'. You can override using the
`.groups` argument.
question_difficulty <- response_summary %>%filter(gender=='F') %>%arrange(mean_score) %>%pull(question)ordered_responses <- response_summary %>%mutate(item =factor(question, levels=question_difficulty, ordered=TRUE))ordered_responses <- ordered_responses %>%mutate(gender =factor(gender))p <-ggplot(ordered_responses, aes(x=item, y=mean_score, group=gender, colour=gender, line_style=gender))p <- p +geom_line() # rotate the x-axis labelsp <- p +theme_light()p <- p +theme(axis.text.x =element_text(angle =90, hjust =1))p
Andrich, David, and Ida Marais. 2019. “The Idea of Measurement.” In A Course in Rasch Measurement Theory, 3–11. Springer Nature Singapore. https://doi.org/10.1007/978-981-13-7496-8_1.
Bond, Trevor G., Zi Yan, and Moritz Heene. 2020. Applying the Rasch Model: Fundamental Measurement in the Human Sciences. Routledge. https://doi.org/10.4324/9780429030499.
Cappelleri, Jason Lundy, J. C. 2014. “Overview of Classical Test Theory and Item Response Theory for the Quantitative Assessment of Items in Developing Patient-Reported Outcomes Measures.”Clinical Therapeutics 36 (5): 648–62. https://doi.org/https://doi.org/10.1016/j.clinthera.2014.04.006.
Cronbach, Lee J. 1951. “Coefficient Alpha and the Internal Structure of Tests.”Psychometrika 16 (3): 297–334. https://doi.org/10.1007/bf02310555.
Goldstein, H., and Steve Blinkhorn. 1982. “The Rasch Model Still Does Not Fit.”British Educational Research Journal 8 (2): 167–70. https://doi.org/10.1080/0141192820080207.
Lord, Frederic M, and Melvin R Novick. 2008. Statistical Theories of Mental Test Scores. IAP.
McNeish, Daniel. 2018. “Thanks Coefficient Alpha, We’ll Take It from Here.”Psychological Methods 23 (3): 412–33. https://doi.org/10.1037/met0000144.
Panayides, Panayiotis, Colin Robinson, and Peter Tymms. 2010. “The Assessment Revolution That Has Passed England by: Rasch Measurement.”British Educational Research Journal 36 (4): 611–26. https://doi.org/10.1080/01411920903018182.
Sijtsma, Klaas. 2008. “On the Use, the Misuse, and the Very Limited Usefulness of Cronbach’s Alpha.”Psychometrika 74 (1): 107–20. https://doi.org/10.1007/s11336-008-9101-0.
Wright, Benjamin D, and Magdalena Mok. 2000. “Rasch Models Overview.”Journal of Applied Measurement 1 (1): 83–106.