Learn R Programming

cg (version 1.0-0)

prepareCGPairedDifferenceData: Prepare data object from a data frame for Paired Samples evaluations

Description

The function prepareCGPairedDifferenceData reads in a data frame and settings in order to create a cgPairedDifferenceData object. The created object is designed to have exploratory and fit methods applied to it.

Usage

prepareCGPairedDifferenceData(dfr, format = "listed", analysisname = "",
 endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL,
 addconstant = NULL, digits = NULL, expunitname= "",
 refgrp = NULL, stamps = FALSE)

Arguments

dfr
A valid data frame, see the format argument.
format
Default value of "listed". Either "listed" or "groupcolumns" must be used. Abbreviations of "l" or "g", respectively, or otherwise sufficient matching values can be used:
analysisname
Optional, a character text or math-valid expression that will be set for default use in graph title and table methods. The default value is the empty "".
endptname
Optional, a character text or math-valid expression that will be set for default use as the y-axis label of graph methods, and also used for table methods. The default value is the empty "".
endptunits
Optional, a character text or math-valid expression that can be used in combination with the endptname argument. Parentheses are automatically added to this input, which will be added to the end of the endptname character
logscale
Apply a log-transformation to the data for evaluations. The default value is TRUE.
zeroscore
Optional, replace response values of zero with a derived or specified numeric value, as an approach to overcome the presence of zeroes when evaluation in the logarithmic scale (logscale=TRUE) is specified. The def
addconstant
Optional, add a numeric constant to all response values, as an approach to overcome the presence of zeroes when evaluation in the logarithmic scale logscale=TRUE is desired. The default value is NULL.
digits
Optional, for output display purposes in graphs and table methods, values will be rounded to this numeric value. Only the integers of 0, 1, 2, 3, and 4 are accepted. No rounding is done during any calculations. The default value is
expunitname
Optional, a character text that will be set for default use as the experimental unit label of graph methods, and also used for table methods. The default value is the empty "".
refgrp
Optional, specify one of the factor levels to be the reference group, such as a control group. The default value is NULL, which will just use the first level determined in the data fra
stamps
Optional, specify a time stamp in graphs, along with cg package version identification. The default value is FALSE.

Value

  • A cgPairedDifferenceData object is returned, with the following slots:
  • dfrThe original input data frame that is the specified value of the dfr argument in the function call.
  • dfruProcessed version of the input data frame, which will be used for the various evaluation methods.
  • dfr.gcfmtA groupcolumns version of the input data frame with an additional column of the differences between groups, where the regfrp column of values is the subtrahend (second term) in the subtraction.
  • settingsA list of properties associated with the data frame: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Details

[object Object],[object Object],[object Object]

References

Tukey, J.W., Ciminera, J.L., and Heyse, J.F. (1985). "Testing the Statistical Certainty of a Response to Increasing Doses of a Drug," Biometrics, Volume 41, 295-301. Chambers, J.M, and Hastie, T.R. (1992), Statistical Modeling in S. Chapman&Hall/CRC.

See Also

prepare

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)

Run the code above in your browser using DataLab