open-AIMS / bayesnec

Bayesian No-Effect-Concentration estimation in R

Home Page:https://open-AIMS.github.io/bayesnec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update check_data resp_check to use quantiles

beckyfisher opened this issue · comments

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.

resp_check <- mean(y[which(x < quantile(x, probs = 0.25))]) <
mean(y[which(x > quantile(x, probs = 0.75))])

Alternative is to use lm and check for negative slope