Skip to main content
Topic: calculating p-values (Read 5857 times) previous topic - next topic

calculating p-values

Hello,

I am trying to go through the output in Excel and adjust for features in which one or more of the spectra had a zero for an ion count. After removing these points, I can recalculate the tstat using Welch's t-test but this should alter the p-value. Could somebody tell me how the p-values are computed from the tstat?

Thanks,
Andrew

Re: calculating p-values

Reply #1
In R or in Excel?

In R, the t.test function will return the p-value directly, see
Code: [Select]
?t.test

In XCMS t-statistics are calculated using the function mt.teststat (library multtest)
and p-values are calculated from that using the function pval, see
Code: [Select]
library(xcms)
?pval

Re: calculating p-values

Reply #2
Thanks,
I was trying to calculate the p-value of the Welch's t-test in Excel. I was confused by the degrees of freedom calculation but have figured it out. The result is a non-integer value for df. The Excel function t.dist.2t truncates the df to an integer. However, the p-value can be successfully calculated with the Excel t.test function by selecting the arrays of feature intensities which then calculates and uses the correct non-integer degrees of freedom.

By doing so, I could replace the existing pvalue column with the t.test function. Now feature with "0" intensity can be removed and left blank and the is p-value recalculated. I'm still working on learning the same manipulations in R. Thanks for the help.
Andrew