Exercise

# Confidence interval and significance testing

Do you remember how to calculate confidence intervals? If not, let's shortly recap this. You can calculate a confidence interval, say a 95% confidence interval, by taking the mean and adding and subtracting its standard error multiplied by the given t value or z value. Usually confidence intervals are expressed as a two-sided range as we will also do in this exercise.

A 95% confidence intervals can be interpreted as that we are 95% confident that this interval will contain our population statistic. Take our last example where we found a standard error of 0.71, a population mean of 185, and a sample mean of 186.5. As the sample size was 50, our relevant degrees of freedom were 49.

Instructions

**100 XP**

- Calculate the associated t value with a 95% confidence interval, round it to two digits and store it in the variable
`t_value`

. Be aware of the fact that this is similar to a two-way hypothesis testing and you need to consider areas in both tails so you will need to use the 97.5 or a 2.5 percentile. - Calculate the 95% confidence interval, round the lower and upper value of the confidence interval to two digits and store it in a variable called
`conf_interval`

- Print the variabe
`conf_interval`

to the console.