In: Statistics and Probability
Please do in Rstudio
**4) Find an 80% confidence interval for the mean number of hands
it takes to win a game of cards. "Cards" is a sample of the number
of hands it took to win a game at a tournament in Preston
Idaho**
```{r}
Cards<-c(18,10,10,12,13,16,17,14,15,10,13,16,18,19,19,18,16,15,13,14,19,12,11,11,15,13,10,19,15)
###Please do your work here###
##############################
```
**How would you interpret this confidence interval? Please type your answer on the line below**
Answer:
Formula for finding confidence interval -
Code for finding confidence interval with output :
>
Cards<-c(18,10,10,12,13,16,17,14,15,10,13,16,18,19,19,18,16,15,13,14,19,12,11,11,15,13,10,19,15)
> m<-mean(Cards)
> m
[1] 14.51724
> n<-length(Cards)
> n
[1] 29
> sd2 <- sqrt(sum((Cards - mean(Cards))^2) / (n - 1))
> sd2
[1] 3.042798
> sd=sqrt(sd2)
> sd
[1] 1.744362
> marginoferror <- qt(0.9,df=n-1)*sd/sqrt(n)
> left <- m-marginoferror
> right <- m+marginoferror
> left
[1] 14.09209
> right
[1] 14.94239
Therefore, Lower confidence interval = 14.09209
Upper confidence interval = 14.94239.
Interpretation: There is 80% chance that this confidence interval contains the true population mean(µ).