Update check_data resp_check to use quantiles
beckyfisher opened this issue · comments
Rebecca Fisher commented
The current algorithm uses:
resp_check <- mean(y[which(x < mean(x))]) <
mean(y[which(x > mean(x))])
This can cause problems as all treatments are equally weighted so if there are few observations for higher treatments this can trigger an error even when there is visually a decline.
Rebecca Fisher commented
resp_check <- mean(y[which(x < quantile(x, probs = 0.25))]) <
mean(y[which(x > quantile(x, probs = 0.75))])
Rebecca Fisher commented
Alternative is to use lm and check for negative slope