Getting confidence intervals
Using confidence intervals allows us to estimate the interval range of unknown parameters in the data. In this recipe, we will teach you methods that can help obtain confidence intervals in R.
Getting ready
Ensure that you installed R on your operating system.
How to do it…
Perform the following steps to obtain confidence intervals:
- Let's first generate a normal distribution using the
rnorm
function:>set.seed(123) >population<- rnorm(1000, mean = 10, sd = 3) >plot(dens, col="red", main="A density plot of normal distribution")
- Next, we will sample 100 samples out of the population: ...
Get R for Data Science Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.