I am a complete beginner in R.
I ran multiple Chi-square tests on a column of data in R with this code:
apply(mydata, 2, chisq.test, p=expected.probability)
and got multiple results like this:
$
Primary Tumor
Chi-squared test for given probabilities
data: newX[, i] X-squared = 515108, df = 6, p-value < 2.2e-16
$
Primary Tumor_1
Chi-squared test for given probabilities
data: newX[, i] X-squared = 583205, df = 6, p-value < 2.2e-16
$
Primary Tumor_2
Chi-squared test for given probabilities
data: newX[, i] X-squared = 58089, df = 6, p-value < 2.2e-16
Can extract a results table with Tumour number, x-squared results, df and p-value of 50 samples I tested?
I can copy and paste in excel but I wanna learn code for larger sample.
Thank you:)