Learn R Programming

Mediana (version 1.0.3)

Test: 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 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.

References

http://gpaux.github.io/Mediana/

See Also

See Also AnalysisModel.

Examples

Run this code
# 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