Skip to content

Instantly share code, notes, and snippets.

@tbates
Last active December 27, 2015 11:09
Show Gist options
  • Save tbates/7316384 to your computer and use it in GitHub Desktop.
Save tbates/7316384 to your computer and use it in GitHub Desktop.
Effect of guessing on reading
# Generate a 25-item test
nItems = 25
nOptions = 4
passCriterion = 3 # or better
correct_answers = sample(c(1:nOptions), nItems, replace = TRUE)
# ===================================
# = Generate 10000 random responses =
# ===================================
n = 10000; scores = rep(NA, n)
for (i in 1:n) {
# attempt test
responses = sample(c(1:nOptions), nItems, replace = TRUE)
# get score
scores[i] = sum(responses == correct_answers)
}
# Proportion of passing scores
fail = sum(scores < passCriterion)/n
paste0("The proportion of students with zero knowledge who pass on the first attempt is ", 100 * round(1 - fail, 3), "%") # 96.9 %
resit = 1 - (fail - (fail * (1-fail)))
paste0("If allowed a re-sit, this increases to ", 100 * round(resit, 3), "%") # 99.9%
@tbates
Copy link
Author

tbates commented Nov 5, 2013

This is prompted by NAPLAN tests like this

And by a belief that literacy has large enduring positive effects on status.

Ritchie, S. J., & Bates, T. C. (2013). Enduring links from childhood mathematics and reading achievement to adult socioeconomic status. Psychological Science, 24(7), 1301-1308. doi: 10.1177/0956797612466268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment