The function AnalyzeRegression.CondPoisson performs continuous or group MaxSPRT regression analysis for conditional Poisson data based on the method
proposed by Silva et al.(2025).
It can also be used for mixed continuous-group sequential analysis where some data arrives continuously while other data arrives in groups.
Unlike CV.CondPoisson, there is (i) no need to pre-specify the
group sizes before the sequential analysis starts, (ii) a variety of alpha spending functions are available, and (iii) it is possible to include an offset term where,
under the null hypothesis, different observations have different Poisson person-time ratios between the surveillance and the historical information.
In sequential analysis, data is formed by cumulative information, collected in separated chunks or groups, which are observed at different moments in time. AnalyzeRegression.CondPoisson
is run each time a new group of data arrives at which time a new sequential test is conducted. When running AnalyzeRegression.CondPoisson, only the data from the new group should be
included when calling the function. The prior data has been stored, and it will be automatically retrieved by AnalyzeRegression.CondPoisson, with no need to reenter that data. Before
running AnalyzeRegression.CondPoisson for the first time, it is necessary to set up the sequential analysis using the AnalyzeSetUpRegression.CondPoisson function, which is run once,
and just once, to define the sequential analysis parameters. For information about this, see the description of the AnalyzeSetUpRegression.CondPoisson function.
The function AnalyzeRegression.CondPoisson calculates critical values to determine if the null hypothesis should be rejected or not at each analysis.
Critical values are given by the value of the AlphaSpending function, and the test statistic is the Monte Carlo p-value calculated as proposed by Silva et al.(2025).
This way, the null hypothesis H0:RR<= R0, where R0 is the testing margin given by the analyst in the AnalyzeSetUpRegression.CondPoisson,
and RR is the true unknow relative risk to test.
After each test, the function also provides information about the amount of alpha that has been spent,
the cumulative number of cases and controls, regression coefficient estimates, confidence intervals,
and the maximum likelihood estimate of the relative risk per stratum of individuals observed during the
sequential analysis.
Before running AnalyzeRegression.CondPoisson, it is necessary to specify a planned default alpha spending function,
which is done using the AlphaSpendType parameter in the
AnalyzeSetUpRegression.CondPoisson function. The default alpha spending plan is the polynomial power-type alpha spending plan
parameterized with "rho=1". Different alpha spending plans can be obtained by selecting different values for rho (Silva et al, 2019).
In most cases, this pre-specified alpha spending function is used throughout the analysis, but if needed,
it is possible to override it at any or each of the sequential tests.
This is done using the AlphaSpend parameter in AnalyzeRegression.CondPoisson, which specifies the
maximum amount of alpha to spend up to and including the current test.
In this way, it is possible to use any
alpha spending function, and not only the power-type available in AnalyzeSetUpRegression.CondPoisson.
It means that the AlphaSpend parameter can be used to promote a flexible adaptive alpha spending plan that is not set in stone
before the sequential analysis starts. The only requirement is that for a particular test with a new group of data,
AlphaSpend must be decided before knowing the number of events in that group.
To ensure a statistically valid sequential analysis, AlphaSpend can only depend on the values of PersonTimeRatio. This is important.
The function AnalyzeRegression.CondPoisson is meant to perform the Poisson sequential analysis with a certain level of autonomy.
After running a test, the code offers a synthesis about
the general parameter settings, the main conclusions concerning the acceptance or rejection of the null hypothesis,
and the historical information from previous tests.
Observe that, because the Poisson distribution is discrete, the target alpha spending will rarely be reached. The actual alpha spending is then shown to facilitate
a realistic interpretation of the results.
The function AnalyzeRegression.CondPoisson was designed to instruct the user with minimal information about bugs from the code,
or about non-applicable parameter input usages. Some entries are not
applicable for the parameter inputs.