r - Grabbing certain results out of multiple t.test outputs to create a table -
I have run 48 T-Tests (hand-coded instead of writing a loop) and would like to get some results from
Specifically, I only consolidate p-value
>, confidence interval , and mean x and y for each of these 48 tests and then create a table of results Beyond the answer is a fantastic, quick way to do this, in which I would all go for 48 tests and ttest all three desired output with something along the lines of $ p I .Value
? Maybe a loop?
Below is a sample of the input coded for a T-test, followed by the output given by R.
# t.test Comparison Tool 2005 Change_Unemp for Government Employment (ix) lowgov6 & lt; - met_res [met_res $ Gov_Emp_2005 & lt; = 93310, "Change_Unemp"] Haigose 6 & lt; - met_res [met_res $ Gov_Emp_2005 & gt; 93310, "Change_Unemp"] t.test (lowgov6, highgov6, pool.sd = FALSE, na.rm = TRUE) Welsh two sample test data: lowgov6 and highgov6 t = 1.5896, df = 78.978, p-value = 0.1159 alternative hypothesis : True difference in the means is not equal to 95 percent trust interval: -0.181390 9 1.6198399 Sample estimates: y means the meaning of x 4.761224 4.042000 Post-Text "itemprop =" text "> Save all your T-tests to a list:
test - List () test [[1]]
The output is as follows:
[, 1] [, 2] x Meaning 0.120 9 5949 0.0302 9474 means y-0.05337072 0.07226999 ci.lower -0.11448679 -0.31771191 ci.upper 0.46314721 0.23376141 p.value 0.23534905 0.76434012
but it has 48 columns Area. You can get the result t ()
if you want to transphase it.