Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

hw #6

Views: 36
%r 1. x<-c(1.23,1.33,.04,.44,1.2,.27,.48,.19,.83,.81,.71,.5,.49,1.16,.05,.15,.19,.77,1.08,.98,.63,.56,.41,.73,.34,.59,.34,.84,.5,.34,.28,.34,.87,.56,.17,.18,.19,.04,.49,1.1,.16,.1,.48,.21,.86,.52,.65,.27,.94,.4,.43,.25,.27) mean(x) sd(x) 1-pt(-10.98,52) 2. prop.test(284,631,conf.level=.95) 3. x<-c(1.23,1.33,.04,.44,1.2,.27,.48,.19,.83,.81,.71,.5,.49,1.16,.05,.15,.19,.77,1.08,.98,.63,.56,.41,.73,.34,.59,.34,.84,.5,.34,.28,.34,.87,.56,.17,.18,.19,.04,.49,1.1,.16,.1,.48,.21,.86,.52,.65,.27,.94,.4,.43,.25,.27) t.test(x,conf.level=.90) 4. x<-c(176,150,150,115,129,160,120,125,89,132,120,120,68,87,88,72,77,84,92,80,60,67,59,64,88,74,68) t.test(x,cocnf.level=.95) 5. x<-c(45,51,39,41,48,49,46,43,47) y<-c(171,178,157,163,172,183,173,175,173) plot(x,y) xbar = mean(x); ybar = mean(y); SSxy = sum((x-xbar)*(y-ybar)) SSx = sum((x-xbar)^2) b = SSxy/SSx print(b) a = ybar-b*xbar sprintf("a = %2.2f", a); sprintf("b = %2.2f", b) plot(x,y,col="blue",lwd=2) lines(x,a+b*x,col="red") 6. x<-c(45,51,39,41,48,49,46,43,47) y<-c(171,178,157,163,172,183,173,175,173) cor(x,y) sprintf("coeff. of determination r^2=%2.4f",cor(x,y)^2)
1
0.527169811320755
0.341035625019815
0.999999999999998
2
1-sample proportions test with continuity correction data: 284 out of 631, null probability 0.5 X-squared = 6.0919, df = 1, p-value = 0.01358 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.4108988 0.4898761 sample estimates: p 0.4500792
3
One Sample t-test data: x t = 11.254, df = 52, p-value = 1.506e-15 alternative hypothesis: true mean is not equal to 0 90 percent confidence interval: 0.4487193 0.6056204 sample estimates: mean of x 0.5271698
4
One Sample t-test data: x t = 15.563, df = 26, p-value = 1.085e-14 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: 87.24226 113.79478 sample estimates: mean of x 100.5185
5
[1] 1.69963
'a = 94.43'
'b = 1.70'
6
0.855968284268897
'coeff. of determination r^2=0.7327'