Get the p-value from a u-test and calculate the median foldchange
get.utest.p.and.medianfoldchange.RdTests the median difference of two samples and returns the p-value from a u-test with useful default parameters and calculates the median foldchange. Returns NA if the u-test is uncalculable (i.e. does try() handling).
Usage
get.utest.p.and.medianfoldchange(x, group1, group2, paired = 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 u-test
- group2
Vector of TRUE/FALSE indicating which are the y samples for the u-test
- paired
Do a paired u-test?
- alternative
What's the null-hypothesis?
- logged
Indicate whether data is log-transformed or not
Details
Calculates fold-changes as median(group2)/median(group1) in normal-space and median(group2) - median(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.