The results from a chisq test appears as below , i need the sum of statistic (chisq) only, colsum is not working. How will i only get the statistic sum?
statistic parameter p.value
1 120 9 1.336165e-21
2 115.2397 21 5.292644e-15
3 114.9731 18 3.703771e-16
4 85.85785 21 8.283122e-10
5 103.7818 30 4.650999e-10
6 85.44727 24 8.062478e-09
7 42.03636 18 0.001093033
8 42.31688 24 0.01188941
9 72.22857 24 1.000100e-06
10 54.47273 24 0.0003685193
You want something along the lines of:
If it’s a data.frame you could have written:
Sometimes an object has a matrix buried “one layer below” or even “two layers below” where it should be. Perhaps this dput result could be used … not saying it is like yours but it does have a list class and it would print something like yours:
You need to use [[1]] twice to get “deep enough” to access the “statistic” column: