Test {Mediana} | R Documentation |
Test object
Description
This function creates an object of class Test
which can be added to an object of class AnalysisModel
.
Usage
Test(id, method, samples, par = NULL)
Arguments
id |
defines the ID of the Test object. |
method |
defines the method of the Test object. |
samples |
defines a list of samples defined in the data model to be used within the selected Test object method. |
par |
defines the parameter(s) of the selected Test object method. |
Details
Objects of class 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 thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
TTestNI
: perform a non-inferiority two-sample t-test between the two samples defined in thesamples
argument. Required parameter:margin
. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)).Two samples must be defined. -
WilcoxTest
: perform a Wilcoxon-Mann-Whitney test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)).Two samples must be defined. -
PropTest
: perform a two-sample test for proportions between the two samples defined in thesamples
argument. Optional parameter:yates
(Yates' continuity correctionTRUE
orFALSE
) andlarger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
PropTestNI
: perform a non-inferiority two-sample test for proportions between the two samples defined in thesamples
argument. Required parameter:margin
. Optional parameter:yates
(Yates' continuity correctionTRUE
orFALSE
) andlarger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
FisherTest
: perform a Fisher exact test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
GLMPoissonTest
: perform a Poisson regression test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
GLMNegBinomTest
: perform a Negative-binomial regression test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)).Two samples must be defined. -
LogrankTest
: perform a Log-rank test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined. -
OrdinalLogisticRegTest
: perform an Ordinal logistic regression test between the two samples defined in thesamples
argument. Optional parameter:larger
(Larger value is expected in the second sample (TRUE
orFALSE
)). Two samples must be defined.
It is to be noted that the statistical tests implemented are one-sided and thus the sample order in the samples argument is important. In particular, the Mediana package assumes by default that a numerically larger value of the endpoint is expected in Sample 2 compared to Sample 1. Suppose, for example, that a higher treatment response indicates a beneficial effect (e.g., higher improvement rate). In this case Sample 1 should include control patients whereas Sample 2 should include patients allocated to the experimental treatment arm. The sample order needs to be reversed if a beneficial treatment effect is associated with a lower value of the endpoint (e.g., lower blood pressure), or alternatively (from version 1.0.6), the optional parameters larger
must be set to FALSE
to indicate that a larger value is expected on the first Sample.
References
http://gpaux.github.io/Mediana/
See Also
See Also AnalysisModel
.
Examples
# Analysis model
analysis.model = AnalysisModel() +
Test(id = "Placebo vs treatment",
samples = samples("Placebo", "Treatment"),
method = "TTest")