Test which can be added to an object of class AnalysisModel.
Test(id, method, samples, par = NULL)Test are used in objects of class AnalysisModel to define the statistical test to produce. Several objects of class Test can be added to an object of class AnalysisModel.method argument defines the statistical test method. Several methods are already implemented in the Mediana package (listed below, along with the required parameters to define in the par parameter):
TTest: perform a two-sample t-test between the two samples defined in the samples argument. Two samples must be defined.
TTestNI: perform a non-inferiority two-sample t-test between the two samples defined in the samples argument. Required parameter: margin. Two samples must be defined.
WilcoxTest: perform a Wilcoxon-Mann-Whitney test between the two samples defined in the samples argument. Two samples must be defined.
PropTest: perform a two-sample test for proportions between the two samples defined in the samples argument. Optional parameter: yates (Yates' continuity correction TRUE or FALSE). Two samples must be defined.
PropTestNI: perform a non-inferiority two-sample test for proportions between the two samples defined in the samples argument. Required parameter: margin. Optional parameter: yates (Yates' continuity correction TRUE or FALSE). Two samples must be defined.
FisherTest: perform a Fisher exact test between the two samples defined in the samples argument. Two samples must be defined.
GLMPoissonTest: perform a Poisson regression test between the two samples defined in the samples argument. Two samples must be defined.
GLMNegBinomTest: perform a Negative-binomial regression test between the two samples defined in the samples argument. Two samples must be defined.
LogrankTest: perform a Log-rank test between the two samples defined in the samples argument. Two samples must be defined.
It is to be noted that the statistical tests implemented are one-sided.
AnalysisModel.
# Analysis model
analysis.model = AnalysisModel() +
Test(id = "Placebo vs treatment",
samples = samples("Placebo", "Treatment"),
method = "TTest")
Run the code above in your browser using DataLab