Correlation/regression example:
the data pairs:
How many hotdogs eaten: 1, 3, 2, 5, 4
Stomach Discomfort: 1, 27, 8, 125, 64

mean of x=3
variance of x=2.5
standard deviation of x=1.58
converting x of i to standard values: (x-3)/1.58 :
-1.2649109 0.0000000 -0.6324555 1.2649109 0.6324555
mean of y=45
variance of y=2598
standard deviation of y=50.97
converting x of i to standard values: (y-45)/50.97 :
-0.8633262 -0.3531789 -0.7259789 1.5696841 0.3728000
mulitply them by each other..
1.0920308 0.0000000 0.4591493 1.9855105 0.2357794
sum them up:
3.77247
divide by n-1 (i.e., 4)
r=0.9431175
predicted y=a + bx
b=r*(sy/sx)
a=y bar - b*x bar
b= .9431175*(50.96567/1.581139)
a= 45-3*30.4
y= -46.2 + 30.4 x
How good is the fit?
r2=.89
predicted=-15.8 14.6 45.0 75.4 105.8
variance of predicted=2310
r2=2310/2598=.89
fy