Get the p-value from a t-test and calculate the foldchange
get.ttest.p.and.foldchange.RdReturns the p-value from a t-test with useful default parameters and calculates the foldchange. Returns NA if the t-test is uncalculable (i.e. does try() handling).
Usage
get.ttest.p.and.foldchange(x, group1, group2, paired = FALSE, var.equal = FALSE,
    alternative = 'two.sided', logged = TRUE);Arguments
- x
 Vector of numbers to analyze
- group1
 Vector of TRUE/FALSE indicating which are the x samples for the t-test
- group2
 Vector of TRUE/FALSE indicating which are the y samples for the t-test
- paired
 Do a paired t-test?
- var.equal
 Assume Welch's correction?
- alternative
 What's the null-hypothesis?
- logged
 Indicate whether data is log-transformed or not
Details
Calculates fold-changes as mean(group2)/mean(group1) in normal-space and mean(group2) - mean(group1) in log-space, with appropriate NA-handling.
Value
Returns a two-element vector containing the p-value and fold-change, or NAs if an error occurs.