Computes the two-sample t-test with the Welch modification to the degrees of freedom for each feature.
See the Details section below for further information.
Usage
rowUnequalVarT(
x,
g,
null = 0,
alternative = c("two.sided", "greater", "less"),
conf.level = 0.95
)
Arguments
- x
matrix
ordata.frame
.- g
a vector or factor object giving the group for the corresponding elements of
x
.- null
numerical value or numeric vector of length
nrow(x)
. The true values of the difference in means between the two groups of observations for each row.- alternative
character string or vector of length
nrow(x)
. The alternative hypothesis for each row ofx
. Values must be one of"two.sided"
(default),"greater"
or"less"
.- conf.level
numerical value or numeric vector of length
nrow(x)
. The confidence levels of the intervals. All values must be in the range of \([0:1]\) orNA
.
Value
A list containing two elements:
- statistic
A numeric vector, the values of the test statistic
- significance
A numeric vector, the p-values of the selected test
Details
It is a wrapper to row_t_welch
function.
Examples
#Seed
set.seed(1010)
#Data
x = cbind(
matrix(rnorm(n = 100 * 10, sd = 1), 100, 10),
matrix(rnorm(n = 100 * 10, sd = 3), 100, 10)
)
g = c(rep(0,10),rep(1,10))
#Compute
rowUnequalVarT(x = x, g = g)
#> $statistic
#> [1] 0.263134312 -1.029449955 1.717740109 -1.862075722 2.849451734
#> [6] 0.628629218 0.597328905 -0.054193533 -0.616273862 0.614270332
#> [11] -1.368940322 -2.210195308 -0.158041807 -1.696998287 -0.010137004
#> [16] 0.050601372 0.983341212 -1.736195219 0.244681344 -0.117342530
#> [21] -0.593409736 2.281435226 -1.427332801 -0.950940298 0.253940526
#> [26] 0.010141804 0.590563566 -0.351254872 -0.663692759 -1.759794171
#> [31] -0.593709318 4.258853681 1.364591879 -0.631974008 -0.560214986
#> [36] 0.478834843 0.079707865 -0.874809831 -0.601365331 -1.225177131
#> [41] -0.117455064 -0.187031640 -0.683049945 1.193490038 1.675735416
#> [46] 0.046976791 -0.373650544 0.706826697 0.618147746 3.660957302
#> [51] 2.186639761 1.909278173 -1.089339272 0.845612052 1.666406561
#> [56] -2.628458933 -0.064015792 -0.065905936 2.009695903 -1.286907248
#> [61] 0.413865756 -2.881615722 0.517499954 0.277244642 0.287785536
#> [66] -1.888116073 -0.506356989 -1.090557151 -1.871129916 0.355296607
#> [71] 1.197579075 -1.473363834 -0.672670787 -0.358106918 0.101219565
#> [76] -1.418493284 -0.001347438 2.547413648 0.092551751 0.141820055
#> [81] -0.411653586 -1.164436591 0.317157703 -0.139225080 1.293319892
#> [86] 0.263847760 0.291776230 -0.407956502 0.654513911 -1.567941494
#> [91] 0.996052781 1.495408122 -0.347860564 0.421663171 1.387045411
#> [96] 0.556359220 -0.785111897 -0.653624826 0.857648445 -1.277101712
#>
#> $significance
#> [1] 0.7973502900 0.3262372941 0.1094103218 0.0895706397 0.0158638013
#> [6] 0.5406645496 0.5617650658 0.9577777900 0.5515218091 0.5525019737
#> [11] 0.1919895891 0.0509774980 0.8767518489 0.1192841879 0.9921271491
#> [16] 0.9606385888 0.3418833748 0.1102188852 0.8114835630 0.9084413388
#> [21] 0.5651574967 0.0437305381 0.1808746535 0.3631743855 0.8036578750
#> [26] 0.9920831431 0.5632188798 0.7320435501 0.5227836502 0.1056476452
#> [31] 0.5644706690 0.0007071541 0.2015651881 0.5390071314 0.5872818269
#> [36] 0.6419831710 0.9379830604 0.3995907948 0.5605391040 0.2461857679
#> [41] 0.9085424758 0.8549138520 0.5085139600 0.2593169937 0.1145559168
#> [46] 0.9634432216 0.7148168790 0.4958812875 0.5512879974 0.0037977453
#> [51] 0.0482539223 0.0830321143 0.2991147088 0.4144801513 0.1236618593
#> [56] 0.0262489416 0.9501815666 0.9487298175 0.0699916840 0.2157824056
#> [61] 0.6868116001 0.0136840184 0.6157006187 0.7861369725 0.7776698526
#> [66] 0.0862050101 0.6228852565 0.2997967984 0.0907206100 0.7295180656
#> [71] 0.2526053708 0.1662776032 0.5156861348 0.7255734068 0.9211698611
#> [76] 0.1824648135 0.9989523828 0.0267875811 0.9279833998 0.8898535332
#> [81] 0.6885447602 0.2683354797 0.7548020276 0.8914755847 0.2172915329
#> [86] 0.7966384843 0.7753228347 0.6914319296 0.5257376012 0.1348007948
#> [91] 0.3372750668 0.1611905533 0.7353550536 0.6817640170 0.1927077814
#> [96] 0.5887177238 0.4510695039 0.5278027234 0.4101611391 0.2254315425
#>