I got the following columns:
Level 1 240 12 7
Level 2 98 5 5
Level 3 46 4 6
Level 4 21 0 1
I try to prove that there is a correlation between the "Level" and the number of people (represented by each column) I used the following forumla (Table is the table..) :
RS2 = r2_score(Table.iloc[1:5,0], Table.iloc[1:5,1], Table.iloc[1:5,2])
print(RS2 )
The result is negative (-4....) which is wrong.
I am undecided, but maybe I should calculate the columns together as one group, finding mean and then the estimated values? if not, what should I do?
** note my data is small, concatenating the columns will probably give a large confidence interval..