[R] How to generate table output of t-test

From: Ng Stanley <stanleyngkl_at_gmail.com>
Date: Tue, 5 Feb 2008 17:01:53 +0800


Hi,

Given

test <- matrix(c(1, 1,2,2), 2,2)
t <- apply(test, 1, t.test)

How can I obtain a table of p-values, confidence interval etc, instead of

[[1]]

        One Sample t-test

data: newX[, i]
t = 3, df = 1, p-value = 0.2048
alternative hypothesis: true mean is not equal to 0 95 percent confidence interval:
 -4.853102 7.853102
sample estimates:
mean of x

      1.5

[[2]]

        One Sample t-test

data: newX[, i]
t = 3, df = 1, p-value = 0.2048
alternative hypothesis: true mean is not equal to 0 95 percent confidence interval:
 -4.853102 7.853102
sample estimates:
mean of x

      1.5

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 05 Feb 2008 - 09:05:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Feb 2008 - 14:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive