Session Ready
Exercise

Sample size and treatment difference

The clinician is unsure of the expected treatment difference but believes it would be between 0.5 and 2.0. Using 80% power and standard deviation of 3, provide them with a set of sample sizes required for this range of differences as a table and in a plot.

The ggplot2 library has been loaded for this session.

Instructions
100 XP
  • Generate a vector, delta, containing values between 0.5 and 2.0, incrementing by 0.25.
  • Use a for loop to generate the sample sizes for each of the treatment differences.
  • Put the treatment differences and resulting sample sizes in a data frame.
  • Use ggplot() to display the treatment differences and sample sizes.