I have two different model families $A_i$ and $B_i$ each of which predicts a continuous value for an item $i$ at various points in time throughout a given day. For a given day, and item $i$, I can measure the correlation of $A_i$'s $\hat{y}$ and $y$ as well as $B_i$'s. Given a dataset with daily such correlations for both $A$ and $B$ over multiple days for multiple items $i$ I want to test for how many of the $i$ items (if any) are "better predicted" by $B$ given some confidence threshold (say $0.01$).
As this involves running multiple tests, I am adjusting p-values at the end but often finding that with my approach I am hardly every seeing any differences. Am I being overly conservative in the adjustments or am I approaching this incorrectly?
Here is an example that illustrates my point
library(weights)
library(data.table)
set.seed(42)
items <- 1000
dates <- seq(as.Date("2022/01/01"), as.Date("2022/06/01"), by = "day")
x <- data.table(item = rep(1:items, each = length(dates)), date = dates)
## wgt is a weight for a specific date and item
## (e.g. number of measurements observed on that date for that item)
x[, wgt := round(rnorm(.N, 1000, 100))]
## on all but the last 5 items both models A and B perform the same..
x[item <= (items - 5), `:=`(mod.a = rnorm(.N, 0.2, 0.05),
mod.b = rnorm(.N, 0.2, 0.05))]
## but B is better on 5 of the items
x[item > (items - 5), `:=`(mod.a = rnorm(.N, 0.19, 0.05),
mod.b = rnorm(.N, 0.21, 0.05))]
## we dont know that and we want to test for the effect
## so we reach for weights::wtd.t.test
y <- x[, {
wtt <- wtd.t.test(mod.a, mod.b, weight = wgt, samedata = TRUE, alternative = "two.tailed")
c(as.list(wtt$coefficients), as.list(wtt$additional))
}, by = item]
## we did multiple tests so adjust p-values
y[, p.value.adj := p.adjust(p.value, method = 'bonferroni')]
## with unadjusted p.values we get a lot of false positives
y[p.value < 0.01, .(num.diff = .N, which.diff = paste(item, collapse = ','))]
## num.diff which.diff
## 1: 16 9,405,411,597,665,666,691,747,882,901,937,996,997,998,999,1000
## but with adjusted p-values we only detect one of them
y[p.value.adj < 0.01, .(num.diff = .N, which.diff = paste(item, collapse = ','))]
## num.diff which.diff
## 1: 1 1000
mod.a
andmod.b
columns inx
represent? Your question says correlations, then you sample the values in those two columns from a normal distribution. $\endgroup$