trinker/wakefield

Retain the likert scale when using r_series

Opened this issue · 1 comments

When performing r_series(likert, 5, 100, name ="Item", relate = "-.5_.1") (as in the readme file), it does not retain the original likert range. For example, running the code above results in the following ranges for the five items:

  1. Item_1: 1-5
  2. Item_2: 0-5
  3. Item_3: -1-5
  4. Item_4: -2-5
  5. Item_5: -3-4

I would like to be able to create likert scales with the same response scales (e.g., 1 through 5) that are related to one another (e.g., alpha = .80). The current code creates scales that are related but no longer on the same response scale.

As a follow-up, I figured out a solution in the meantime using rescale in the scales package:

r_data_frame(
  n = 300,
  id,
  race, 
  education,
  level,
  `age` = rpois(lambda = 3), #Need to add 17 to this value
  r_series(likert, 5, name = "SWLS", relate = "-.5_.1")
) %>%
  mutate_at(vars(starts_with("SWLS")), rescale, to = c(1, 5))

This rescales the variables back to the original response scales but preserving the relationship between the items (e.g., alpha = .97).