Statistics, R-Studio
According to a report by the Consumer Federation of America, National Credit Union Foundation, and the Credit Union National Association, households with negative assets carried an average of $15,528 in debt in 2002 (CBS.MarketWatch.com, May 14, 2002). Assume that this mean was based on a random sample of 400 households and that the standard deviation of debts for households in this sample was $4200. Make a 99% confidence interval for the 2002 mean debt for all such households
Use Rstudio to plot a graph of this distribution with a 99% confidence interval.
n=400
Sample mean,
Sample standard deviation,
The 99% confidence interval of mean is given by
Lower limit = 14987.08
Upper limit = 16068.92
In R, we can find the 99% confidence interval and also plot the normal curve as below:
R-code:
sample.mean=15528
sample.sd=4200
n=400
standard.error=sample.sd/sqrt(400)
standard.error
lower.limit.99CI=sample.mean-qnorm(0.995)*standard.error
lower.limit.99CI
upper.limit.99CI=sample.mean+qnorm(0.995)*standard.error
upper.limit.99CI
curve(dnorm(x,sample.mean,standard.error),xaxt="n",14898,16158,ylab="",xlab="Average
Dept in 2002")
abline(v=sample.mean)
abline(v=lower.limit.99CI)
abline(v=upper.limit.99CI)
axis(1,at=c(lower.limit.99CI,sample.mean,upper.limit.99CI),labels=c("99%
CI lower bound","Sample mean","99% CI upper bound"))
text(sample.mean,0.001,"15528")
text(lower.limit.99CI,0.001,"14987.08")
text(upper.limit.99CI,0.001,"16068.92")
Get Answers For Free
Most questions answered within 1 hours.