Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

n_dist.ChiSquare

Distribution of the Sample Size


Description

Calculates the distribution of the total sample sizes of designs with blinded sample size recalculation for different values of the nuisance parameter or of n1.

Usage

## S4 method for signature 'ChiSquare'
n_dist(
  design,
  n1,
  nuisance,
  summary = TRUE,
  plot = FALSE,
  allocation = c("exact", "approximate"),
  ...
)

Arguments

design

Object of class ChiSquare created by setupChiSquare.

n1

Either the sample size of the first stage (if recalculation = TRUE or the toal sample size (if recalculation = FALSE).

nuisance

Value of the nuisance parameter. For the Chi-Squared test this is the overall response rate.

summary

Logical. If TRUE (default) a summary of the sample size distribution is printed. If FALSE all sample sizes are printed.

plot

Should a plot of the sample size distribution be drawn?

allocation

Whether the allocation ratio should be preserved exactly (exact) or approximately (approximate or kf_approx). appproximate uses the unrounded calculated sample size in the sample size recalculation, kf_approx rounds the sample size to the next integer.

...

Further optional arguments.

Details

Only sample sizes that occur with a probability of at least 0.01 considered.

The method is only vectorized in either nuisance or n1.

Value

Summary and/or plot of the sample size distribution for every nuisance parameter and every value of n1.

Examples

d <- setupChiSquare(alpha = 0.025, beta = 0.2, r = 1, delta = 0.2)
  n_dist(d, n1 = 20, nuisance = 0.25, summary = TRUE, plot = FALSE)

blindrecalc

Blinded Sample Size Recalculation

v0.1.2
MIT + file LICENSE
Authors
Lukas Baumann [aut], Maximilian Pilz [aut, cre], Institute of Medical Biometry and Informatics - University of Heidelberg [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.