Aan de slagGa gratis aan de slag

Testing sample size

In order to conduct a hypothesis test, and be sure that the result is fair, a sample must meet three requirements: it is a random sample of the population; the observations are independent; and there are enough observations. Of these, only the last condition is easily testable with code.

The minimum sample size depends on the type of hypothesis tests you want to perform. Let's test some scenarios on the late_shipments dataset.

late_shipments is available; dplyr is loaded.

Deze oefening maakt deel uit van de cursus

Hypothesis Testing in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Get counts by freight_cost_group
counts <- ___


# See the result
counts

# Inspect whether the counts are big enough
all(counts$n >= ___)
Code bewerken en uitvoeren