Estimate of learning adjusted with standard correction for guessing. Correction is based on number of options per question.
The function takes separate pre-test and post-test dataframes. Why do we need dataframes? To accomodate multiple items.
The items can carry NA (missing). Items must be in the same order in each dataframe. Assumes that respondents are posed same questions twice.
The function also takes a lucky
vector --- the chance of getting a correct answer if guessing randomly. Each entry is 1/(number of options).
The function also optionally takes a vector carrying names of the items. By default, the vector carrying adjusted learning estimates takes same
item names as the pre_test items. However you can assign a vector of names separately via item_names
.
stnd_cor(pre_test = NULL, pst_test = NULL, lucky = NULL, item_names = NULL)
pre_test | Required. data.frame carrying responses to pre-test questions. |
---|---|
pst_test | Required. data.frame carrying responses to post-test questions. |
lucky | Required. A vector. Each entry is 1/(number of options) |
item_names | Optional. A vector carrying item names. |
a list of three vectors, carrying pre-treatment corrected scores, post-treatment scores, and adjusted estimates of learning
# Without DK pre_test <- data.frame(item1 = c(1,0,0,1,0), item2 = c(1,NA,0,1,0)) pst_test <- pre_test + cbind(c(0,1,1,0,0), c(0,1,0,0,1)) lucky <- rep(.25, 2); stnd_cor(pre_test, pst_test, lucky)#> $pre #> item1 item2 #> 0.2000000 0.2666667 #> #> $pst #> item1 item2 #> 0.7333333 0.5333333 #> #> $learn #> item1 item2 #> 0.5333333 0.2666667 #># With DK pre_test <- data.frame(item1 = c(1,0,0,1,0,'d',0), item2 = c(1,NA,0,1,0,'d','d')) pst_test <- data.frame(item1 = c(1,0,0,1,0,'d',1), item2 = c(1,NA,0,1,0,1,'d')) lucky <- rep(.25, 2); stnd_cor(pre_test, pst_test, lucky)#> $pre #> item1 item2 #> 0.0952381 0.1904762 #> #> $pst #> item1 item2 #> 0.2857143 0.3333333 #> #> $learn #> item1 item2 #> 0.1904762 0.1428571 #>