Dear all, I would like to compute hundreds of chisq.test ´s, and for each test output I would like to extract only the p-values. So my question is: how can I make this without making it manually? Example: # Test nº1 > chisq.test(c(220,240)) Chi-squared test for given probabilities data: c(220, 240) X-squared = 0.8696, df = 1, p-value = 0.3511 # Test nº2 > chisq.test(c(301,258)) Chi-squared test for given probabilities data: c(301, 258) X-squared = 3.3077, df = 1, p-value = 0.06896 ... # Test nº200 > chisq.test(c(242,281)) Chi-squared test for given probabilities data: c(242, 281) X-squared = 2.9082, df = 1, p-value = 0.08813 Desired output: Test 1 2 ... 200 p-value 0.3511 0.06896 ... 0.08813 Thanks in advance. Best regards, João Fadista
______________________________________________ R-help@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.