The y-values in these coordinates are the observed data from a simulation:
{{50.0251, -19.8231}, {531.214, 389.522}, {626.79, 470.827}, {723.357,552.976}, {820.686, 635.773}, {918.619, 719.084}}
The y-values in these coordinates are evaluations of the linear fit I applied to the previous coordinate list:
{{50.0251, -20.3943}, {531.214, 388.221}, {626.79, 469.381}, {723.357, 551.383}, {820.686, 634.033}, {918.619, 717.196}}
I want to get the Chi-Squared parameter for this fit, so I plug in the y-values of the first list for $observed$ and the y-values of the second list for $expected$ in the following formula as I read it in Wikipedia:
$$\sum \frac{(observed-expected)^2}{expected}$$
and the result is $-32.7844$.
I've never done anything related to statistics, just found the formula and plugged it, it seems very straightforward, what am I doing wrong? Thanks
EDIT: This is what I do, suppose the first list is $((x_1,y_1),...(x_6,y_6))$ and the second list is $((x_1,z_1),...(x_6,z_6))$, I apply the formula as
$\frac{(y1-z1)^2}{z_1}+\frac{(y2-z2)^2}{z_2}+\frac{(y3-z3)^2}{z_3}$
I have to be doing this wrong, because that's what I do and get the wrong number!