Learn R Programming

RSPS (version 1.0)

sample.plot: Provides plot of Estimated sample size vs power

Description

This function plots the Estimated sample size vs power computed using function poiss.pow or negbin.pow for different fold changes. Please see example on how to use it.

Usage

sample.plot(fit, ylim = c(-0.05, 1.05), cutoff = 0.8)

Arguments

fit
Function used to estimate the sample size. See example.
ylim
Limits of y-axis
cutoff
Cutoff value for power

Details

This function can only be run if the function poiss.samp or negbin.samp has been used. If a vector of type I error, null count, and overdispersion (for negbin.pow) is provided the plot is based on the smalles of these values.

References

None

See Also

xyplot

Examples

Run this code
power = seq(0.5,0.9,0.05);lambda1=3;k=seq(2,3,1);
alpha=0.05;seed = 20;numsim=100
sample.poiss <- poiss.samp(power,lambda1,k,alpha,seed,numsim)
sample.plot(sample.poiss,cutoff=c(0.8,0.9))
# Another example (takes longer to run)
#power = seq(0.5,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.plot(sample.poiss,cutoff=c(0.8,0.9))

Run the code above in your browser using DataLab