MulaiMulai sekarang secara gratis

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)\).

Latihan ini adalah bagian dari kursus

Practicing Statistics Interview Questions in R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

set.seed(123)

# Generate data points
data_points <- rnorm(___ = ___)

# Inspect the distribution
___(data_points)
Edit dan Jalankan Kode