n<-100
ss<-qt(0.975, df=99)
lm<- 114
sd<- 24
SE <- sd/(sqrt(100))
MA<- ss*SE
lm + c(-MA,MA)
## [1] 109.2379 118.7621
3/126
## [1] 0.02380952
yc <- 107.7 
ya <- 115.3
sc <- 9.5
sa <- 14.9 
nc<- 195
na <- 96
library(BSDA)
## Warning: package 'BSDA' was built under R version 4.2.2
## Loading required package: lattice
## 
## Attaching package: 'BSDA'
## The following object is masked from 'package:datasets':
## 
##     Orange
tsum.test(yc, sc, nc, ya, sa, na)
## 
##  Welch Modified Two-Sample t-Test
## 
## data:  Summarized x and y
## t = -4.5619, df = 134.2, p-value = 1.131e-05
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -10.894936  -4.305064
## sample estimates:
## mean of x mean of y 
##     107.7     115.3
es <- (yc-ya)/sa
h1 <- c(21,10,32,60,8,44,29,5,13,26,33)
h2 <- c(86,27,10,68,87,76,125,60,35,73,96,44)
wilcox.test(h1,h2, conf.level = 0.95)
## Warning in wilcox.test.default(h1, h2, conf.level = 0.95): cannot compute exact
## p-value with ties
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  h1 and h2
## W = 17.5, p-value = 0.003113
## alternative hypothesis: true location shift is not equal to 0
t.test(h1, h2, conf.level = 0.95)
## 
##  Welch Two Sample t-test
## 
## data:  h1 and h2
## t = -3.7742, df = 16.763, p-value = 0.001546
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -62.44370 -17.63206
## sample estimates:
## mean of x mean of y 
##  25.54545  65.58333
t.test(h2, conf.level = .95)
## 
##  One Sample t-test
## 
## data:  h2
## t = 7.023, df = 11, p-value = 2.202e-05
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  45.02987 86.13680
## sample estimates:
## mean of x 
##  65.58333
t.test(h1)
## 
##  One Sample t-test
## 
## data:  h1
## t = 5.0753, df = 10, p-value = 0.0004811
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
##  14.33061 36.76030
## sample estimates:
## mean of x 
##  25.54545
n <- 18 
o <- 11
pt<- 13/22
ph <- o/n
ptn<-pt*n
npt <- n*(1-pt)
SE <- sqrt(((pt*(1-pt))/(n+4)))
Up <- pt + 1.96 *SE
Low <- pt -1.96 * SE
pg <-30
shdg <-20
sldg <-40
test <- data.frame(pg,shdg,sldg)
chisq.test(test)
## 
##  Chi-squared test for given probabilities
## 
## data:  test
## X-squared = 6.6667, df = 2, p-value = 0.03567
t <- c(20,8)
nt <- c(11,32)
test <- data.frame(t,nt)
chisq.test(test)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  test
## X-squared = 12.687, df = 1, p-value = 0.0003683
pt <- 20/31
pnt <- 8/40
or <- ((pt/(1-pt))/(pnt/(1-pnt)))
or
## [1] 7.272727