Computes the two-sample Student's pooled t-test for each feature.
See the Details section below for further information.
Usage
rowEqualVarT(
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_equalvar
function.
Examples
#Seed
set.seed(1010)
#Data
x = matrix(rnorm(100 * 20), 100, 20)
g = sample(c(0,1), 20, replace = TRUE)
#Compute
rowEqualVarT(x = x, g = g)
#> $statistic
#> [1] 0.78585383 1.06901606 -1.83683787 0.27382446 -1.17958711 0.60776918
#> [7] 0.04697701 0.36572100 0.37324826 0.01366600 1.02611095 3.61577782
#> [13] 0.23956328 0.84843337 -2.90582949 0.20429233 -0.19817606 2.91597900
#> [19] -0.54777448 -1.13938824 -0.88602909 -0.03491923 0.47121258 -0.32940007
#> [25] 1.56771221 -1.68856802 -0.70720816 1.74669810 0.82165223 1.19396341
#> [31] 0.31426298 -0.46082152 -1.33677122 -0.23210095 0.42785859 -2.81208495
#> [37] -0.37472657 1.37400217 -0.99937547 1.07411574 0.28268721 -1.26332798
#> [43] 0.52803512 -1.27975032 -2.60687730 0.25513357 -0.26502210 0.16666594
#> [49] -1.30327073 -1.34379064 -1.28730232 0.03952200 0.97176945 -0.54963938
#> [55] -0.61883848 1.34226653 0.96664559 -0.64586563 -1.07686025 0.38249566
#> [61] 0.04024889 -0.26969092 -0.22784112 -0.07470020 0.36988321 0.59021468
#> [67] 0.60000643 -0.50433145 1.13562547 0.04572209 1.90207050 1.91774863
#> [73] -0.77925961 -0.88606180 1.66406403 0.54099222 1.45102910 -1.28636126
#> [79] -0.19672930 -0.78632264 -1.28285228 3.10264694 -1.27634959 -0.29676090
#> [85] 0.28469874 0.63186675 -0.48717624 0.40676752 1.03375464 -0.07182129
#> [91] -1.69819089 -0.89034111 1.17140248 0.23715281 0.31688016 -0.24275638
#> [97] 0.52259143 -0.40698311 -1.40406742 0.39232431
#>
#> $significance
#> [1] 0.442175859 0.299189535 0.082803822 0.787336975 0.253520606 0.550932350
#> [7] 0.963048844 0.718835880 0.713323057 0.989246781 0.318432101 0.001976585
#> [13] 0.813375570 0.407338394 0.009425943 0.840417168 0.845128304 0.009221409
#> [19] 0.590575494 0.269477549 0.387286174 0.972528477 0.643149627 0.745655395
#> [25] 0.134359728 0.108550730 0.488492833 0.097731175 0.422025211 0.247990429
#> [31] 0.756934565 0.650445702 0.197948760 0.819077950 0.673829370 0.011533983
#> [37] 0.712242269 0.186310456 0.330859053 0.296959476 0.780641688 0.222590206
#> [43] 0.603924431 0.216882408 0.017839470 0.801512307 0.794003581 0.869490854
#> [49] 0.208907405 0.195711365 0.214296244 0.968909274 0.344043779 0.589321984
#> [55] 0.543775817 0.196195449 0.346530494 0.526515332 0.295764322 0.706572649
#> [61] 0.968337774 0.790465508 0.822337813 0.941277182 0.715785572 0.562383956
#> [67] 0.555980978 0.620146075 0.271008680 0.964035200 0.073287907 0.071150524
#> [73] 0.445951945 0.387269020 0.113411033 0.595145435 0.163976809 0.214617187
#> [79] 0.846243578 0.441908164 0.215817215 0.006143642 0.218054907 0.770046205
#> [85] 0.779124524 0.535417486 0.632013346 0.688974669 0.314940928 0.943536143
#> [91] 0.106691505 0.385028695 0.256710368 0.815216383 0.754980309 0.810938795
#> [97] 0.607631515 0.688819158 0.177317919 0.699425299
#>