angeella / pari Goto Github PK
View Code? Open in Web Editor NEWpARI: permutation-based All-Resolutions Inference
pARI: permutation-based All-Resolutions Inference
Hi Angela,
There seems to be an important bug in your calculation of two-sample Welch statistics: the test statistics you report are inconsistent (and much larger) than the ones obtained by t.test
. See the example below with m=2 tests using n=100 observations, with no signal.
> n <- 100
> m <- 2
> groups <- rep(c(0, 1), each = n/2)
>
> mat <- matrix(rnorm(m*n), m, n)
> t.test(mat[1, ]~groups)
Welch Two Sample t-test
data: mat[1, ] by groups
t = 1.4507, df = 92.122, p-value = 0.1503
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.1055058 0.6772781
sample estimates:
mean in group 0 mean in group 1
0.1640547 -0.1218315
> out <- pARI::permTest(X = mat, label = groups, B = 10, rand = FALSE)
> out$pv
[1] 1.239105e-10 3.401634e-01
> out$Test
[1] 7.2533998 0.9592307
In order to spot this type of errors, I highly recommend testing your code, see https://r-pkgs.org/tests.html.
In this case a minimal test is to ensure that your function reproduces the results of stats::t.test. This is what we do in the sansSouci package, see e.g. https://github.com/pneuvial/sanssouci/blob/develop/tests/testthat/test_rowWelchTests.R
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.