CR Mode consistency

Packages: dplyr, skimr

There is still research ongoing on how to detect and to handle careless responses in the context of ESM studies. In addition, the threshold values that we use to detect careless responding are examples and don’t follow any recommendations. We strongly advice you to figure out which careless responding score(s) and threshold values are the most relevant for your study.

IN DEVELOPMENT

Mode of the 10 answers => Percentage of the items that have this mode value, for sliders use bins. More for consistency**

range_test = function(x, range){
    test_ = x > range[1] & x < range[2]
    sum(test_, na.rm=TRUE) / length(x) # compute percentage
}  
dt_ = data %>% dplyr::select(PA1:NA3)
mean_ = apply(dt_, 1, mean, na.rm=TRUE)
bin = 5 # TO define
dt_range = cbind(mean_ - bin, mean_ + bin)
dt_ = split(dt_, seq(nrow(dt_)))
dt_range = split(dt_range, seq(nrow(dt_range)))
data[,"perc_consist"] = mapply(range_test, dt_, dt_range)
data %>%
    ggplot(aes(x=perc_consist)) +
        geom_histogram()

data %>%
    ggplot(aes(x=perc_consist)) +
        geom_histogram() +
        facet_wrap(.~id)