Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: P value and 95% CI doesn't match #558

Open
Yvonnehuang1316 opened this issue Sep 4, 2024 · 0 comments
Open

[BUG]: P value and 95% CI doesn't match #558

Yvonnehuang1316 opened this issue Sep 4, 2024 · 0 comments
Labels

Comments

@Yvonnehuang1316
Copy link

Dear developer,

Recently I ran 'TwosamleMR' and noticed that the mode-based method may have some bugs in reporting P values when the number of IV is small.

For example, I ran an MR with 3 SNPs as IV, here are my results.
id.exposure id.outcome method nsnp b se ci_low ci_upp pval
1 6azTYV iUTOLO Simple mode 3 -5.834308 2.627214 -10.983553 -0.685062833 0.1565154
2 6azTYV iUTOLO Weighted mode 3 -4.327279 2.509336 -9.245486 0.590928338 0.2267644
3 6azTYV iUTOLO Penalised mode 3 -4.327279 2.526705 -9.279529 0.624971024 0.2289150
4 6azTYV iUTOLO Simple mode (NOME) 3 -5.834308 2.278630 -10.300342 -1.368274369 0.1246472
5 6azTYV iUTOLO Weighted mode (NOME) 3 -4.464282 2.275595 -8.924365 -0.004197941 0.1888013

The ci_low and ci_up are all both less than 0, while the pval is not significant.

I went back to the original code, I noticed that the 95% CI is derived from 1000 bootstrap. However, the P value is derived from t-statistics:

"P_Mode <- pt(abs(beta_Mode/se_Mode), df = length(b_exp) - 1, lower.tail = F) * 2"

I guess the problem was the set-up of 'df = length(b_exp) - 1'. If we are estimating p value from bootstrap, should the dr = number of bootstrap -1 ? In my case, I only used 3 SNPs, if df = length(b_exp) - 1, then here the df is 2, which makes the p value really big ...which is inconsistent with 95% CI...

Thank you very much,
Yvonne & Huan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant