User Tools

Site Tools


summary_of_hypothesis_testing:output01

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
summary_of_hypothesis_testing:output01 [2025/11/30 15:31] hkimscilsummary_of_hypothesis_testing:output01 [2025/11/30 15:42] (current) hkimscil
Line 61: Line 61:
 > diff <- m.treated.s-mean(p1) > diff <- m.treated.s-mean(p1)
 > diff/se.z1 > diff/se.z1
-[1] 1.451929+[1] 1.501677
 > zscore <- diff/se.z1 > zscore <- diff/se.z1
 > pnorm(zscore, lower.tail = F)*2 > pnorm(zscore, lower.tail = F)*2
-[1] 0.1465213+[1] 0.1331805
 > tscore <- zscore > tscore <- zscore
 > pt(tscore, df=length(treated.s)-1, lower.tail = F)*2 > pt(tscore, df=length(treated.s)-1, lower.tail = F)*2
-[1] 0.1554272+[1] 0.1421495
  
 > # usual way - using sample's variance  > # usual way - using sample's variance 
Line 74: Line 74:
 > se.s <- sqrt(var(treated.s)/n.s) > se.s <- sqrt(var(treated.s)/n.s)
 > se.s > se.s
-[1] 1.549221+[1] 1.599673
 > tscore <- diff/se.s > tscore <- diff/se.s
 > tscore > tscore
-[1] 1.562+[1] 1.564567
  
  
Line 110: Line 110:
 > abline(v=m.treated.s, col='red', lwd=3) > abline(v=m.treated.s, col='red', lwd=3)
 > se.s > se.s
-[1] 1.549221+[1] 1.599673
 > se.z1 > se.z1
 [1] 1.666667 [1] 1.666667
  
 > c(m.treated.s-2*se.s, m.treated.s+2*se.s) > c(m.treated.s-2*se.s, m.treated.s+2*se.s)
-[1]  99.32144 105.51832+[1]  99.30345 105.70214
 > c <- qt(0.975, n.s-1) > c <- qt(0.975, n.s-1)
 > c > c
 [1] 2.030108 [1] 2.030108
 > c(m.treated.s-c*se.s, m.treated.s+c*se.s) > c(m.treated.s-c*se.s, m.treated.s+c*se.s)
-[1]  99.2748 105.5650+[1]  99.25529 105.75030
 > m.p2 > m.p2
 [1] 104 [1] 104
 +
 +> x.p.est <- seq(m.treated.s-5*se.s, 
 ++                m.treated.s+5*se.z1, 
 ++                length.out = 500)
 +> y.p.est <- dnorm(x.p.est, m.treated.s, se.s)
 +
 +> plot(x.p.est, y.p.est, type = "l", 
 ++      lwd=3, 
 ++      main = "population mean estimated from a sample",
 ++      xlab = "Value", ylab = "Density")
 +> se1 <- c(m.treated.s-se.s, m.treated.s+se.s)
 +> se2 <- c(m.treated.s-2*se.s, m.treated.s+2*se.s)
 +> se3 <- c(m.treated.s-3*se.s, m.treated.s+3*se.s)
 +> abline(v=c(m.treated.s,se1,se2,se3), 
 ++        col=c('black', 'darkorange', 'darkorange',
 ++              'darkgreen', 'darkgreen', 
 ++              'darkblue', 'darkblue'), 
 ++        lwd=2)
 +
 +
  
  
 > pt(diff/se.s, df=n.s-1, lower.tail = F) * 2 > pt(diff/se.s, df=n.s-1, lower.tail = F) * 2
-[1] 0.1272858+[1] 0.1266823
 > t.test(treated.s, mu=m.p1, var.equal = T) > t.test(treated.s, mu=m.p1, var.equal = T)
  
Line 132: Line 152:
  
 data:  treated.s data:  treated.s
-t = 1.562, df = 35, p-value = 0.1273+t = 1.5646, df = 35, p-value = 0.1267
 alternative hypothesis: true mean is not equal to 100 alternative hypothesis: true mean is not equal to 100
 95 percent confidence interval: 95 percent confidence interval:
-  99.2748 105.5650+  99.25529 105.75030
 sample estimates: sample estimates:
 mean of x  mean of x 
- 102.4199 + 102.5028 
  
  
  
 </code> </code>
-{{.:pasted:20251130-153138.png}} +{{.:pasted:20251130-154128.png}} 
-{{.:pasted:20251130-153117.png}} +{{.:pasted:20251130-154142.png}} 
 +{{.:pasted:20251130-154159.png}}
summary_of_hypothesis_testing/output01.txt · Last modified: by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki