Question

Please generalize ci95.t to ci.t so that we can calculate confidence interval at any confidence level...

  1. Please generalize ci95.t to ci.t so that we can calculate confidence interval at any confidence level given a sample using the KORGER.csv data

The function prototype looks like,

ci.t <- function(n, mu, sd_mu, conf)

{
            ##your code goes here

}

The sample outputs need to be replicated are,

setwd("…")

kg <- read.csv("KORGER.csv")

kd <- split(kg$Distance, kg$Team)$KOREA

n <- length(kd); m <- mean(kd); s <- sd(kd)/sqrt(n);

>ci.t(n, m, s, 0.95)

95%CILower 95%CIUpper

  8448.693 11307.852

>ci.t(n,m,s,0.90)

90%CILower 90%CIUpper

  8715.393 11041.152

>ci.t(n,m,s,0.99)

99%CILower 99%CIUpper

  7844.859 11911.686

I've got this so far.....

kg <- read.csv("KORGER.csv")
kd <- split(kg$Distance, kg$Team)$KOREA

n <- length(kd); m <- mean(kd); s <- sd(kd)/sqrt(n);

ci.t <- function(n, mu, sd_mu)
{
   lower <- round(mu - qt(0.975, n-1)*sd_mu, 3);
   upper <- round(mu + qt(0.975, n-1)*sd_mu, 3);
   ci <- c(1,lower,1,upper)
   names(ci) <- c("%CILower ","%CIUpper")
   ci
  
}
ci.t(n,m,s,0.95)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The Central Limit Theorem states that the sampling distribution of the sample means approaches a normal distribution the sample size gets larger — no matter what the shape of the population distribution. This fact holds especially true for sample sizes over 30. All this is saying is that as you take more samples, especially large ones, your graph of the sample means will look more like a normal distribution.

An essential component of the Central Limit Theorem is that the average of your sample means will be the population mean. Similarly, if you find the average of all of the standard deviations in your sample, you’ll find the actual standard deviation for your population.

Thus

Using the CLT, the required distribution is approximately Normally distributed. Furthermore,

  • The mean of the distribution is = 54 months
  • The standard deviation is

b) Assuming that the scientist’s claim is true, what the probability the audit group’s sample has a mean life of 52 or fewer months?

If the population standard deviation is known, we can transform the sample mean to an approximately standard normal variable, z score, Z:

Thus, the probability that the audit group will observe the sample mean life of 52 or less is 0.0094. If the 50 tested animals do have a mean of 52 or fewer months, the audit group will have strong evidence that the scientist's claim is untrue because the chance of that happening is very small.

R code for plotting and calculating probability

mean=54; sd=0.85
ub = 52;
x <- seq(-4,4,length=36)*sd + mean
hx <- dnorm(x,mean,sd)
plot(x, hx, type="n", xlab="Lifespan", ylab="",
main="Normal Distribution", axes=FALSE)
i <- x >= lb & x <= ub
lines(x, hx)
polygon(c(lb,x[i],ub), c(0,hx[i],0), col="red")

area <- pnorm(ub, mean, sd)
result <- paste("P("," X <=",ub,") =",
signif(area, digits=3))
mtext(result,3)
axis(1, at=seq(51.45, 56.55, 0.85), pos=0)

Add a comment
Know the answer?
Add Answer to:
Please generalize ci95.t to ci.t so that we can calculate confidence interval at any confidence level...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using techniques from Section 8.2, we can find a confidence interval for μd. Consider a random...

    Using techniques from Section 8.2, we can find a confidence interval for μd. Consider a random sample of n matched data pairs A, B. Let d = B − A be a random variable representing the difference between the values in a matched data pair. Compute the sample mean d of the differences and the sample standard deviation sd. If d has a normal distribution or is mound-shaped, or if n ≥ 30, then a confidence interval for μd is...

  • 13 points Previous Answers using techniques from an earlier section, we can find a confidence interval...

    13 points Previous Answers using techniques from an earlier section, we can find a confidence interval for He Consider a random confidence interval for pa is as follows 12 84 022 Notes Ask in a matched data pair. Compute the samgle mean d ot the dfferences and the sample standard deviation s hasnomal distribution er is mound-shaped, or tn 30, he or if n 2 30, then Ed E where E - c- confidence level (0 e1) te critical value...

  • Data Summaries Sample Mean Sample Std Dev Sample Size 79.998 11.588 1000 Hypothesis Testing Confidence Interval...

    Data Summaries Sample Mean Sample Std Dev Sample Size 79.998 11.588 1000 Hypothesis Testing Confidence Interval Creation Level of Confidence: 95% Alpha (a) Value: 0.05 MOE 0.719 9 - MOE: 79.279 9 + MOE: 80.717 Confidence Interval Question What is the confidence interval telling you about the population parameter? Use the formula: df = n-1 Use the formula: (9-4_0)/(s/sqrt(n)) Degrees of Freedom: Alpha (a) Value: Test Statistic Value: Is your test statistic a z value or at value? P-Value Method...

  • can I get some help please? Problem 2. "Do you think we are prepared for another...

    can I get some help please? Problem 2. "Do you think we are prepared for another terrorist attack?" Public opinion pollsters report the results of such poll questions as the proportion who respond affirmatively (ie, they say YES) and a "margin of error." By "margin of error," they mean the quantity that is added to, and subtracted from, the point estimate to get the upper and lower confidence limits. Suppose that you work for such a pollster, and that you...

  • Please help me with Part G (1 point) A professional hockey player is about to become...

    Please help me with Part G (1 point) A professional hockey player is about to become a free-agent, meaning he can play for any team he wishes. Having taken Statistics 217 as a student at U of C, he knows how powerful statistics can be when making decisions when faced with uncertainty He wishes to use the statistical skills acquired during this Stat 217 days to see if the value of his free-agency contract depends on the length of the...

  • so i have my c++ code and ive been working on this for hours but i...

    so i have my c++ code and ive been working on this for hours but i cant get it to run im not allowed to use arrays. im not sure how to fix it thank you for the help our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses...

  • okay so here is my c++ code and the errors im really stuck on fixing what...

    okay so here is my c++ code and the errors im really stuck on fixing what i did wrong it seems to be the same repeated error our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses A your program should use a loop and your morse code printing...

  • All of the following questions are in relation to the following journal article which is available...

    All of the following questions are in relation to the following journal article which is available on Moodle: Parr CL, Magnus MC, Karlstad O, Holvik K, Lund-Blix NA, Jaugen M, et al. Vitamin A and D intake in pregnancy, infant supplementation and asthma development: the Norwegian Mother and Child Cohort. Am J Clin Nutr 2018:107:789-798 QUESTIONS: 1. State one hypothesis the author's proposed in the manuscript. 2. There is previous research that shows that adequate Vitamin A intake is required...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT