I would like to perform a t-test for every row in my matrix. The matrix looks like that:
data <-
structure(c(NA, NA, 216750, 440450, NA, NA, 597510, 1839055,
851820, 1210200, NA, NA, NA, NA, 486720, 602970, 333150, 346532,
NA, NA, 421290, 425660, NA, 375440), .Dim = c(6L, 4L), .Dimnames = list(
c("Gregg", "Mark", "Donnie",
"Fred", "Tim", "Gracie"
), c("AUC_Rep1", "AUC_Rep2", "AUC_Rep3", "AUC_Rep4")))
As you can see there are two problems with the data. First one is that it contains NAs
and second one is that in some rows there is not enough data - just one value in whole row.
Do you know any way to avoid that problem ? I would like to create a function which first of all ignores NAs
and if there is only 1 value in the row it should give NA
as an output of t-test.
I usually use function from pi0
package - matrix.t.test