User Tools

Site Tools


c:ma:2016:schedule:week09_answer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
c:ma:2016:schedule:week09_answer [2016/11/09 09:38] – [E.g. 4] hkimscilc:ma:2016:schedule:week09_answer [2016/11/09 09:52] (current) – [E.g. 6] hkimscil
Line 409: Line 409:
 아이스크림의 박테리아가 0.3 MPN/g 보다 커서 유통되기에 위험하다고 할 수 있을까? 아이스크림의 박테리아가 0.3 MPN/g 보다 커서 유통되기에 위험하다고 할 수 있을까?
  
 +<code>> ir <- c(0.593, 0.142, 0.329, 0.691, 0.231, 0.793, 0.519, 0.392, 0.418)
 +> ir
 +[1] 0.593 0.142 0.329 0.691 0.231 0.793 0.519 0.392 0.418
 +
 +> t.test(ir, mu=.3)
 +
 + One Sample t-test
 +
 +data:  ir
 +t = 2.2051, df = 8, p-value = 0.05853
 +alternative hypothesis: true mean is not equal to 0.3
 +95 percent confidence interval:
 + 0.2928381 0.6200508
 +sample estimates:
 +mean of x 
 +0.4564444 
 +
 +
 +
 +> t.test(ir, alternative="greater", mu=.3)
 +
 + One Sample t-test
 +
 +data:  ir
 +t = 2.2051, df = 8, p-value = 0.02927
 +alternative hypothesis: true mean is greater than 0.3
 +95 percent confidence interval:
 + 0.3245133       Inf
 +sample estimates:
 +mean of x 
 +0.4564444 
 +
 +
 +</code>
  
 ====== E.g. 6 ====== ====== E.g. 6 ======
Line 416: Line 450:
 흡연이 기억에 영향을 준다고 할 수 있을까? 흡연이 기억에 영향을 준다고 할 수 있을까?
  
 +<code>
 +> smoke <- c(18,22,21,17,20,17,23,20,22,21)
 +> nosmoke <- c(16,20,14,21,20,18,13,15,17,21)
 +
 +> sn <- data.frame(smoke, nosmoke)
 +> ss <- stack(sn)
 +> plot(ss$values~ss$ind)
 +</code>
 +
 +<code>> t.test(values$ss~ind$ss)
 +
 + Welch Two Sample t-test
 +
 +data:  ss$values by ss$ind
 +t = -2.2573, df = 16.376, p-value = 0.03798
 +alternative hypothesis: true difference in means is not equal to 0
 +95 percent confidence interval:
 + -5.0371795 -0.1628205
 +sample estimates:
 +mean in group nosmoke   mean in group smoke 
 +                 17.5                  20.1 
 +
 +
 +
 +
 +</code>
 ====== E.g. 7 ====== ====== E.g. 7 ======
   - MASS package를 불러온 후, survey 데이터를 활용하여 담배와 운동량 간의 관계에 대한 가설테스트를 하시오.    - MASS package를 불러온 후, survey 데이터를 활용하여 담배와 운동량 간의 관계에 대한 가설테스트를 하시오. 
c/ma/2016/schedule/week09_answer.1478653725.txt.gz · Last modified: 2016/11/09 09:38 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki