Question: Hello can you please help me get a better understanding of how to answer the question shown below? I have the code I used through

Hello can you please help me get a better understanding of how to answer the question shown below? I have the code I used through RStudio which I understand but I am confused on how to answer the question shown below from the data I gathered.

Question

Using the prop.test function(shown below), calculate and report confidence intervals for the proportion of atheists in 2012 in two other countries of your choice. Note whether the conditions for inference are met.

RStudio code/data:

First country i choose was Ireland

>Irl12 <- subset(atheism, nationality == "Ireland" & year == "2012")

> Irl12$nationality <- as.factor(as.character(Irl12$nationality))

>( Irl12prop <- prop.table(table(Irl12$nationality, Irl12$response)) )

> table(Irl12$response)

> dim(Irl12)

> prop.test(x = 50, n = 1002, conf.level = 0.95)

1-sample proportions test with continuity correction

data: 50 out of 1002, null probability 0.5

X-squared = 810.18, df = 1, p-value < 2.2e-16

alternative hypothesis: true p is not equal to 0.5

95 percent confidence interval:

0.03761982 0.06574456

sample estimates:

p

0.0499002

Second country was Spain

> spn12 <- subset(atheism, nationality == "Spain" & year == "2012")

> spn12$nationality <- as.factor(as.character(spn12$nationality))

> ( spn12prop <- prop.table(table(spn12$nationality, spn12$response)) )

atheist non-atheist

Spain 0.08995633 0.91004367

> table(spn12$response)

atheist non-atheist

103 1042

> dim(spn12)

[1] 1145 3

> prop.test(x = 50, n = 1002, conf.level = 0.95)

1-sample proportions test with continuity correction

data: 50 out of 1002, null probability 0.5

X-squared = 810.18, df = 1, p-value < 2.2e-16

alternative hypothesis: true p is not equal to 0.5

95 percent confidence interval:

0.03761982 0.06574456

sample estimates:

p

0.0499002

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!