CommencerCommencer gratuitement

Confidence interval

The confidence interval is a range in which we suspect the population's mean to land.

You may expect questions on confidence intervals if your future project touches behavioral or medical science, politics, or advertising.

In this exercise, you'll practice computing confidence intervals using the sleep dataset from the datasets package. The dataset contains data on the effect of two drugs on ten patients. The effect is measured as an increase in hours of sleep compared to control, which is stored in the extra column.

A confidence interval is stored in the conf.int component of an object created with t.test().

You can retrieve it like this:

t.test(x)$conf.int

Watch out! To run a t-test, your data needs to be normally distributed.

Cet exercice fait partie du cours

Practicing Statistics Interview Questions in R

Afficher le cours

Exercice interactif pratique

Passez de la théorie à la pratique avec l’un de nos exercices interactifs

Commencer l’exercice