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

We wish to determine the unknown probability p, that a voter supports the contro

ID: 3314133 • Letter: W

Question

We wish to determine the unknown probability p, that a voter supports the controversial tulip proposal. We wish to estimate p. We take a random sample of n=3100 voters. x=1331 of these voters support the tulip proposal. Let p be the sample proportion of voters supporting the tulip proposal Answer the following using R code. a)As a function of p, what is the variance of p? (use R code) 0 b) As a function of p, what is the standard deviation of p? (use R code) c) Calculate p d) Let ptot be the random variable representing the total number of voters in the sample who support the tulip proposal. As a function of p, what is the standard deviation of ptot? e) what is the critical value for an approximate classical 93% confidence interval for p? f) Calculate a classical 93% confidence interval for p. 0) g) what is the length of the above classical 93% confidence interval for p? h) Assuming the same p value, what sample size would have made the 93% confidence interval for p have a length of .08 or less? )Copy your R script for the above into the text box here.

Explanation / Answer

## Only command


n=3100
x=1331
p=x/n

# a) variance of p^
var.p=(p*(1-p)/n)
var.p
# b) Standard deviation of p^ is

sd.p=sqrt(var.p)
sd.p

# c) Estimate of p^ is
p=x/n
p

# d) Standard deviation of plot is

sd.plot=sd.p
sd.plot

# e) Critical value of the 97% confidence interval is
c.v=qnorm(0.985)
c.v

# f) 97% confidence interval
Lower.limit=p-c.v*sd.p
Lower.limit
Upper.limit=p+c.v*sd.p
Upper.limit

# h) Sample size
n=c.v^2/(0.08/2)^2*p*(1-p)
n

########### OUT pot

> n=3100
> x=1331
> p=x/n
>
> # a) variance of p^
> var.p=(p*(1-p)/n)
> var.p
[1] 7.903525e-05
> # b) Standard deviation of p^ is
>
> sd.p=sqrt(var.p)
> sd.p
[1] 0.008890177
>  
> # c) Estimate of p^ is
> p=x/n
> p
[1] 0.4293548
>
> # d) Standard deviation of plot is
>
> sd.plot=sd.p
> sd.plot
[1] 0.008890177
>
> # e) Critical value of the 97% confidence interval is
> c.v=qnorm(0.985)
> c.v
[1] 2.17009
>
> # f) 97% confidence interval
> Lower.limit=p-c.v*sd.p
> Lower.limit
[1] 0.4100624
> Upper.limit=p+c.v*sd.p
> Upper.limit
[1] 0.4486473
>
> # h) Sample size
> n=c.v^2/(0.08/2)^2*p*(1-p)
> n
[1] 721.1376

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