Escolar Documentos
Profissional Documentos
Cultura Documentos
PointEst
Lower
Upper
> library(Hmisc,T)
> binconf(x=3,n=25,alpha=0.05,method="exact")
PointEst
Lower
Upper
data: 3 and 25
number of successes = 3, number of trials = 25, p-value = 0.0001565
alternative hypothesis: true probability of success is not equal to 0.5
> prop.test(x=3,n=25,conf.level=0.95,correct=FALSE)
data: teh
p-value = 0.4857
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.2117329 621.9337505
sample estimates:
odds ratio
6.408309
> fisher.test(teh,alternative="greater")
data: teh
p-value = 0.2429
alternative hypothesis: true odds ratio is greater than 1
95 percent confidence interval:
0.3135693
Inf
sample estimates:
odds ratio
6.408309
data: gender
X-squared = 30.0701, df = 2, p-value = 2.954e-07
> chisq.test(gender,simulate.p.value=TRUE,B=10000)
data: gender
X-squared = 30.0701, df = NA, p-value = 9.999e-05
> Fisher.test(gender)
Error: could not find function "Fisher.test"
> chooseCRANmirror()
> dp=c(19,132,0,9,11,52,6,97)
> dp=array(dp,dim=c(2,2,2))
> dimnames(dp)=list(Hukum.Mati=c("ya","tidak"),Korban=c("Suku A","Suku B"),Terdakwa=c("Suku
A","Suku B"))
> mantelhaen.test(dp)
data: dp
Mantel-Haenszel X-squared = 5.8062, df = 1, p-value = 0.01597
alternative hypothesis: true common odds ratio is not equal to 1
95 percent confidence interval:
1.397771 11.381078
sample estimates:
common odds ratio
3.988502
> mantelhaen.test(dp,correct=FALSE)
data: dp
Mantel-Haenszel X-squared = 6.9964, df = 1, p-value = 0.008168
alternative hypothesis: true common odds ratio is not equal to 1
95 percent confidence interval:
1.397771 11.381078
sample estimates:
common odds ratio
3.988502