# Math Help - Pearson correlation coefficient

1. ## Pearson correlation coefficient

patient------#of current med. problems(x)------post-op length of stay(y)
1---------------------1-------------------------------6
2---------------------2-------------------------------6
3---------------------2------------------------------11
4---------------------1-------------------------------9
5---------------------3------------------------------16
6---------------------1------------------------------16
7---------------------3-------------------------------4
8---------------------5-------------------------------8
9---------------------2------------------------------11
10--------------------3------------------------------13

After caluclating the Pearson correlation coefficient, my final answer came to be -0.085 Here's how I got that number:
[sum]Xi = 23
[sum]Yi=100
[sum]Xi^2=67
[sum]Yi^2=1156
[sum]XiYi=226
n=10

So, when I put those numbers in my formula, I get -40/468.9969
Can you have negative numbers like that? I feel like I did it all right, but that negative 40 makes me think it's wrong.

The other part of the question is to find the least squares regression line. Using all of my numbers, I get 10.92 I think I did that right, but I don't know if the numbers I used to get it were correct. I'm sorry I know this is a long problem, but any help would be great. Thanks!

2. Originally Posted by Jimmy23

patient------#of current med. problems(x)------post-op length of stay(y)
1---------------------1-------------------------------6
2---------------------2-------------------------------6
3---------------------2------------------------------11
4---------------------1-------------------------------9
5---------------------3------------------------------16
6---------------------1------------------------------16
7---------------------3-------------------------------4
8---------------------5-------------------------------8
9---------------------2------------------------------11
10--------------------3------------------------------13

After caluclating the Pearson correlation coefficient, my final answer came to be -0.085 Here's how I got that number:
[sum]Xi = 23
[sum]Yi=100
[sum]Xi^2=67
[sum]Yi^2=1156
[sum]XiYi=226
n=10

So, when I put those numbers in my formula, I get -40/468.9969
Can you have negative numbers like that? I feel like I did it all right, but that negative 40 makes me think it's wrong.
Assuming you arithmatic is correct this is OK, you have a small negative
correlation.

A negative correlation means larger x's generaly correspond to smaller y's,
but in this case it is not significant because the absolute value of the
correlation coefficient is so small. Attached is a scatter diagram of this
data, with the regression line which has a small negative slope but as you
can see this is not a good predictor of length of stay.

Note: it is always worthwhile constructing a scatter plot of the data.

The other part of the question is to find the least squares regression line. Using all of my numbers, I get 10.92 I think I did that right, but I don't know if the numbers I used to get it were correct. I'm sorry I know this is a long problem, but any help would be great. Thanks!
You don't say what the 10.92 is, but I guess it must be the constant in
the regressions line. This looks OK-ish, in the attachment you will see that
excel gives a value of 10.65, but this may differ from your answer either
because of an error in your calculation (or excels, its not unknown) or
because you are using slightly differernt forms of the regressions equations.

RonL