Learn R Programming

cg (version 1.0-2)

prepareCGOneFactorData: Prepare data object from a data frame for One Factor / One-Way / Unpaired Samples evaluations

Description

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

Usage

prepareCGOneFactorData(dfr, format = "listed", analysisname = "",
 endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL,
 addconstant = NULL, rightcensor = NULL, leftcensor = NULL, digits = NULL,
 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.
rightcensor
Optional, can be specified with a numeric value where any value equal to or greater will be regarded as right censored in the evaluation. The value of TRUE can be used to coerce a binary status variable in the data fra
leftcensor
Optional, can be specified with a numeric value where any value equal to or lesser will be regarded as left censored in the evaluation. The value of TRUE can be used to coerce a binary status variable in the data frame
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
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 cgOneFactorData 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.
  • fmt.dfruA list version of the input data frame, which will only differ from the dfr value if the input data frame was specified in the groupcolumns format.
  • has.censoredBoolean TRUE or FALSE on whether there are any censored data observations.
  • 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],[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. Venables, W. N., and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.

See Also

Surv, canine, gmcsfcens, prepare

Examples

Run this code
data(canine)
canine.data <- prepareCGOneFactorData(canine, format="groupcolumns",
                                      analysisname="Canine",
                                      endptname="Prostate Volume",
                                      endptunits=expression(plain(cm)^3),
                                      digits=1, logscale=TRUE, refgrp="CC")

## Censored Data
data(gmcsfcens)
gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns",
                                         analysisname="cytokine",
                                         endptname="GM-CSF (pg/ml)",
                                         logscale=TRUE)

Run the code above in your browser using DataLab