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

Is it valid to test whether two posterior means are different with t-test? #131

Open
MaximalLife opened this issue Oct 8, 2024 · 3 comments

Comments

@MaximalLife
Copy link

Hello, I'm using mashr for my research, and I'm trying to discriminate eQTLs which are same or different among conditions.
I've seen a tutorial from vignette, which uses get_pairwise_sharing_from_samples with an arbitrary cutoff (factor=0.5).

But I'm now trying t-test using posterior mean and standard deviation (sd) values.
I'm doing this with following R codes (for example).

When sample size / posterior mean / posterior sd of an eQTL from condition A are 101 / 0.5 / 0.07,
and those from condition B are 121 / 0.3 / 0.06,

df <- 100+120
sp <- (100*0.07^2+120*0.06^2)/df
se <- sqrt(sp*(1/101+1/121))
tstat <- (0.5-(0.3))/se
pvalue <- pt(q=tstat, df=df, lower.tail=F)*2

(I'll also do Bonferroni correction)
--->> As a result, eQTLs with adjusted p-values below cutoff will be considered A- or B-dominant eQTLs.

So, my question is,
Is my idea theoretically valid?
Especially I'm a bit confused whether posterior estimates are suitable to become inputs for general t-test.

Could you give me some advice?

@pcarbo
Copy link
Member

pcarbo commented Oct 9, 2024

Hi @MaximalLife to help us understand, can you tell us which mashr vignette you were following?

@MaximalLife
Copy link
Author

MaximalLife commented Oct 9, 2024

@pcarbo Thank you for a rapid response!

At first, I followed this: https://stephenslab.github.io/mashr/articles/mash_sampling.html
In "Pairwise sharing" chapter, it contains how to compare effects from two conditions, and I understood that mashr uses an arbitrary cutoff for difference of two posterior means to decide condition-specificity of an eQTL.

Instead of the arbitrary cutoff, I'm trying to use t-test to decide whether two posterior means are same or different.
I think this way may solve ambiguity during pairwise comparison of eQTLs.
But I'm not familiar with statistics, so I'm not sure if my idea is valid.

@pcarbo
Copy link
Member

pcarbo commented Oct 10, 2024

@MaximalLife The statistic you want to compute will depend on what question you are answering. It might help to look at Fig. 5 and the section "Sharing of effects among tissues" in our paper, where we consider two different ways of quantifying sharing of effects across tissues/conditions.

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

No branches or pull requests

2 participants