Learn R Programming

RSPS (version 1.0)

poiss.samp: Estimates sample sizes for desired power using simulation from Poisson distribution

Description

The function provides estimate of sample size for given power when there is over-dispersion. The data is simulated from Poisson distribution.

Usage

poiss.samp(power, lambda1, k, alpha, seed, numsim, sig)

Arguments

power
A vector of values between 0 and 1 representing desired power.
lambda1
Mean count under the null distribution. It can be a vector.
k
Fold change desired under the alternative distribution. It can be a vector.
alpha
Type I error rate: a value between 0 and 1. It can be a vector.
seed
Value of seed to ensure reproducibility of results.
numsim
Number of simulations. 1000 is recommended.
sig
Number of significant digits after decimal.

Value

Power.Expected
Desired Power.
Mean.Null
Mean Count under Null distribution.
Effect.Size
Fold Change Under the alternate hypothesis.
N.est
Estimated sample size.
Power.est
Estimated Power.
Std.Err
Standard Error.

Details

The test statistic used is the scaled difference. Please contact the authors for more details on algorithm.

References

None

See Also

rpois

Examples

Run this code
power = c(0.7,0.8);lambda1=3;k=seq(2,3,0.5);
alpha=0.01;seed = 20;numsim=100
sample.poiss <- poiss.samp(power,lambda1,k,alpha,seed,numsim)
sample.poiss
# Another example (takes longer to run)
#power = seq(0.7,0.9,0.05);lambda1=3;k=seq(2,3,0.5);
#alpha=0.005;seed = 20;numsim=1000
#sample.poiss <- poiss.samp(power,lambda1,k,alpha,seed,numsim)
#sample.poiss

Run the code above in your browser using DataLab