n_dist,Student-method {blindrecalc}R Documentation

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 'Student'
n_dist(
  design,
  n1,
  nuisance,
  summary = TRUE,
  plot = FALSE,
  iters = 10000,
  seed = NULL,
  range = 0,
  allocation = c("approximate", "exact"),
  ...
)

Arguments

design

Object of class Student created by setupStudent.

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 Student's t-test this is the variance.

summary

Is a summary of the sample size distribution desired? Otherwise, a vector with sample sizes is returned.

plot

Should a plot of the sample size distribution be drawn?

iters

Number of simulation iterations.

seed

Random seed for simulation.

range

determines how far the plot whiskers extend out from the box. If range is positive, the whiskers extend to the most extreme data point which is no more than range times the interquartile range from the box. A value of zero causes the whiskers to extend to the data extremes.

allocation

Whether the allocation ratio should be preserved exactly (exact) or approximately (approximate).

...

Further optional arguments.

Details

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 <- setupStudent(alpha = .025, beta = .2, r = 1, delta = 3.5, delta_NI = 0,
                  alternative = "greater", n_max = 156)
n_dist(d, n1 = 20, nuisance = 5.5, summary = TRUE, plot = FALSE, seed = 2020)


[Package blindrecalc version 1.0.1 Index]