Adjusts observed 1s based on propensity to guess (based on observed 0s) and an item-level guessing probability. You can also put in your best estimate of hidden knowledge behind don't know responses.

group_adj(
  pre_test = NULL,
  post_test = NULL,
  guessing_probability = NULL,
  knowledge_given_dont_know = 0.03,
  na_as = c("dk", "missing"),
  missing_action = c("omit", "error")
)

Arguments

pre_test

Pre-test data frame. Required. Each vector within the data frame should only take values 0, 1, and 'd'.

post_test

Post-test data frame. Required. Each vector within the data frame should only take values 0, 1, and 'd'.

guessing_probability

Probability of getting the right answer without knowledge.

knowledge_given_dont_know

Numeric probability of hidden knowledge conditional on an observed don't-know response. Must be between 0 and 1. Defaults to 0.03.

na_as

Classification of NA responses: `"dk"` (the default) treats them as observed don't know responses; `"missing"` treats them as structural missingness.

missing_action

How to handle structural missingness: `"omit"` excludes it and `"error"` rejects it.

Value

A list with `adjusted_responses`, containing `pre_test` and `post_test` data frames, and `mean_learning`, the item-level mean adjusted change.

Examples

pre_test_var <- data.frame(item = c(1, 0, 0, 1, "d", "d", 0, 1, NA))
post_test_var <- data.frame(item = c(1, NA, 1, "d", 1, 0, 1, 1, "d"))
guessing_probability <- c(.25)
group_adj(pre_test_var, post_test_var, guessing_probability)
#> $adjusted_responses
#> $adjusted_responses$pre_test
#>        item
#> 1 0.6666667
#> 2 0.0000000
#> 3 0.0000000
#> 4 0.6666667
#> 5 0.0300000
#> 6 0.0300000
#> 7 0.0000000
#> 8 0.6666667
#> 9 0.0300000
#> 
#> $adjusted_responses$post_test
#>        item
#> 1 0.9333333
#> 2 0.0300000
#> 3 0.9333333
#> 4 0.0300000
#> 5 0.9333333
#> 6 0.0000000
#> 7 0.9333333
#> 8 0.9333333
#> 9 0.0300000
#> 
#> 
#> $mean_learning
#>      item 
#> 0.2962963 
#>