I have a 3D array of data defined by [i,j,k]
and want to perform a single sample t-test on the 3rd dimension, [k]
, testing for difference from 0. Ideally, the results would be returned as a matrix of t values of size [i,j]
. Unfortunately, I do not know the size of the 3D array beforehand.
set.seed(1999)
i <- 4; j <- 2; k <- 6
df <- runif((i*j*k))
ar <- array(df, c(i, j, k))
If I understand it correctly, try the following.