Closed AndrewLawrence closed 1 year ago
Hi there, thanks for the excellent package!
I was pooling some data and noticed some (highly significant) p-values were coming out as 0 which then messes with multiple comparisons correction.
I dug in the code and spotted the following line in summary.mipo:
https://github.com/amices/mice/blob/1c1ac6fd542ae11b1ab0225699a7b1e1ea09989f/R/mipo.R#L71
I think that the 1 - pt(...) introduces numerical problems and it's more precise to use pt(..., lower.tail = FALSE) to get the complement.
1 - pt(...)
pt(..., lower.tail = FALSE)
For example:
2 * (1 - pt(abs(-11.5), df = 104)) # [1] 0 2 * (pt(abs(-11.5), df = 104, lower.tail = FALSE)) # [1] 3.059153e-20
Looks like a simple fix, I will knock up a quick PR with the code and link this issue.
Hi there, thanks for the excellent package!
I was pooling some data and noticed some (highly significant) p-values were coming out as 0 which then messes with multiple comparisons correction.
I dug in the code and spotted the following line in summary.mipo:
https://github.com/amices/mice/blob/1c1ac6fd542ae11b1ab0225699a7b1e1ea09989f/R/mipo.R#L71
I think that the
1 - pt(...)
introduces numerical problems and it's more precise to usept(..., lower.tail = FALSE)
to get the complement.For example:
Looks like a simple fix, I will knock up a quick PR with the code and link this issue.