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

Please, help to solve this question using R and indicate the codes used to drive

ID: 3350698 • Letter: P

Question

Please, help to solve this question using R and indicate the codes used to drive your result.

Problem 2:

Feeling thermometers are a survey tool used to learn whether people feel favorably or unfavorably toward groups or individuals. The scale ranges from 0-100 and higher values indicate greater favorability. Suppose you surveyed the public and found that the average feeling thermometer of labor unions is 35. You also know the standard deviation of the sample is 11 and that you took a sample of size 50. Using R (or Stata), calculate the following:

Use the normal distribution to calculate the 95% Confidence Interval around the mean (Hint: use the qnorm() function))

Use the t-distribution since this is a relatively small sample and calculate the 95% CI (Hint: use the qt() function))

Use the t-distribution since this is a relatively small sample and calculate the 90% CI (Hint: use the qt() function))

Explanation / Answer

xbar = 35
s = 11
n = 50
se = s/sqrt(n)

a = qnorm(0.025,lower.tail=F)
# 95% confidence interval around the mean (using qnorm)
# lower limit and upper limit
xbar - (a * se)
xbar + (a * se)

b = qt(0.025,n-1,lower.tail=F)
# 95% confidence interval around the mean (using qt)
# lower limit and upper limit
xbar - (b * se)
xbar + (b * se)

c = qt(0.05,n-1,lower.tail=F)
# 90% confidence interval around the mean (using qt)
# lower limit and upper limit
xbar - (c * se)
xbar + (c * se)