Please someone help with this. I have my own answers but I believe they're wrong.
>
x<-c(0.5,1,4,5,1.5,4,3,6,2,1.5,2,5,2,4,2,4,4,3,0.25)
>
y<-c(1.9,2.3,2.3,2.4,2.5,2.5,2.5,2.5,2.5,2.7,2.7,2.77,2.78,2.8,2.8,2.8,2.8,2.8,2.83)
> xs<-(x-mean(x))/sd(x)
> xs
[1] -1.45771418 -1.15167474 0.68456191 1.29664079 -0.84563530
0.68456191 0.07248303 1.90871967 -0.53959586 -0.84563530
[11] -0.53959586 1.29664079 -0.53959586 0.68456191 -0.53959586
0.68456191 0.68456191 0.07248303 -1.61073390
> ys<-c(y-mean(y))/(sd(y))
> ys
[1] -2.7954270 -1.1711728 -1.1711728 -0.7651092 -0.3590457
-0.3590457 -0.3590457 -0.3590457 -0.3590457 0.4530814
[11] 0.4530814 0.7373259 0.7779323 0.8591450 0.8591450 0.8591450
0.8591450 0.8591450 0.9809641
> cor(xs,ys)
[1] 0.1589912
> mod<-lm(y~x)
> summary(mod)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-0.6313 -0.1392 0.1308 0.1848 0.3046
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.51936 0.11879 21.208 1.15e-13 ***
x 0.02397 0.03609 0.664 0.516
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2502 on 17 degrees of freedom
Multiple R-squared: 0.02528, Adjusted R-squared:
-0.03206
F-statistic: 0.4409 on 1 and 17 DF, p-value: 0.5156
Compute the correlation coefficient between GPA and Study Hours using the Z-score products from the table....