Learn R Programming

cg (version 1.0-2)

samplesizeGraph.cgPairedDifferenceSampleSizeTable: Graph estimated sample sizes from a cgPairedDifferenceSampleSizeTable object

Description

Creates a graph to see estimated sample sizes in a cgPairedDifferenceSampleSizeTable object.

Usage

## S3 method for class 'cgPairedDifferenceSampleSizeTable':
samplesizeGraph(sstable, Nscale, mmdscale, \dots)

Arguments

sstable
A sample size object of class cgPairedDifferenceSampleSizeTable.
Nscale
A character indicating whether the left-hand side Y-axis, which shows the estimated sample sizes in terms of the number of experimental units, should be drawn on the log scale ("log") or the original scale ("
mmdscale
A character indicating whether the X-axis, which shows the minimum meaningful differences to be detected, should be drawn on the log scale ("log") or the original scale ("original").
...
Additional arguments. Two are currently valid: [object Object],[object Object],[object Object]

Value

  • samplesizeGraph.cgPairedDifferenceSampleSizeTable returns an invisible NULL. The main purpose is the side effect of graphing to the current device.

concept

sample size

Details

The minimum and maximum experimental unit sample size values are added inside the plot region in blue, flush against the y-axis in the top and bottom left corners. Tick marks are attempted to be chosen wisely. For log-scaled axes in particular, leading digits of 2, 5, and 10 for values are included if possible. Since the algorithm is empirical, the ticklabels argument is available for further refinement or complete replacement of tickmarks. The method essentially portrays in a graph the same information shown by the print method of the cgPairedDifferenceSampleSizeTable object.

See Also

cgPairedDifferenceSampleSizeTable

Examples

Run this code
data(anorexiaFT)
anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
                                                 analysisname="Anorexia FT",
                                                 endptname="Weight",
                                                 endptunits="lbs",
                                                 expunitname="Patient",
                                                 digits=1,
                                                 logscale=TRUE)
anorexiaFT.fit <- fit(anorexiaFT.data)

## The interest is in increased weight for the anorexia FT
## (family treatment) group of patients
anorexiaFT.samplesize <- samplesizeTable(anorexiaFT.fit, direction="increasing",
                         mmdvec=c(5, 10, 15, 20)) ## print method shows table

samplesizeGraph(anorexiaFT.samplesize)

samplesizeGraph(anorexiaFT.samplesize, nticklabels=list(mod="add", marks=3))

Run the code above in your browser using DataLab