User Tools

Site Tools


summary_of_hypothesis_testing

Differences

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

Link to this comparison view

summary_of_hypothesis_testing [2024/12/02 08:42] – created hkimscilsummary_of_hypothesis_testing [2024/12/02 08:56] (current) hkimscil
Line 109: Line 109:
 data.frame(cbind(sss, ses, lower.s2, upper.s2)) data.frame(cbind(sss, ses, lower.s2, upper.s2))
  
-n <- 200+# 12/2 lecture  
 +# note that we draw the statistical calculation  
 +# by "diff/se" = "diff/random_error" 
 +n <- 80
 mean.sample <- 103 mean.sample <- 103
-diff <- mean.sample - mean.ajstu  + 
-se <- sd.ajstu / sqrt(n) +sample <- rnorm2(n, mean.sample, sd.ajstu) 
-diff/se+mean(sample) 
 +sd(sample) 
 + 
 +diff <- mean.sample - mean.ajstu # this is actual difference 
 +se <- sd.ajstu / sqrt(n) # this is random error  
 +t.cal <- diff/se 
 +t.cal
 qnorm(0.025, lower.tail = F) qnorm(0.025, lower.tail = F)
 qnorm(0.01/2, lower.tail = F) qnorm(0.01/2, lower.tail = F)
 +qt(0.05/2, n-1, lower.tail=F)
 +
 +t.test(sample, mu=mean.ajstu)
  
 +# or we obtain the exact p value
 +p.value <- pt(t.cal, n-1, lower.tail = F)
 +p.value*2
  
  
  
 </code> </code>
summary_of_hypothesis_testing.1733096556.txt.gz · Last modified: 2024/12/02 08:42 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki