Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this exercise we examine the effect of the sample size on the significance te

ID: 3063809 • Letter: I

Question

In this exercise we examine the effect of the sample size on the significance test for comparing two proportions. In each case suppose that p1 = 0.65 and p2 = 0.45, and take n to be the common value of n1 and n2. Use the z statistic to test H0: p1 = p2 versus the alternative Ha: p1 p2. Compute the statistic and the associated P-value for the following values of n: 40, 50, 60, 80, 380, 480, and 980. Summarize the results in a table. (Test the difference p1 p2. Round your values for z to two decimal places and round your P-values to four decimal places.)

n z P-value

40

50

60

80

380

480

980

Question 2

We have studied the effect of the sample size on the margin of error of the confidence interval for a single proportion. In this exercise we perform some calculations to observe this effect for the two-sample problem. Suppose that p1 = 0.7 and p2 = 0.5, and n represents the common value of n1 and n2. Compute the 95% margins of error for the difference between the two proportions for n = 50, 60, 70, 90, 390, 490, and 990. Present the results in a table. (Give the large-sample margins of error. Round your answers to three decimal places.)

n m 50 60 70 90 390 490 990

Explanation / Answer

Q1.

question1 = function(p1, n1, p2, n2)
{
table = matrix(c(p1*n1, p2*n2, (1-p1)*n1, (1-p2)*n2), nrow = 2, ncol=2)
r = prop.test(x = table, conf.level = 0.95, correct = FALSE)
z = sqrt(r$statistic)
p = r$p.value
answer1 = unname(c(z, p))
print(answer1)
}

> question1(p1 = 0.65, p2 = 0.45, n1 = 40, n2 = 40)
[1] 1.7978663 0.0721982
> question1(p1 = 0.65, p2 = 0.45, n1 = 50, n2 = 50)
[1] 2.01007563 0.04442318
> question1(p1 = 0.65, p2 = 0.45, n1 = 60, n2 = 60)
[1] 2.20192753 0.02767043
> question1(p1 = 0.65, p2 = 0.45, n1 = 80, n2 = 80)
[1] 2.54256690 0.01100415
> question1(p1 = 0.65, p2 = 0.45, n1 = 380, n2 = 380)
[1] 5.541396 3.000696e-08
> question1(p1 = 0.65, p2 = 0.45, n1 = 480, n2 = 480)
[1] 6.227992 4.724525e-10
> question1(p1 = 0.65, p2 = 0.45, n1 = 980, n2 = 980)
[1] 8.898984 5.636013e-19

Q2.

question2 = function(p1, n1, p2, n2)
{
table = matrix(c(p1*n1, p2*n2, (1-p1)*n1, (1-p2)*n2), nrow = 2, ncol=2)
r = prop.test(x = table, conf.level = 0.95, correct = FALSE)
answer2 = (r$conf.int[2] - r$conf.int[1])/2
print(answer2)
}

> question2(p1 = 0.7, p2 = 0.5, n1 = 50, n2 = 50)
[1] 0.1879931
> question2(p1 = 0.7, p2 = 0.5, n1 = 60, n2 = 60)
[1] 0.1716135
> question2(p1 = 0.7, p2 = 0.5, n1 = 70, n2 = 70)
[1] 0.1588832
> question2(p1 = 0.7, p2 = 0.5, n1 = 90, n2 = 90)
[1] 0.1401218
> question2(p1 = 0.7, p2 = 0.5, n1 = 390, n2 = 390)
[1] 0.06731234
> question2(p1 = 0.7, p2 = 0.5, n1 = 490, n2 = 490)
[1] 0.06005221
> question2(p1 = 0.7, p2 = 0.5, n1 = 990, n2 = 990)
[1] 0.04224832

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote