The function `SampleSize.CondPoisson`

obtains the required sample size (length of surveillance) needed
to guarantee a desired statistical power for a pre-specified relative risk, when doing continuous sequential CMaxSPRT, using a Wald-type upper boundary,
which is flat with respect to the likelihood ratio function.

1 | ```
SampleSize.CondPoisson(cc,D=0,M=1,alpha=0.05,power=0.9,RR=2)
``` |

`cc` |
The total number of observed adverse events in the historical data. There is no default. |

`D` |
The minium number for the ratio |

`M` |
The minimum number of events needed before the null hypothesis can be rejected. The default value is M=1. A delayed start with |

`alpha` |
The significance level. It must be in the range (0,0.5]. The default value is alpha=0.05. |

`power` |
The target vector of overall statistical powers to detect an increased relative risk (RR). The default value is power=0.90. |

`RR` |
The target vector of relative risks to be detected with the requested vector of statistical powers. The default value is RR=2. |

When using the CMaxSPRT and the `CV.CondPoisson`

function to conduct continuous sequential analysis
for Poisson data and limited historical data, the null hypothesis is rejected when the log likelihood ratio
exceeds the predetermined critical value calculated by `CV.CondPoisson`

. The sequential analysis ends
without rejecting the null hypothesis when a predetermined upper limit on the sample size is reached, expressed
either in terms of the ratio of the cumulative person-time in the surveillance population divided by the total
cumulative person-time in historical data (StopType="Tal"), or in terms of the observed number of events in the
surveillance population (StopType="Cases"). For example, the sequential analysis may end as soon as the sample size
is such that the cumulative person-time in the surveillance population is twice the cumulative person-time in historical data,
or there are 50 observed events in the surveillance population. The function `SampleSize.CondPoisson`

calculates what
the upper limit on the sample size (length of surveillance) that is required for the continuous CMaxSPRT to achieve the desired
statistical power for a pre-specified relative risk RR. It outputs the upper limit on sample size for both definitions of the
surveillance length, one expressed in terms of the ratio of the cumulative person-time in the surveillance population divided by
the total cumulative person-time in historical data (*T*), and the other one expressed in terms of the observed number of
events in the surveillance population (*K*). To save computing time, the liberal computation approach proposed by Silva et al. (2016)
is used in `SampleSize.CondPoisson`

to find the solution.

`SampleSize_by_RR_Power` |
A table containing the main performance measures associated to the required samples sizes, expressed in the scale of the number of events in the surveillance period, for each combination of RR and power. |

Development of the `SampleSize.CondPoisson`

function was funded by:

- National Institute of General Medical Sciences, NIH, USA, through grant number R01GM108999 (v2.0.1, v2.0.2).
- Foundation for Research Support of Minas Gerais State (FAPEMIG), MG, Brazil, through the grant Demanda Universal.

`CV.CondPoisson`

: calculating the critical value for continuous CMaxSPRT.

`Performance.CondPoisson`

: calculating the statistical power, expected time to signal and expected time of analysis for continuous CMaxSPRT.

Ivair Ramos Silva, Lingling Li

Li L, Kulldorff M. (2010). A conditional maximized sequential probability ratio test for pharmacovigilance. Statistics in Medicine, 30;29(2):284-95.

Silva IR, Li L, Kulldorff M. (2016). Exact Conditional Sequential Testing for Poisson Data. Working paper.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
# Sample size required to obtain a power of 90%, for a relative risk of 1.5,
# no delay for starting the surveilla# nce (D=0), under an alpha level of 5%,
# with 5 events in the historical data.
# res<- SampleSize.CondPoisson(cc=50,D=0,M=1,alpha=0.05,power=0.9,RR=2)
# If we write:
# res
# then we get:
# $K
# [1] 66
# $Tal
# [1] 0.7890625
# $cv
# [1] 3.626436
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.