Sample from normal distribution
The normal distribution is a frequent topic during interviews due to the vast applications of this distribution.
A random sample is a set of observed items from the whole population. You can make inferences about the population based on a random sample taken from the population. For example, you can calculate the sample probability which is an estimate of the population's true probability.
To compute the sample probability, calculate the proportion of the observations in a sample that meet the given criteria.
To compute the true probability, use probability functions.
Recall that:
- the standard normal distribution has \(\mu = 0\) and \(\sigma^2 = 1\) (referred to as \(N(0, 1)\)),
pnorm(q = k)
returns \(P(X \le k)\) for \(X \sim N(0, 1)\).
Este ejercicio forma parte del curso
Practicing Statistics Interview Questions in R
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
set.seed(123)
# Generate data points
data_points <- rnorm(___ = ___)
# Inspect the distribution
___(data_points)