Description Usage Arguments Details Value Author(s) See Also Examples
This function applies the two sample t-test to each row or column of a matrix.
1 2 3 |
x |
a numeric |
MARGIN |
either 1 or 2. If |
n1 |
sample size of the first group. It should be smaller than the appropriate |
n2 |
sample size of the second group. It should be smaller than the appropriate |
pool |
logical, indicating if the variance estimate should be pooled. If |
pOnly |
logical, indicating if only a vector of p-values should be returned. |
tOnly |
logical, indicating if only a vector of t-statistics should be returned.
This argument overwrites |
This is a much faster function for "almost" the same purpose of apply each MARGIN of
x a t.test, i.e., the mean of the first n1 elements is compared with the
mean of the rest n2 elements, for each row or column depending on the MARGIN.
See the Value section for differences.
If pOnly=TRUE (the default situation), a numeric vector of p-values is returned, the length of which is determined by MARGIN.
If tOnly=TRUE , a numeric vector of t-statistics is returned, the length of which is determined by MARGIN.
If tOnly=TRUE and tOnly=TRUE, a numeric vector of t-statistics is returned, the length of which is determined by MARGIN, as tOnly overwrites pOnly.
If pOnly=FALSE and tOnly=FALSE, a list of three components is returned:
stat |
a numeric vector of the t-statistics, one for each row or column, depending on |
df |
a numeric vector of degrees of freedom. If |
p.value |
a numeric vector of p-values, one for each row or column, depending on |
Long Qu
1 2 3 4 5 |
[1] 0.2112825 0.8366920 0.2891014
[1] 0.2112825 0.8366920 0.2891014
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.