You are on page 1of 3

Math 2240 Lab 3 Malak Boudaka 163719

1. > Bodyfat <- read.csv("http://www.acadiau.ca/~econnon/data/Bodyfat.csv")


> BMI <- (703*Bodyfat$weight)/(Bodyfat$height)^2

2. > hist(BMI)

3. > sum(BMI>=30)
[1] 24

4. # of adult men : # of adult men that are


obese 24 : 252
= 0.095

5. Successes:
np>=10
252*0.095=23.94 is larger than 10

Failure:
n(1-p)>=10
252(1-0.095)=228.06 is larger than 10
so it satisfies the conditions for confidence interval

6. > prop.test(23.94, 252, conf.level= 0.95, correct=

FALSE) 1-sample proportions test


without continuity
correction

data: 23.94 out of 252, null probability 0.5


Math 2240 Lab 3 Malak Boudaka 163719

X-squared = 165.34, df =
1, p-value < 2.2e-16
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.0646408 0.1375214
sample estimates:
p
0.095

Confidence interval = (0.06464, 0.1375)

7. a. H0 : p = 0.284
Ha : p > 0.284

b.
0.284 is not between the confidence interval found in Q6 so we reject the H0
c.
> prop.test(23.94, 252, p = 0.284, alternative = 'greater', correct = FALSE)

1-sample proportions test

without continuity

correction

data: 23.94 out of 252, null probability 0.284

X-squared = 44.268, df =

1, p-value = 1

alternative hypothesis: true p is greater than 0.284

95 percent confidence interval:

0.06877736 1.00000000

sample estimates:

0.095

p-value = 0.0688

0.284 does not fall in the p value so we reject H0


Math 2240 Lab 3 Malak Boudaka 163719

d.
yes they do, in both parts we reject the H0

You might also like