LoslegenKostenlos loslegen

Determine the ideal sample size

When running an experiment and statistical analyses of any sort, sample size is an important consideration. A sample size that is too small will not reveal an effect, regardless of if there is an effect present to be found. Prior to collecting data, a power analysis can be run to determine the minimum sample size that must be collected to effectively detect an effect, dependent on the analysis that will be performed on the collected data.

Perform a one sample t-test, one group, on experimental data and need to determine the sample size required for a one sample t-test to achieve a large effect size and power with an alpha of 0.05.

Diese Übung ist Teil des Kurses

A/B Testing in R

Kurs anzeigen

Anleitung zur Übung

  • Load the pwr package needed to run a power analysis for the one sample t-test.
  • Use pwr.t.test() to determine the sample size needed for a two-tailed, one sample t-test with an effect size of 0.8, power of 0.9, and significance of 0.05.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Load the `pwr` package
___

# Determine the sample size needed for a one sample t-test
___(d = ___, power = ___, sig.level = ___, type = ___, alternative = ___)
Code bearbeiten und ausführen