Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Uji Proporsi dan Goodness of Fit Test

Sukmawati

2024-01-08
1 Populasi
prop.test(x=28, n=90, p = 0.10, alternative = "less",
correct = FALSE)

##
## 1-sample proportions test without continuity correction
##
## data: 28 out of 90, null probability 0.1
## X-squared = 44.568, df = 1, p-value = 1
## alternative hypothesis: true p is less than 0.1
## 95 percent confidence interval:
## 0.0000000 0.3959029
## sample estimates:
## p
## 0.3111111

2 Populasi
prop.test(x=c(275,100), n=c(500,100),
alternative = "two.sided",correct = FALSE)

##
## 2-sample test for equality of proportions without continuity correction
##
## data: c(275, 100) out of c(500, 100)
## X-squared = 72, df = 1, p-value < 2.2e-16
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## -0.4936064 -0.4063936
## sample estimates:
## prop 1 prop 2
## 0.55 1.00

Goodness of Fit Test


observed <- c(50, 60, 40, 47, 53)
expected <- c(.2, .2, .2, .2, .2) #must add up to 1

chisq.test(x=observed, p=expected)

##
## Chi-squared test for given probabilities
##
## data: observed
## X-squared = 4.36, df = 4, p-value = 0.3595

You might also like