Title: | Compare Groups, Analytically and Graphically |
---|---|
Description: | Comprehensive data analysis software, and the name "cg" stands for "compare groups." Its genesis and evolution are driven by common needs to compare administrations, conditions, etc. in medicine research and development. The current version provides comparisons of unpaired samples, i.e. a linear model with one factor of at least two levels. It also provides comparisons of two paired samples. Good data graphs, modern statistical methods, and useful displays of results are emphasized. |
Authors: | Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb] |
Maintainer: | Bill Pikounis <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 1.0-3 |
Built: | 2024-11-03 06:45:40 UTC |
Source: | CRAN |
cg is comprehensive data analysis software, and stands for "compare groups." Its genesis and evolution are driven by common needs to compare administrations, conditions, etc. in medicine research and development. The current version provides comparisons of unpaired samples, i.e. a linear model with one factor of at least two levels. It also provides comparisons of two paired samples. Good data graphs, modern statistical methods, and useful displays of results are emphasized.
Package: cg
Type: Package
Version: 1.0-3
Date: 2016-01-05
License: GPL (>= 2)
LazyLoad: yes
LazyData: yes
Depends: R (>= 3.2.3), Hmisc (>= 3.17-1)
Imports: VGAM (>= 1.0-0), methods, grDevices, graphics, stats, utils, grid, MASS, lattice, survival, multcomp, nlme, rms
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Maintainer: Bill Pikounis <[email protected]>
Pikounis, B. and Oleynick, J. (2013). "The cg Package for Comparison of Groups", Journal of Statistical Software, Volume 52, Issue 1, 1-27, http://www.jstatsoft.org/v52/i01/.
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## Exploratory methods pointGraph(canine.data) boxplot(canine.data) descriptiveTable(canine.data) ## Fits and Comparisons canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) errorBarGraph(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") comparisonsGraph(canine.comps1) grpSummaryTable(canine.fit) ## Diagnostics varianceGraph(canine.fit) qqGraph(canine.fit) downweightedTable(canine.fit, cutoff=0.95) ## Sample Size calculations canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize) ## Censored Data Set data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data) boxplot(gmcsfcens.data) descriptiveTable(gmcsfcens.data) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") ## Paired Samples data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Exploratory methods descriptiveTable(anorexiaFT.data) profileGraph(anorexiaFT.data) diffGraph(anorexiaFT.data) ## Fits and Comparisons anorexiaFT.fit <- fit(anorexiaFT.data) comparisonsTable(anorexiaFT.fit)
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## Exploratory methods pointGraph(canine.data) boxplot(canine.data) descriptiveTable(canine.data) ## Fits and Comparisons canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) errorBarGraph(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") comparisonsGraph(canine.comps1) grpSummaryTable(canine.fit) ## Diagnostics varianceGraph(canine.fit) qqGraph(canine.fit) downweightedTable(canine.fit, cutoff=0.95) ## Sample Size calculations canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize) ## Censored Data Set data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data) boxplot(gmcsfcens.data) descriptiveTable(gmcsfcens.data) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") ## Paired Samples data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Exploratory methods descriptiveTable(anorexiaFT.data) profileGraph(anorexiaFT.data) diffGraph(anorexiaFT.data) ## Fits and Comparisons anorexiaFT.fit <- fit(anorexiaFT.data) comparisonsTable(anorexiaFT.fit)
A data frame used to illustrate the cg package. It has a Paired Samples / Paired Difference layout.
data(anorexiaFT)
data(anorexiaFT)
A 17-by-2 data frame from an study of young female anorexia
patients. It is a subset of the anorexia
data frame
included in the MASS package. Out of the three groups there,
only the factor level FT
group makes up the anorexiaFT
data frame. The endpoint is Weight in pounds (lbs), FT
represents "Family Therapy" treament, and the paired levels are
PreWt
Patient weight before treatment
PostWt
Patient weight after treatment
See anorexia
in the MASS package for additional description.
The anorexiaFT
data set that comes with the cg package
is in groupcolumns
format for theprepareCGPairedDifferenceData
call. Each column
represents a group, and each row represents an individual patient, or
experimental unit. Each observation in a row that spans the two group
columns are paired individual response or outcome values.
The purpose of the study was to evaluate effects of multiple treatments on weight as a marker for anorexia, and to compare their relative effectiveness.
See anorexia
in the MASS package for
references and more details.
Contact [email protected] for bug reports, questions, concerns, and comments.
anorexia
, prepareCGPairedDifferenceData
data(anorexiaFT) str(anorexiaFT)
data(anorexiaFT) str(anorexiaFT)
Create graph of boxplots of groups in a cgOneFactorData
object.
## S4 method for signature 'cgOneFactorData' boxplot(x, ...)
## S4 method for signature 'cgOneFactorData' boxplot(x, ...)
x |
A |
... |
Additional arguments, both optional. Two are currently valid:
|
For uncensored data, the boxplot for each group produced is a standard boxplot,
similar to that produced by
graphics::boxplot.default
,
but with the median shown as a "+" and the mean shown as a "o". A
warning is added to the plot if any of the groups or all of the groups
have 5 or fewer observations (in which case a plot from
pointGraph.cgOneFactorData
might be more suitable).
For censored data, Kaplan-Meier estimates are used for the quantiles, as
proposed by Gentleman and Crowley (1991). The survival::survfit
conventions are followed for interpolation of these quantiles.
Extreme values that are censored
are drawn as open arrow heads rather than open circles.
Left-censored values are shown as a shallow "V",
which is actually just a rotated downward ">" sign. Similarly, right-censored
values are shown as a deeper "^", which is a actually just a rotated upward ">" sign.
Individual points are jitter
ed, and open circles
are used for complete observations
to alleviate potential overlap and the danger of representing
multiple points as a single point. Individual censored values are
similarly jittered.
With enough censored data
observations in a group, certain quantiles may not be estimable, and
thus a complete box would not appear.
If logscale=TRUE
, the tick marks for the y-axis
on the left side of the plot show original values, while the
ticks mark for the y-axis on the right side of the graph
show base 10 log values.
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 heading for the graph is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its analysisname
argument.
The label for the y-axis is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its endptname
argument.
The number of decimal places printed in the ticks on the y-axis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
The minimum and maximum values from the range of the data are respectively labeled in the bottom and top left corners of the graph region.
If group labels along the x-axis seem to overlap in the standard horizontal form, they will be rotated 45 degrees.
boxplot.cgOneFactorData
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Gentleman, R.C. and Crowley, J. (1991). "Graphical Methods for Censored Data", Journal of the American Statistical Association, Volume 86, 678-683.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") boxplot(canine.data) ## Plot the data on the original scale instead of the log scale boxplot(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) boxplot(gmcsfcens.data)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") boxplot(canine.data) ## Plot the data on the original scale instead of the log scale boxplot(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) boxplot(gmcsfcens.data)
A data frame used to illustrate the cg package. It has a One Factor / One-Way / Unpaired Samples layout.
data(canine)
data(canine)
A 5-by-5 data frame with 5 numeric observations from an experiment on the following 5 groups of beagle dogs.
AE
castration plus estradiol and androstanediol
E1
castration plus low dose estradiol
E2
castration plus high dose estradiol
CC
castration alone
NC
no castration (normal controls)
The canine
data set that comes with the cg package
is in groupcolumns
format for theprepareCGOneFactorData
call. Each column represents a group, and
the observations in that group's column are the individual response or
outcome values.
The 5 groups are regarded as levels of one factor in the
prepareCGOneFactorData
, fit
, and other methods in
the cg package.
An alternative format of this data set is contained in
canine.listfmt
. See that help file for details,
including how it would be read and prepare
d by cg.
The purpose of this experiment was to evaluate the effect of a physiological dose of estradiol on prostate growth in dogs using ultrasound. See the reference below for details. Comparisons amongst all five groups are of interest.
Contact [email protected] for bug reports, questions, concerns, and comments.
Rhodes, L., Ding, V.D.H., Kemp, R.K., Khan, M.S., Nakhla, A.M., Pikounis, B., Rosner, W., Saunders, H.M. and Feeney, W.P. (2000). "Estradiol causes a dose dependent stimulation of prostate growth in castrate beagle dogs." The Prostate, Volume 44, 8-18.
canine.listfmt
, prepareCGOneFactorData
data(canine) str(canine)
data(canine) str(canine)
A data frame used to illustrate the cg package. It has a One Factor / One-Way / Unpaired Samples layout.
data(canine.listfmt)
data(canine.listfmt)
A 25-by-2 data frame with 5 numeric observations from an experiment on each of the following 5 groups of beagle dogs.
AE
castration plus estradiol and androstanediol
E1
castration plus low dose estradiol
E2
castration plus high dose estradiol
CC
castration alone
NC
no castration (normal controls)
The above 5 items are the levels of the first column's factor, named
grp
. The second column size
contains the numeric observations.
The canine.listfmt
data set that comes with the cg package
is in listed
format for theprepareCGOneFactorData
call.
The 5 groups are regarded as levels of one factor in the
prepareCGOneFactorData
, fit
, and other methods in
the cg package.
canine.listfmt
is an alternative format of the
canine
data set. See that help file for details. Once
the data set is prepare
d into a
cgOneFactorData
object, all the subsequent methods work
on the object in the same way.
The purpose of this experiment was to evaluate the effect of a physiological dose of estradiol on prostate growth in dogs using ultrasound. See the reference below for details. Comparisons amongst all five groups are of interest.
Contact [email protected] for bug reports, questions, concerns, and comments.
Rhodes, L., Ding, V.D.H., Kemp, R.K., Khan, M.S., Nakhla, A.M., Pikounis, B., Rosner, W., Saunders, H.M. and Feeney, W.P. (2000). "Estradiol causes a dose dependent stimulation of prostate growth in castrate beagle dogs." The Prostate, Volume 44, 8-18.
canine
, prepareCGOneFactorData
data(canine.listfmt) str(canine.listfmt) ## Analogous to prepareCGOneFactorData call on canine data frame format, ## subsequent methods will work for canine.listfmt.data: canine.listfmt.data <- prepareCGOneFactorData(canine.listfmt, format="listed", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## as they do on canine.data: canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC")
data(canine.listfmt) str(canine.listfmt) ## Analogous to prepareCGOneFactorData call on canine data frame format, ## subsequent methods will work for canine.listfmt.data: canine.listfmt.data <- prepareCGOneFactorData(canine.listfmt, format="listed", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## as they do on canine.data: canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC")
cg package Internal Virtual Classes designed for polymorphic slots
The virtual classes
characterOrExpression
characterOrNULL
dataframeMatrixOrNULL
dataframeOrNULL
numericOrNULL
olsfit
rrfit
aftfit
uvfit
are used internally by the cg package, and designed as polymorphic slots.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cg package Internal Utility functions and objects not intended for user-level calls
The functions
stndErr
geoMean
pctToRatio
makeZeroScore
unwind
unwrap
graphStampCG
setupAxisTicks
setupLog10AxisTicks
tryAgain
seeHelpFile
paragraphWrap
cgMessage
factorInSeq
setupGrpNameTicks
xTicksCex
yTicksCex
rmTicks
minmaxTicks
plotGrpNameTicks
boxplotStamp
errorBarGraphStamp
comparisonsGraphStamp
errorBarGraphApproximateStamp
trimWhiteSpace
chopZeroes
fmtRatioToPercent
fmtDifference
fmtRatio
fmtPercent
fmtPvalue
cgDevice
contrastMatrix
blockDiag
rangeExtend
getNumDigits
makeCensored
multcompInform
multcompDone
isAllEqual
makeEndptLabel
catCharExpr
residualgrptrend.helper
fround
fround.charcens
chop.matrix
stripmiss
makeTickMarks
scaleVar
makeContrastVec
cg.largest.empty
qminmin
unpaste
grpsummary
samplesize
samplesizegraph
boxplotcensoreddata
descriptive.censoreddata
pairwisecompsmatrix
are used internally by the cg package. See source code for details.
The blockDiag
function is adapted from a Ben Bolker
function contribution on R-help in 2002.
The factorInSeq
function is exported since it may be useful for a
user. It is a simple wrapper around factor
with the order of its levels determined by first occurrence of each level in its
x
vector argument.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
A vector named cgLineColors
that assigns
colors to lines for graphing methods in the cg package.
cgLineColors
cgLineColors
A vector containing ten values in this order:
black blue green red orange brown yellow darkblue darkgreen
darkgray
This is a package internal convenience, and not intended for use or modification by the end user.
If more than ten values are needed then recycling will occur.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cg package Internal Validity functions not intended for user-level calls. These are used on input arguments for methods and functions.
validAlpha
validPower
validDataFormat
validBoolean
validCharacter
validNumeric
validNumericOrCensored
validList
validAtomicVec
validArgMatch
validDotsArg
validDotsArgs
getDotsArgName
parsePartialName
reportInvalidArg
validEqualLength
validArgMatch
validArgDigits
validArgModel
validCGOneFacGroupColDfr
validCGOneFacListedDfr
validCensor
validZeroScore
validAddConstant
validAft
validFitType
validErrorDf
validComparisonType
validEstimates
validGrpNames
validN
validCutoffWt
validDenDf
are used internally by the cg package.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Create a table of comparisons based on group estimates and variance-covariance matrix. Pairwise or custom specified contrasts are estimated and tested.
comparisons(estimates, varcovmatrix, errordf = Inf, endptscale, mcadjust = FALSE, alpha = 0.05, type = "pairwisereflect", contrastmatrix = NULL, n, offset = NULL, cnames = "derive", analysisname = "", endptname = "", digits = NULL, addpct = FALSE, display = "print")
comparisons(estimates, varcovmatrix, errordf = Inf, endptscale, mcadjust = FALSE, alpha = 0.05, type = "pairwisereflect", contrastmatrix = NULL, n, offset = NULL, cnames = "derive", analysisname = "", endptname = "", digits = NULL, addpct = FALSE, display = "print")
estimates |
A named vector of estimates. Each estimate element is a measure of the center of the group. The name of each group must be present in the names attribute of the vector. |
varcovmatrix |
The estimated variance-covariance matrix associated with the
|
errordf |
Can be one of three types of values:
|
endptscale |
Must be specified as |
mcadjust |
Do a multiple comparisons adjustment, based on the simultaneous
inference capabilities of the multcomp package. See Details
below. The default value is |
alpha |
Significance level, by default set to |
type |
Can be one of four values:
|
contrastmatrix |
Only relevant if |
n |
Needs to be specified only when
|
offset |
Optional,
If for example a numeric constant was added to all response values
before calculation of the |
cnames |
If the default value of |
analysisname |
Optional, a character text that will be
printed along with the results table. The default
value is the empty |
endptname |
Optional, a character text that will be
printed along with the results table. The default
value is the empty |
digits |
Optional, For output display purposes,
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
|
addpct |
Only relevant if |
display |
One of three valid values:
|
Only two-sided Wald-type of confidence intervals are possible with this function.
When mcadjust=TRUE
, a status message of
"Some time may be needed as the critical point "
"from the multcomp::summary.glht function call is calculated "
is displayed at the console. This computed critical point
is used for all subsequent p-value and confidence interval
calculations.
The multcomp package provides a unified way to calculate critical points based on the comparisons of interest in a "family." Thus a user does not need to worry about choosing amongst the myriad names of multiple comparison procedures.
Creates a return data frame object that specifies the comparison of the form A vs. B in each row, and with these columns:
estimate
The difference in group estimates in the
comparison: A vs. B. If endptscale="log"
,
this will be back-transformed to a percent
difference scale.
se
The estimated standard error of the difference
estimate
. If endptscale="log"
,
this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
lowerci
The lower 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If endptscale="log"
,
the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
upperci
The upper 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If endptscale="log"
,
the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
pval
The computed p-value from the test of the difference estimate
.
meanA
or geomeanA
The estimated "mean" for the left hand side "A" of the A
vs. B comparison. If endptscale="log"
,
this is a back-transform to the original scale,
and therefore is a "geometric" mean, and will be labelled
geomeanA
. Otherwise it is the arithmetic mean and labelled meanA
.
seA
The estimated standard error of the meanA
estimate
. If endptscale="log"
, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
meanB
or geomeanB
The estimated "mean" for the right hand side "B" of the A
vs. B comparison. If endptscale="log"
, this is a back-transform to the original scale,
and therefore is a "geometric" mean, and will be labelled
geomeanB
.
Otherwise it is the arithmetic mean and labelled meanB
.
seB
The estimated standard error of the meanB
estimate
. If endptscale="log"
, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
An additional column addpct
of percent differences is added if
endptscale=="original"
and addpct=TRUE
,
as a descriptive supplement to the original scale
differences that are formally estimated.
This function was created for internal use in the cg package as
its use can be seen in the comparisonsTable
methods
code. Therefore any direct use of it needs to be done cautiously.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and Schuetzenmeister, A. (2010). The multcomp package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Easier way: notice the comparisonsTable call comparisonsTable(canine.fit, model="olsonly") ## Manual way ## Instead of comparisonsTable(canine.fit, model="olsonly") comparisons(estimates=canine.fit@olsfit$coef, varcovmatrix=vcov(canine.fit@olsfit), errordf=canine.fit@olsfit$df.residual, endptscale="log", analysisname="Canine", digits=1, endptname="Prostate Volume")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Easier way: notice the comparisonsTable call comparisonsTable(canine.fit, model="olsonly") ## Manual way ## Instead of comparisonsTable(canine.fit, model="olsonly") comparisons(estimates=canine.fit@olsfit$coef, varcovmatrix=vcov(canine.fit@olsfit), errordf=canine.fit@olsfit$df.residual, endptscale="log", analysisname="Canine", digits=1, endptname="Prostate Volume")
Creates a graph to see comparisons based on group estimates and variance-covariance matrix
comparisonsgraph(compstable, difftype, analysisname = "", endptname = "", alpha = 0.05, digits = NULL, titlestamp = TRUE, explanation = TRUE, wraplength = 20, cex.comps = 0.7, ticklabels = NULL, ...)
comparisonsgraph(compstable, difftype, analysisname = "", endptname = "", alpha = 0.05, digits = NULL, titlestamp = TRUE, explanation = TRUE, wraplength = 20, cex.comps = 0.7, ticklabels = NULL, ...)
compstable |
A data frame object of form like that created by the |
difftype |
Must be specified as one of the following:
|
analysisname |
Optional, a character text or
math-valid expression that will used in the graph title. The default
value is the empty |
endptname |
Optional, a character text or math-valid expression
that that will be used as the x-axis label of the graph.
The default
value is the empty |
alpha |
Significance level, by default set to |
digits |
Optional, For output display purposes in the
graph,
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
|
explanation |
If |
titlestamp |
Specify text to the graph in the top of graph area,
otherwise a default description of "Comparisons Graph" and
|
wraplength |
On the left hand axis are each A vs. B comparison label
from the |
cex.comps |
Similar to |
ticklabels |
Optional, before graphing the data, remove any automatically generated tickmarks for the x-axis, and use these tickmarks instead. A vector of tickmarks to be placed on the x-axis. Any numeric representations will be coerced to character. |
... |
Additional arguments. None are currently used. |
The minimum and maximum values across all the bar ends
are added inside the plot region in
blue, flush against the x-axis. In two panel cases, there is a
tendency to fall outside the panel area even though right justified is
used for the adj
parameter of functions like panel.text
.
comparisonsgraph
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
This function was created for internal use in the cg package as
its use can be seen in the comparisonsGraph
methods
source code. Therefore any direct use of it needs to be done cautiously.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps <- comparisonsTable(canine.fit) ## Easier way: notice the camel-case of the comparisonsGraph call comparisonsGraph(canine.comps, model="olsonly") ## Manual way ## Instead of comparisonsGraph(canine.comps, model="olsonly") canine.compstable <- comparisons(estimates=canine.fit@olsfit$coef, varcovmatrix=vcov(canine.fit@olsfit), errordf=canine.fit@olsfit$df.residual, endptscale="log", analysisname="Canine", digits=1, endptname="Prostate Volume") comparisonsgraph(canine.compstable, difftype="percent", analysisname="Canine", digits=1, endptname=expression(paste( plain('Prostate Volume'), ' (', plain(cm)^3 , ')' )) )
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps <- comparisonsTable(canine.fit) ## Easier way: notice the camel-case of the comparisonsGraph call comparisonsGraph(canine.comps, model="olsonly") ## Manual way ## Instead of comparisonsGraph(canine.comps, model="olsonly") canine.compstable <- comparisons(estimates=canine.fit@olsfit$coef, varcovmatrix=vcov(canine.fit@olsfit), errordf=canine.fit@olsfit$df.residual, endptscale="log", analysisname="Canine", digits=1, endptname="Prostate Volume") comparisonsgraph(canine.compstable, difftype="percent", analysisname="Canine", digits=1, endptname=expression(paste( plain('Prostate Volume'), ' (', plain(cm)^3 , ')' )) )
Generic function to create a Comparisons Graph based on a Comparisons Table created in turn by the cg package.
comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength=20, cex.comps=0.7, ...)
comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength=20, cex.comps=0.7, ...)
compstable |
A |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
wraplength |
On the left hand vertical axis are each A vs. B comparison label
from the |
cex.comps |
Similar to |
... |
Additional arguments, depending on the specific method written for
the |
The main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
comparisonsGraph.cgOneFactorComparisonsTable
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") comparisonsGraph(canine.comps1)
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") comparisonsGraph(canine.comps1)
Creates a graph to see comparisons in a cgOneFactorComparisonsTable object
## S4 method for signature 'cgOneFactorComparisonsTable' comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength = 20, cex.comps = 0.7, ...)
## S4 method for signature 'cgOneFactorComparisonsTable' comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength = 20, cex.comps = 0.7, ...)
compstable |
A |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
wraplength |
On the left hand axis are each A vs. B comparison label
from the |
cex.comps |
Similar to |
... |
Additional arguments. Two are currently valid:
|
The minimum and maximum values across all the bar ends
are added inside the plot region in
blue, flush against the x-axis. In two panel cases, there is a
tendency to fall outside the panel area even though right justified is
used for the adj
parameter of functions like panel.text
.
The number of decimal places are determined by the
digits
and endptscale
values in the compstable@settings
slot.
comparisonsGraph.cgOneFactorComparisonsTable
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Comparisons Tables canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") ## Comparisons Graphs comparisonsGraph(canine.comps0) comparisonsGraph(canine.comps1) comparisonsGraph(canine.comps1, cex.comps=0.9, ticklabels=list(mod="add", marks=c(300, 700)))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Comparisons Tables canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") ## Comparisons Graphs comparisonsGraph(canine.comps0) comparisonsGraph(canine.comps1) comparisonsGraph(canine.comps1, cex.comps=0.9, ticklabels=list(mod="add", marks=c(300, 700)))
Creates a graph to see comparisons in a cgPairedDifferenceComparisonsTable object
## S4 method for signature 'cgPairedDifferenceComparisonsTable' comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength = 20, cex.comps = 0.7, ...)
## S4 method for signature 'cgPairedDifferenceComparisonsTable' comparisonsGraph(compstable, cgtheme=TRUE, device="single", wraplength = 20, cex.comps = 0.7, ...)
compstable |
A |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
wraplength |
On the left hand axis are each A vs. B comparison label
from the |
cex.comps |
Similar to |
... |
Additional arguments. Two are currently valid:
|
The minimum and maximum values across the bar ends
are added inside the plot region in blue, flush against the x-axis.
The number of decimal places are determined by the
digits
and endptscale
values in the compstable@settings
slot.
comparisonsGraph.cgPairedDifferenceComparisonsTable
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceComparisonsTable
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) anorexiaFT.comps0 <- comparisonsTable(anorexiaFT.fit) anorexiaFT.comps1 <- comparisonsTable(anorexiaFT.fit, model="olsonly", display="none") comparisonsGraph(anorexiaFT.comps0) comparisonsGraph(anorexiaFT.comps1)
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) anorexiaFT.comps0 <- comparisonsTable(anorexiaFT.fit) anorexiaFT.comps1 <- comparisonsTable(anorexiaFT.fit, model="olsonly", display="none") comparisonsGraph(anorexiaFT.comps0) comparisonsGraph(anorexiaFT.comps1)
Create a table of comparisons based on a fit by the cg package.
comparisonsTable(fit, type = "pairwisereflect", alpha = 0.05, addpct = FALSE, display = "print", ...)
comparisonsTable(fit, type = "pairwisereflect", alpha = 0.05, addpct = FALSE, display = "print", ...)
fit |
A fit object created with a |
type |
Can be one of four values:
|
alpha |
Significance level, by default set to |
addpct |
Only relevant if |
display |
One of three valid values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
A method-specific comparisonsTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
comparisonsTable.cgOneFactorFit
,
comparisonsTable.cgPairedDifferenceFit
.
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.comps <- comparisonsTable(gmcsfcens.fit) ## Paired Difference data 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) comparisonsTable(anorexiaFT.fit)
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.comps <- comparisonsTable(gmcsfcens.fit) ## Paired Difference data 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) comparisonsTable(anorexiaFT.fit)
Create a table of comparisons based on the cgOneFactorFit object. Pairwise or custom specified contrasts are estimated and tested. A cgOneFactorComparisonsTable class object is created.
## S4 method for signature 'cgOneFactorFit' comparisonsTable(fit, type="pairwisereflect", alpha=0.05, addpct=FALSE, display="print", ...)
## S4 method for signature 'cgOneFactorFit' comparisonsTable(fit, type="pairwisereflect", alpha=0.05, addpct=FALSE, display="print", ...)
fit |
An object of class |
type |
Can be one of four values:
|
alpha |
Significance level, by default set to |
addpct |
Only relevant if |
display |
One of three valid values:
|
... |
Additional arguments.
For other possible |
When mcadjust=TRUE
, a status message of "Some time may be
needed as the critical point"
"from the multcomp::summary.glht function
call is calculated"
is displayed at the console. This computed critical point
is used for all subsequent p-value and confidence interval
calculations.
The multcomp package provides a unified way to calculate critical points based on the comparisons of interest in a "family". Thus a user does not need to worry about choosing amongst the myriad names of multiple comparison procedures.
Creates an object of class cgOneFactorComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of the cgOneFactorFit
,
unless model="rronly"
is specified. In that case the slot
value is NULL
. Will not be appropriate in
the case where a valid aftfit
component is present in the
cgOneFactorFit
object. See below for the data frame structure
of the table.
rr.comprs
The table of comparisons based on the
rrfit
component of the cgOneFactorFit
object, if a valid resistant & robust fit object is present.
If rrfit
is a simple character value of
"No fit was selected."
, or model="olsonly"
was
specified, then the value is NULL
. See below for the data frame structure
of the table.
aft.comprs
The table of comparisons based on the
aftfit
component of the cgOneFactorFit
object if a valid accelerated failure time fit object is present.
If aftfit
is a simple character value of
"No fit was selected."
, then the value is NULL
.
See below for the data frame structure
of the table.
uv.comprs
The table of comparisons based on the
uvfit
component of the cgOneFactorFit
object if a valid unequal variances fit object is present.
The error degrees of freedom for each comparison estimate and
test is individually estimated
with a Satterthwaite approximation. See below for the data frame structure
of the table.
settings
A list of settings carried from the
cgOneFactorFit
fit
object, and the addition
of some specified arguments in the method call above: alpha
,
mcadjust
, type
, and addpct
. These are used
for the print.cgOneFactorComparisonsTable
method,
invoked for example when
display="print"
.
The data frame structure of the comparisons table in a *.comprs
slot consists of row.names
that specify the comparison of the
form A vs. B, and these columns:
estimate
The difference in group means in the
comparison: A vs. B. If settings$endptscale=="log"
in the
fit
object, this will be back-transformed to a percent
difference scale.
se
The estimated standard error of the difference
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
lowerci
The lower 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
upperci
The upper 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
pval
The computed p-value from the test of the difference estimate
.
meanA
or geomeanA
The estimated mean for the
left hand side "A" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a back-transform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanA
.
Otherwise it is the arithmetic mean and labelled meanA
.
seA
The estimated standard error of the meanA
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
meanB
or geomeanB
The estimated mean for the
right hand side "B" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a back-transform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanB
.
Otherwise it is the arithmetic mean and labelled meanB
.
seB
The estimated standard error of the meanB
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
An additional column addpct
of percent differences is added if
endptscale=="original"
and addpct=TRUE
,
as a descriptive supplement to the original scale
differences that are formally estimated.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and
Schuetzenmeister, A. (2010). The multcomp
package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.comps <- comparisonsTable(gmcsfcens.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.comps <- comparisonsTable(gmcsfcens.fit)
Create a table of comparisons based on the cgPairedDifferenceFit object. A cgPairedDifferenceComparisonsTable class object is created.
## S4 method for signature 'cgPairedDifferenceFit' comparisonsTable(fit, type="pairwisereflect", alpha=0.05, addpct=FALSE, display="print", ...)
## S4 method for signature 'cgPairedDifferenceFit' comparisonsTable(fit, type="pairwisereflect", alpha=0.05, addpct=FALSE, display="print", ...)
fit |
An object of class |
type |
Can be one of two values:
|
alpha |
Significance level, by default set to |
addpct |
Only relevant if |
display |
One of three valid values:
|
... |
Additional arguments. Only one is currently valid:
|
Creates an object of class cgPairedDifferenceComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of the cgPairedDifferenceFit
,
unless model="rronly"
is specified. In that case the slot
value is NULL
. See below for the data frame structure
of the table.
rr.comprs
The table of comparisons based on the
rrfit
component of the cgPairedDifferenceFit
object, if a valid resistant & robust fit object is present.
If rrfit
is a simple character value of
"No fit was selected."
, or model="olsonly"
was
specified, then the value is NULL
. See below for the data frame structure
of the table.
settings
A list of settings carried from the
cgPairedDifferenceFit
fit
object, and the addition
of some specified arguments in the method call above:
alpha
,
type
, and addpct
. These are used
for the print.cgPairedDifferenceComparisonsTable
method,
invoked for example when
display="print"
.
The data frame structure of the comparisons table in a *.comprs
slot consists of row.names
that specify the comparison of the
form A vs. B, and these columns:
estimate
The difference in group means in the
comparison: A vs. B. If settings$endptscale=="log"
in the
fit
object, this will be back-transformed to a percent
difference scale.
se
The estimated standard error of the difference
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
lowerci
The lower 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
upperci
The upper 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to a percent
difference scale.
pval
The computed p-value from the test of the difference estimate
.
meanA
or geomeanA
The estimated mean for the
left hand side "A" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a back-transform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanA
.
Otherwise it is the arithmetic mean and labelled meanA
.
seA
The estimated standard error of the meanA
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
meanB
or geomeanB
The estimated mean for the
right hand side "B" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a back-transform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanB
.
Otherwise it is the arithmetic mean and labelled meanB
.
seB
The estimated standard error of the meanB
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will particularly begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
An additional column addpct
of percent differences is added if
endptscale=="original"
and addpct=TRUE
,
as a descriptive supplement to the original scale
differences that are formally estimated. This is only possible for
the model=="ols"
case, since the original arithmetic means
are not estimated in the Resistant & Robust model=="rr"
case.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(anorexiaFT) ## log scale anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(anorexiaFT.data) anorexiaFT.comps <- comparisonsTable(anorexiaFT.fit, display="none") print(anorexiaFT.comps) comparisonsTable(anorexiaFT.fit, model="olsonly") comparisonsTable(anorexiaFT.fit, model="rronly") ## original scale evaluation anorexiaFT.orig.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=FALSE) anorexiaFT.orig.fit <- fit(anorexiaFT.orig.data) comparisonsTable(anorexiaFT.orig.fit) comparisonsTable(anorexiaFT.orig.fit, addpct=TRUE)
data(anorexiaFT) ## log scale anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(anorexiaFT.data) anorexiaFT.comps <- comparisonsTable(anorexiaFT.fit, display="none") print(anorexiaFT.comps) comparisonsTable(anorexiaFT.fit, model="olsonly") comparisonsTable(anorexiaFT.fit, model="rronly") ## original scale evaluation anorexiaFT.orig.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=FALSE) anorexiaFT.orig.fit <- fit(anorexiaFT.orig.data) comparisonsTable(anorexiaFT.orig.fit) comparisonsTable(anorexiaFT.orig.fit, addpct=TRUE)
Create a table of correlations of the data in a cg data object.
correlationTable(data, display = "print", ...)
correlationTable(data, display = "print", ...)
data |
A data object created and prepared (see |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
A method-specific correlationTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
correlationTable.cgPairedDifferenceData
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) correlationTable(anorexiaFT.data)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) correlationTable(anorexiaFT.data)
Create a table of correlations of the data in a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceData' correlationTable(data, display = "print", ...)
## S4 method for signature 'cgPairedDifferenceData' correlationTable(data, display = "print", ...)
data |
A |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
The returned table contains correlations between the paired samples. The
Pearson and Spearman methods are applied with the
cor.test
function from the core stats package.
If the logscale
option is specified (either explicitly, or implicitly
from the cgPairedDifferenceData
object), then the Pearson
calculation on the log transformed data is added.
Creates an object of class cgPairedDifferenceCorrelationTable
, with the
following slots:
contents
The table of correlations for the paired differences. See below for the data frame structure of the table.
settings
A list of settings carried from the
cgPairedDifferenceData
data
object. These are used
for the print.cgPairedDifferenceCorrelationTable
method,
invoked for example when display="print"
.
The data frame structure of the correlation table in a contents
slot consists of row.names
that specify the correlation method:
Pearson
, and Spearman
if original
(i.e. logscale=FALSE
),
and Pearson Original
, Pearson Log
, and Spearman
if logscale=TRUE
. The header label for the column of calculated
correlations is correlation
.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) correlationTable(anorexiaFT.data) ## Show only correlations computed on original scale correlationTable(anorexiaFT.data, logscale=FALSE)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) correlationTable(anorexiaFT.data) ## Show only correlations computed on original scale correlationTable(anorexiaFT.data, logscale=FALSE)
Create a table of quantiles and other summary statistics of the data in a cg data object.
descriptiveTable(data, display = "print", ...)
descriptiveTable(data, display = "print", ...)
data |
A data object created and prepared (see |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
A method-specific descriptiveTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
descriptiveTable.cgOneFactorData
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") descriptiveTable(canine.data) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) descriptiveTable(gmcsfcens.data) ## Paired Difference Data data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) descriptiveTable(anorexiaFT.data)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") descriptiveTable(canine.data) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) descriptiveTable(gmcsfcens.data) ## Paired Difference Data data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) descriptiveTable(anorexiaFT.data)
Create a table of quantiles and other summary statistics of the data in a
cgOneFactorData
object.
## S4 method for signature 'cgOneFactorData' descriptiveTable(data, display = "print", ...)
## S4 method for signature 'cgOneFactorData' descriptiveTable(data, display = "print", ...)
data |
A |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
The returned table contains quantiles, means, sample sizes, and
estimates of variability for each group. If censored data are present,
the estimated quantiles accomodate that with the Kaplan-Meier
method, following Gentleman and Crowley (1991) .
The number of censored / incomplete and number of complete observations
are also included when censored data is present in any of the groups.
If the logscale
option is specified (either explicitly, or implicitly
from the cgOneFactorData
object), then the geometric mean and
geometric standard error for each group are also included. See the Value section
below for details.
Creates an object of class cgOneFactorDescriptiveTable
, with the
following slots:
contents
The table of descriptive summary statistics for each group. See below for the data frame structure of the table.
settings
A list of settings carried from the
cgOneFactorData
data
object. These are used
for the print.cgOneFactorDescriptiveTable
method,
invoked for example when display="print"
.
The data frame structure of the descriptive table in a contents
slot consists of row.names
that specify the group, and these columns:
n
The sample size of the group.
Min
The minimum value of the group.
25%ile
The 25th percentile of the group, estimated
with the quantile
function.
Median
The median value of the group.
75%ile
The 75th percentile of the group, estimated
with the quantile
function.
Max
The maximum value of the group.
Mean
The arithmetic mean value of the group.
StdDev
The standard deviation value of the group.
StdErr
The standard error value of the group.
If logscale=TRUE
, then two additional columns are added:
GeoMean
The geometric mean value of the group.
SEGeoMean
The estimated standard error associated withthe geometric mean. This is calculated with the Delta Method, and will particularly lose accuracy in its useful approximation once the standard error in the log scale exceeds 0.50. A warning message is issued when this occurs.
If censored data are present in the cgOneFactorData
object,
then two more columns are added:
ncensored
The number of censored / incomplete observations.
ncomplete
The number of complete observations.
These two ncensored
and ncomplete
quantities will add up
to n
above and be placed
adjacent to it.
The presence of censored observations will convert columns such as the
Min
and Max
to character values, with the appropriate ">"
and "<" symbols for right-censoring and left-censoring, respectively.
For censored data, Kaplan-Meier estimates are used for the quantiles, as
proposed by Gentleman and Crowley (1991). The survreg::survfit
conventions are followed for interpolation of these quantiles.
With enough censored data
observations in a group, certain quantiles may not be estimable. If
any censored observations are present, the mean, geometric mean,
and associated standard errors will not be
calculated. The <NA> character representation is used.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Gentleman, R.C. and Crowley, J. (1991). "Graphical Methods for Censored Data", Journal of the American Statistical Association, Volume 86, 678-683.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") descriptiveTable(canine.data) ## Remove the geometric mean and standard error columns descriptiveTable(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) descriptiveTable(gmcsfcens.data)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") descriptiveTable(canine.data) ## Remove the geometric mean and standard error columns descriptiveTable(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) descriptiveTable(gmcsfcens.data)
Create a table of quantiles and other summary statistics of the data in a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceData' descriptiveTable(data, display = "print", ...)
## S4 method for signature 'cgPairedDifferenceData' descriptiveTable(data, display = "print", ...)
data |
A |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
The returned table contains quantiles, means, sample sizes, and
estimates of variability for each group, and also for the paired
differences.
It also presents the same
summary measures for the paired differences from the groups.
If the logscale
option is specified (either explicitly, or implicitly
from the cgPairedDifferenceData
object), then the geometric mean and
geometric standard error for each of the two groups are included. Also
included are summary measures of the ratio and percent forms of the paired
differences. See the Value section below for details.
Creates an object of class cgPairedDifferenceDescriptiveTable
, with the
following slots:
contents
The table of descriptive summary statistics for each group, and also for paired differences. See below for the data frame structure of the table.
settings
A list of settings carried from the
cgPairedDifferenceData
data
object. These are used
for the print.cgPairedDifferenceDescriptiveTable
method,
invoked for example when display="print"
.
The data frame structure of the descriptive table in a contents
slot consists of row.names
that specify the group or paired
difference, and these columns:
n
The sample size.
Min
The minimum value.
25%ile
The 25th percentile, estimated
with the quantile
function.
Median
The median value.
75%ile
The 75th percentile, estimated
with the quantile
function.
Max
The maximum value.
Mean
The arithmetic mean value.
StdDev
The standard deviation value.
StdErr
The standard error value.
If logscale=TRUE
, then two additional columns are added:
GeoMean
The geometric mean value of the group.
SEGeoMean
The estimated standard error associated with the geometric mean. This is calculated with the Delta Method, and will particularly lose accuracy in its useful approximation once the standard error in the log scale exceeds 0.50. A warning message is issued when this occurs.
The third row of simple difference summaries
has GeoMean
and SEGeoMean
are set to <NA>.
Fourth and fifth rows are also added with summaries of the paired
ratio differences and percent differences. The StdDev
and
StdErr
values are set to <NA> in these two rows.
The GeoMean
and SEGeoMean
values are calculated via the
the Delta Method, with the same caveats described above.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) descriptiveTable(anorexiaFT.data) ## Remove the geometric mean and standard error columns, ## and the Ratio / Percent Rows, since they are no longer applicable. descriptiveTable(anorexiaFT.data, logscale=FALSE)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) descriptiveTable(anorexiaFT.data) ## Remove the geometric mean and standard error columns, ## and the Ratio / Percent Rows, since they are no longer applicable. descriptiveTable(anorexiaFT.data, logscale=FALSE)
Generic function to create a graph of differences from a data object created by the cg package.
diffGraph(data, ...)
diffGraph(data, ...)
data |
A data object created with a |
... |
Additional arguments, depending on the specific method written for
the object. Currently, there is only one such specific method; see
|
Minimum and maximum values from ranges of data are respectively labeled in the bottom and top left corners of graph regions.
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 main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
diffGraph.cgPairedDifferenceData
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) diffGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. diffGraph(anorexiaFT.data, logscale=FALSE)
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) diffGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. diffGraph(anorexiaFT.data, logscale=FALSE)
Create a graph of profile pairs in a cgOnePairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceData' diffGraph(data, ...)
## S4 method for signature 'cgPairedDifferenceData' diffGraph(data, ...)
data |
A |
... |
Additional arguments, both optional. Two are currently valid:
|
The individual paired differences are displayed in 3 ways side by side.
Each difference is determined by subtracting the refgrp
value from
the other group's value, for each experimental unit
in the data
object of class cgPairedDifferenceData
.
In the middle section, the individual paired difference points
are jitter
ed, and open circles
are used to alleviate potential overlap and the danger of representing
multiple points as a single point.
In the right hand section, a boxplot is added, similar to to that produced by
graphics::boxplot.default
,
but with the median shown as a "+" and the mean shown as a "o". A
warning on the lack of usefulness of a boxplot is added to the graph if there are
have 5 or fewer paired differences.
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 heading for the graph includes a creation of a character
string: The "other" group versus the refgrp
, e.g. B vs. A
.
Also included in the heading is the analysisname
setting from the
cgPairedDifferenceData
object.
The label for the y-axis also includes the B vs. A
character description of the comparison. If logscale=TRUE
,
precent differences represent the tickmarks on the log-spaced scale,
since the differences in the log scale correspond to ratios in the
original scale, e.g. B / A
. Also included in the y-axis label
is a character string derived from the endptname
and endptunits
settings in the cgPairedDifferenceData
object. Percent differences make up the left-hand y-axis, and the
corresponding Ratios make the right-hand left axis.
Minimum and maximum values from the range of the differences are
respectively labeled in the bottom and top left corners of the graph
region. Percentages are displayed when logscale=TRUE
.
diffGraph.cgPairedDifferenceData
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
diffGraph.cgPairedDifferenceData
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) diffGraph(anorexiaFT.data) ## Graph the data on the original scale instead of the log scale. diffGraph(anorexiaFT.data, logscale=FALSE)
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) diffGraph(anorexiaFT.data) ## Graph the data on the original scale instead of the log scale. diffGraph(anorexiaFT.data, logscale=FALSE)
Create a table of downweighted observations in a resistant & robust fit with the cg package.
downweightedTable(fit, cutoffwt, display="print", ...)
downweightedTable(fit, cutoffwt, display="print", ...)
fit |
A fit object created with a |
cutoffwt |
It has no default and must be specified as a numeric between 0 and 1
exclusive. It is a threshold. All
observations that fall beneath the threshold will be
identified. For example, a |
display |
One of three valid values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
A method-specific downweightedTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.
downweightedTable.cgOneFactorFit
, MASS::rlm
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25% ## Paired Difference data anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(anorexiaFT.data) downweightedTable(anorexiaFT.fit, cutoffwt=0.25) ## No observation downweightedTable(anorexiaFT.fit, cutoffwt=0.75) ## downweighted at least 25%
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25% ## Paired Difference data anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(anorexiaFT.data) downweightedTable(anorexiaFT.fit, cutoffwt=0.25) ## No observation downweightedTable(anorexiaFT.fit, cutoffwt=0.75) ## downweighted at least 25%
Create a table of downweighted observations based on a rrfit object within a cgOneFactorFit object. A cgOneFactorDownweightedTable class object is created.
## S4 method for signature 'cgOneFactorFit' downweightedTable(fit, cutoffwt, display="print", ...)
## S4 method for signature 'cgOneFactorFit' downweightedTable(fit, cutoffwt, display="print", ...)
fit |
A fit object of class |
cutoffwt |
It has no default and must be specified as a numeric between 0 and 1
exclusive. It is a threshold. All
observations that fall beneath the threshold will be
identified. For example, a |
display |
One of three valid values:
|
... |
Additional arguments. None are currently defined for this method. |
If no observations meet the cutoff criteria, a text message of the
cgOneFactorDownweightedTable
content emptiness is output
instead.
The reported weights are in the scale of the observation, not the
sum of squared errors representation for the likelihood. Thus they are
derived from the square root of the $w
component from
a MASS::rlm
fit object.
An object of class cgOneFactorDownweightedTable
, with the
following slots:
contents
A data frame where each row is an observation from the fitted data set that meets the cutoff criteria, and these columns:
group
The group identified from the fitted data.
endpoint
The observed response value.
weight
The weight associated to the observation from the resistant / robust fit.
pct down-weighted
An expression of the weight in terms of percent reduction from the maximum of 1.
If no observations meet the cutoff criteria,
the contents
slot is set to NULL
.
cutoffwt
Taken from the specified cutoffwt
argument
value.
settings
A list of settings carried from the
cgOneFactorFit
object, and the addition
of the specified cutoffwt
argument in the method call above. These are used
for the print.cgOneFactorDownweightedTable
method,
invoked for example when
display="print"
.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.
cgOneFactorFit
, MASS::rlm
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25%
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25%
Create a table of downweighted observations based on a rrfit object within a cgPairedDifferenceFit object. A cgPairedDifferenceDownweightedTable class object is created.
## S4 method for signature 'cgPairedDifferenceFit' downweightedTable(fit, cutoffwt, display = "print",...)
## S4 method for signature 'cgPairedDifferenceFit' downweightedTable(fit, cutoffwt, display = "print",...)
fit |
A fit object of class |
cutoffwt |
It has no default and must be specified as a numeric between 0 and 1
exclusive. It is a threshold. All
observations that fall beneath the threshold will be
identified. For example, a |
display |
One of three valid values:
|
... |
Additional arguments. None are currently defined for this method. |
If no observations meet the cutoff criteria, a text message of the
cgPairedDifferenceDownweightedTable
content emptiness is output
instead.
The reported weights are in the scale of the observation, not the
sum of squared errors representation for the likelihood. Thus they are
derived from the square root of the $w
component from
a MASS::rlm
fit object.
An object of class cgPairedDifferenceDownweightedTable
, with the
following slots:
contents
A data frame where each row is an observation from the fitted data set that meets the cutoff criteria, and these columns:
expunit
The experimental unit name identified from the fitted data.
grp1
The observed response value from group 1.
grp2
The observed response value from group 2.
weight
The weight associated to the observation from the resistant / robust fit.
pct down-weighted
An expression of the weight in terms of percent reduction from the maximum of 1.
Simple Diff
The difference of observed response value between the two groups.
Ratio Diff
The percent difference of observed response value
between the two groups. NOTE this only occurs when
logscale=TRUE
from the
cgPairedDifferenceFit
object settings
in the fit
argument.
Pct Diff
The percent difference of observed response value
between the two groups. NOTE this only occurs when
logscale=TRUE
from the
cgPairedDifferenceFit
object settings
in the fit
argument.
If no observations meet the cutoff criteria,
the contents
slot is set to NULL
.
messages
A message when the contents
slot is set to NULL
.
settings
A list of settings carried from the
cgPairedDifferenceFit
object. These are used for the
print.cgPairedDifferenceDownweightedTable
method,
invoked for example when display="print"
.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.
cgPairedDifferenceFit
, MASS::rlm
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) downweightedTable(anorexiaFT.fit, cutoffwt=0.25) ## No observation downweightedTable(anorexiaFT.fit, cutoffwt=0.75) ## downweighted at least 25%
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) downweightedTable(anorexiaFT.fit, cutoffwt=0.25) ## No observation downweightedTable(anorexiaFT.fit, cutoffwt=0.75) ## downweighted at least 25%
Creates a graph to see pairwise comparisons amongst groups. The method of Andrews, Sarner, and Snee (1980) is applied to visualizes significant differences via non-overlapping error bars.
errorbargraph(estimates, centralvar, critpoint, endptscale="log", analysisname="", endptname="", alpha=0.05, digits=NULL, approxstamp=FALSE, titlestamp=TRUE, offset=NULL, ticklabels=NULL, ...)
errorbargraph(estimates, centralvar, critpoint, endptscale="log", analysisname="", endptname="", alpha=0.05, digits=NULL, approxstamp=FALSE, titlestamp=TRUE, offset=NULL, ticklabels=NULL, ...)
estimates |
A named vector of estimates. Each estimate element is a measure that will be the center of the error bar of the group. The name of each group must be present in the names attribute of the vector. |
centralvar |
A single variance value to be used for each group's error bar
construction. In the canonical case it is the square of the estimated
standard error of the mean |
critpoint |
The single critical value of the theoretical reference distribution. In the
canonical case it is the t-distribution quantile for estimates derived from a
standard linear model with homoscedastic variance. It could also
reflect a multiplicity adjustment, or like the
|
endptscale |
Must be specified as |
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 |
alpha |
Significance level, by default set to |
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
|
approxstamp |
Add text to the graph that acknowledges that the error bar method is approximate. |
titlestamp |
Add text to the top margin above the graph area. |
offset |
Optional,
if for example a numeric constant was added to all response values
before calculation of the estimate as a mean, this could be used to
shift the axis marks appropriately. The default value is
|
ticklabels |
Optional, before graphing the data, remove any automatically generated tickmarks for the y-axis, and use these tickmarks instead. A vector of tickmarks to be placed on the y-axis. Any numeric representations will be coerced to character. |
... |
Additional arguments. None are currently used. |
The statistical method of Andrews, Sarner, and Snee (1980) is applied to visualizes significant differences via non-overlapping error bars. The method is exact when there are equal standard errors amongst the groups, and approximate otherwise. The method's usefulness declines as the standard errors become more disparate.
When two groups are compared, nonoverlapping error bars indicate a statistically significant pairwise difference. Conversely, if the error bars overlap, there is no such significant difference. In cases of approximation, or borderline overlap that is seen, the actual comparison needs to be consulted to judge significance with a p-value.
The minimum and maximum values across all the bar ends
are added inside the plot region in blue, flush against the
y-axis. The number of decimal places are determined by the
digits
value.
errorbargraph
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
This function was created for internal use in the cg package as
its use can be seen in the errorBarGraph
methods
code. Therefore any direct use of it needs to be done cautiously.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Andrews, H.P., Snee, R.D., Sarner, M.H. (1980). "Graphical Display of Means," The American Statistician, 34, 195-199.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Easier way: notice the camel case of the errorBarGraph call errorBarGraph(canine.fit, model="olsonly") ## Manual way ## Instead of errorBarGraph(canine.fit, model="olsonly") errorbargraph(estimates=canine.fit@olsfit$coef, centralvar=((summary(canine.fit@olsfit)$sigma^2) / unique(sapply(canine, length))), critpoint=qt(0.975, df=canine.fit@olsfit$df.residual), endptscale="log", analysisname="Canine", digits=1, endptname=expression(paste( plain('Prostate Volume'), ' (', plain(cm)^3 , ')' )) )
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) ## Easier way: notice the camel case of the errorBarGraph call errorBarGraph(canine.fit, model="olsonly") ## Manual way ## Instead of errorBarGraph(canine.fit, model="olsonly") errorbargraph(estimates=canine.fit@olsfit$coef, centralvar=((summary(canine.fit@olsfit)$sigma^2) / unique(sapply(canine, length))), critpoint=qt(0.975, df=canine.fit@olsfit$df.residual), endptscale="log", analysisname="Canine", digits=1, endptname=expression(paste( plain('Prostate Volume'), ' (', plain(cm)^3 , ')' )) )
Generic function to create a Error Bar graph based on a fit by the cg package.
errorBarGraph(fit, mcadjust=FALSE, alpha = 0.05, cgtheme = TRUE, device="single", ...)
errorBarGraph(fit, mcadjust=FALSE, alpha = 0.05, cgtheme = TRUE, device="single", ...)
fit |
A fit object created by a |
mcadjust |
Do a multiple comparisons adjustment, based on the simultaneous
inference capabilities of the multcomp package. See Details
below. The default value is |
alpha |
Significance level, by default set to |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
When mcadjust=TRUE
, a status message of
"Some time may be needed"
"as the critical point from the multcomp::summary.glht function call is calculated"
is displayed at the console. This computed critical point
is used for all subsequent p-value and confidence interval calculations.
The main purpose is the side effect of graphing to the current device. See specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and
Schuetzenmeister, A. (2010). The multcomp
R package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) errorBarGraph(canine.fit) errorBarGraph(canine.fit, mcadjust=TRUE, model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) errorBarGraph(canine.fit) errorBarGraph(canine.fit, mcadjust=TRUE, model="olsonly")
Creates a graph to see comparisons amongst groups based on the cgOneFactorFit object. The method of Andrews, Sarner, and Snee (1980) is applied to visualizes significant differences via non-overlapping error bars.
## S4 method for signature 'cgOneFactorFit' errorBarGraph(fit, mcadjust = FALSE, alpha =0.05, cgtheme = TRUE, device = "single", ...)
## S4 method for signature 'cgOneFactorFit' errorBarGraph(fit, mcadjust = FALSE, alpha =0.05, cgtheme = TRUE, device = "single", ...)
fit |
A fit object of class |
mcadjust |
Do a multiple comparisons adjustment, based on the simultaneous
inference capabilities of the multcomp package. See Details
below. The default value is |
alpha |
Significance level, by default set to |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments. Two are currently valid:
|
When mcadjust=TRUE
, a status message of
"Some time may be needed as the critical point"
"from the multcomp::summary.glht function call is calculated"
is displayed at the console. This computed critical point
is used for all interval calculations.
The multcomp package provides a unified way to calculate critical points based on the comparisons of interest in a "family". Thus a user does not need to worry about choosing amongst the myriad names of multiple comparison procedures.
The errorBarGraph.cgOneFactorFit
method is only relevant for
classical least squares and resistant & robust fits in the
cgOneFactorFit
object. There is an
errorbargraph
core function that could be used for
approximations in other cases like accelerated failure time or unequal
variance fits.
The statistical method of Andrews, Sarner, and Snee (1980) is applied to visualize significant differences via non-overlapping error bars. The method is exact when there are equal sample sizes amongst the groups for the classical least squares case. When there are unequal group sample sizes or a resistant & robust fit is used to create the graph, the method is approximate, and this is noted in the main title section of the graph. For the unequal sample sizes, the harmonic mean is calculated to use for all the groups. The method's usefulness declines as the sample sizes become more disparate.
When two groups are compared, nonoverlapping error bars indicate a
statistically significant pairwise difference. Conversely, if the
error bars overlap, there is no such significant difference. In cases
of approximation, or borderline overlap that is seen, the
cgOneFactorComparisonsTable
object created with
type="pairwisereflect"
or type="pairwise"
needs to be
consulted to judge significance with a p-value.
The minimum and maximum values across all the bar ends
are added inside the plot region in blue, flush against the
y-axis. The number of decimal places are determined by the
digits
value in the fit$settings
slot.
If group labels along the x-axis seem to overlap in the standard horizontal form, they will be rotated 45 degrees.
errorBarGraph.cgOneFactorFit
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Andrews, H.P., Snee, R.D., Sarner, M.H. (1980). "Graphical Display of Means," The American Statistician, 34, 195-199.
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and
Schuetzenmeister, A. (2010). The multcomp
R package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) errorBarGraph(canine.fit) errorBarGraph(canine.fit, mcadjust=TRUE, model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) errorBarGraph(canine.fit) errorBarGraph(canine.fit, mcadjust=TRUE, model="olsonly")
Fit data objects prepared by the cg package.
fit(data, type, ...)
fit(data, type, ...)
data |
A data object prepared with a |
type |
Type of model to fit, represented by a character string. |
... |
Additional arguments, depending on the specific method written for the object. |
A method-specific fit
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
## Unpaired Samples, One Factor data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data, type="rr") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") ## Paired Difference data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr")
## Unpaired Samples, One Factor data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data, type="rr") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") ## Paired Difference data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr")
Fits a one-factor model based on the cgOneFactorData
object. The
created object is designed for one-factor / one-way / unpaired samples
collected data, and is of class cgOneFactorFit
.
## S4 method for signature 'cgOneFactorData' fit(data, type="rr", ...)
## S4 method for signature 'cgOneFactorData' fit(data, type="rr", ...)
data |
A data object of class |
type |
Type of model to fit, represented by a character
value. The default value is
|
... |
Additional arguments, both optional, that are allowed to be specified dependent on
the choice of the
|
In the current version of the cg package, most default settings
for rlm
are kept for the
fit.cgOneFactorData
method wrapper call when
type="rr"
, with no capability to choose
another value for an arguments such as psi
, scale.est
,
and k2
. The method
argument is set to "MM"
.
Analogously most survreg
default settings are kept for the
fit.cgOneFactorData
method wrapper call when
type="aft"
, with no capability to modify the
arguments. Most notably the dist
argument is set to
"lognormal"
or "gaussian"
, depending on
whether a log scale analysis request is evident in the
cgOneFactorData
object or not, respectively.
Creates an object of class cgOneFactorFit
, with the
following slots:
olsfit
The contents of a lm
fit to the
data. This is always populated with an lm
object
no matter the choice of the
type
argument, even though it is certainly inappropriate in
the type="aft"
case.
rrfit
The contents of a rlm
fit to the
data, housed as a rrfit
class object.
If type="rr"
is not selected, then this is set
to a simple character value of "No fit was selected."
.
aftfit
The contents of a survreg
fit to the
data, with some annotations, to be a aftfit
class object.
If type="aft"
is not selected, then this is set
to a simple character value of "No fit was selected."
.
uvfit
The contents of a gls
fit to the
data, housed as a uvfit
class object.
If type="uv"
is not selected, then this is set
to a simple character value of "No fit was selected."
.
settings
A list of properties carried as-is from the
data
argument object of class
cgOneFactorData
.
In particular,
if zeroscore
is specified as a non-NULL
number in
the cgOneFactorData
object in the data
argument, then a score value near zero was derived to replace all zeroes for subsequent
log-scale analyses. Alternatively, if addconstant
is specified
as a non-NULL
number in the
cgOneFactorData
object in the data
argument, then a value was added to shift up all observations for subsequent
log-scale analyses.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Huber, P. J. (1967), "The Behavior of Maximum Likelihood Estimates Under Nonstandard Conditions", Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1, 221-233.
Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(data=canine.data, type="rr") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(data=canine.data, type="rr") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft")
Fits a paired difference model based
on the cgPairedDifferenceData
object. The
created object is designed for paired samples
collected data, and is of class cgPairedDifferenceFit
.
## S4 method for signature 'cgPairedDifferenceData' fit(data, type="rr", ...)
## S4 method for signature 'cgPairedDifferenceData' fit(data, type="rr", ...)
data |
A data object of class |
type |
Type of model to fit, represented by a character
value. The default value is
|
... |
Additional arguments, both optional, that are allowed to be specified dependent on
the choice of the
|
In the current version of the cg package, most default settings
for rlm
are kept for the
fit.cgPairedDifferenceData
method wrapper call when
type="rr"
, with no capability to choose
another value for an arguments such as psi
, scale.est
,
and k2
. The method
argument is set to "MM"
.
Creates an object of class cgPairedDifferenceFit
, with the
following slots:
olsfit
The contents of a lm
fit to the
data. This is always populated with an lm
object
no matter the choice of the type
argument, such as code="rr"
.
rrfit
The contents of a rlm
fit to the
data, housed as a rrfit
class object.
If type="rr"
is not selected, then this is set
to a simple character value of "No fit was selected."
.
settings
A list of properties carried as-is from the
data
argument object of class
cgPairedDifferenceData
.
In particular,
if zeroscore
is specified as a non-NULL
number in
the cgPairedDifferenceData
object in the data
argument, then a score value near zero was derived to replace
all zeroes for subsequent
log-scale analyses. Alternatively, if addconstant
is specified
as a non-NULL
number in the
cgPairedDifferenceData
object in the data
argument, then a value was added to shift up all observations for subsequent
log-scale analyses.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr")
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr")
Generic function to perform a global test of significance on a fit by the cg package.
globalTest(fit, display="print", ...)
globalTest(fit, display="print", ...)
fit |
A fit object created by a |
display |
One of three valid values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
A method-specific globalTest
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.globalTest <- globalTest(canine.fit) data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.globalTest <- globalTest(gmcsfcens.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.globalTest <- globalTest(canine.fit) data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.globalTest <- globalTest(gmcsfcens.fit)
Performs a global test based on the cgOneFactorFit object, to assess whether there are any significant differences amongst levels of the factor, i.e. amongst the groups. A cgOneFactorGlobalTest class object is created.
## S4 method for signature 'cgOneFactorFit' globalTest(fit, display="print", ...)
## S4 method for signature 'cgOneFactorFit' globalTest(fit, display="print", ...)
fit |
A fit object of class |
display |
One of three valid values:
|
... |
Additional arguments. Only one is currently valid:
For other possible |
The notion of a global F test, or equivalently, of ,
for resistant & robust linear models is
murky, as no clear theoretical analogue to the ordinary classical
least squares approach exists. The approach taken here is ad-hoc,
which is essentially to re-fit a linear model with
lm()
and weights
from the resistant & robust fit. This ad-hoc approach is taken when
there are 3 or more groups.
If there are only 2 groups, then the comparisonsTable.cgOneFactorFit
method is used with the rlm()
model component.
Creates an object of class cgOneFactorGlobalTest
, with the
following slots:
ols.gpval
The p-value of a global F test applied
to the olsfit
component of the cgOneFactorFit
object, unless model="rronly"
is specified. Will not be appropriate in
the case where a valid aftfit
component is present in the
cgOneFactorFit
object.
rr.gpval
The p-value of an ad-hoc global test applied
to the rrfit
component of the cgOneFactorFit
object, if a valid resistant & robust fit object is present.
See the Details section
above. If rrfit
is a simple character value of
"No fit was selected."
, or model="olsonly"
was
specified, then the value is NULL
.
aft.gpval
The p-value of a global chi-square test applied
to the aftfit
component of the cgOneFactorFit
object if a valid accelerated failure time fit object is present.
If aftfit
is a simple character value of
"No fit was selected."
, then the value is NULL
.
uv.gpval
The p-value of a global F test applied
to the uvfit
component of the cgOneFactorFit
object if a valid unequal variances fit object is present.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.globalTest <- globalTest(canine.fit) globalTest(canine.fit, model="both") globalTest(canine.fit, model="olsonly") globalTest(canine.fit, model="rronly") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") globalTest(gmcsfcens.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.globalTest <- globalTest(canine.fit) globalTest(canine.fit, model="both") globalTest(canine.fit, model="olsonly") globalTest(canine.fit, model="rronly") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") globalTest(gmcsfcens.fit)
A data frame used to illustrate the cg package. It has a One Factor / One-Way / Unpaired Samples layout. It also contains left-censored values of varying degree in each of the six groups.
data(gmcsfcens)
data(gmcsfcens)
A 8-by-6 data frame with up to 8 numeric observations per group from an experiment on the following 6 groups.
PBS/Tg 197
phosphate buffered saline control group
1mg/kg/Tg 197
1 mg/kg dose
3mg/kg/Tg 197
3 mg/kg dose
10/mg/kg/Tg 197
10 mg/kg dose
30/mg/kg/Tg 197
30 mg/kg dose
PBS/WT
phosphate buffered saline control group of wild-type mice
The first five groups have transgenic (Tg197) mice subjects, a well established model to induce arthritis. The sixth group are "wild-type" mice that did not have arthritis induced. The various doses of the inner four groups are administrations of golimumab, a monoclonal antibody therapy.
The individual group values are of mode character, since some of them
are represented as left-censored values such as <82.5
. Note
that two of the groups have less than 8 observations, and the
corresponding cells in the data frame actually contain empty quote ""
values.
The gmcsfcens
data set that comes with the cg package
is in groupcolumns
format. Each column represents a group, and
the observations in that group's column are the individual response
values. As described above, they are character valued potentially
left-censored representations.
The 6 groups are regarded as levels of one factor in the
prepareCGOneFactorData
, fit
, and other methods in
the cg package.
Alternative formats of this data set is contained in
gmcsfcens.listfmt
. See that help file for details,
including how such formats would be read and prepare
d by cg.
GM-CSF stands for Granulocyte macrophage colony stimulating factor, a type of cytokine that is important in the growth of white blood cells. It is one of the outcomes measured in the experiment described in the references section below. Therapeutic inhibition of it may be beneficial in cases where too many white blood cells are produced, such as arthritis. In other situations where white blood cell counts are low, stimulation of it is desired. In the referenced study below, GM-CSF is evaluated in the context of inflammation.
Contact [email protected] for bug reports, questions, concerns, and comments.
Shealy, D., Cai, A., Staquet, K., Baker, A., Lacy, E., Johns, L., Vafa, O., Gunn, G., Tam, S., Sague, S., Wang, D., Brigham-Burke, M., Dalmonte, P., Emmell, E., Pikounis, B., Bugelski, P., Zhou, H., Scallon, B., Giles-Komar, J. (2010). "Characterization of Golimumab (CNTO148), a human monoclonal antibody specific for human tumor necrosis factor ", mAbs, Volume 2, Issue 4, 428-439.
gmcsfcens.listfmt
, prepareCGOneFactorData
data(gmcsfcens) str(gmcsfcens)
data(gmcsfcens) str(gmcsfcens)
A data frame used to illustrate the cg package. It has a One Factor / One-Way / Unpaired Samples layout. It also contains left-censored values of varying degree in each of the six groups. There are three equivalent data frame versions documented here.
data(gmcsfcens.listfmt1) data(gmcsfcens.listfmt2) data(gmcsfcens.listfmt3)
data(gmcsfcens.listfmt1) data(gmcsfcens.listfmt2) data(gmcsfcens.listfmt3)
A 45 row data frame with up to 8 observations per group from an experiment on the following 6 groups.
PBS/Tg 197
phosphate buffered saline control group
1mg/kg/Tg 197
1 mg/kg dose
3mg/kg/Tg 197
3 mg/kg dose
10/mg/kg/Tg 197
10 mg/kg dose
30/mg/kg/Tg 197
30 mg/kg dose
PBS/WT
phosphate buffered saline control group of wild-type mice
The first five groups have transgenic (Tg197) mice subjects, a well established model to induce arthritis. The sixth group are "wild-type" mice that did not have arthritis induced. The various doses of the inner four groups are administrations of golimumab, a monoclonal antibody therapy.
There can be either 2, 3, or 4 columns in the data frame.
The above 6 items are the levels of the first column's factor, named
grp
.
2 columns
The data frame name is
gmcsfcens.listfmt1
. The second column endpt
contains the character observations that can represent complete
observations, and also left- or right-censored ones, in the same
way that gmcsfcens
does.
3 columns
The data frame name is
gmcsfcens.listfmt2
. The second column endpt
contains numeric observations, and the third column status
indicates whether the observation is complete/not censored (1),
and 0 if left-censored. See prepareCGOneFactorData
for the explanation of why the value of 0 and
not 2 is required. In the example code below, the
leftcensor=TRUE
argument needs to be specified when this
format version is used.
4 columns
The data frame name is
gmcsfcens.listfmt3
. The second and third columns
endpt1
and endpt2
contain numeric observations, and the fourth column status
indicates whether the observation is complete/not censored (1),
and 2 if left-censored. See prepareCGOneFactorData
for the explanation of this format, and the example code below.
The gmcsfcens.listfmt*
data sets that comes with the cg package
are in a "listed" format, detailed below.
The 6 groups are regarded as levels of one factor in the
prepareCGOneFactorData
, fit
, and other methods in
the cg package.
The gmcsfcens.listfmt
data sets are alternative formats of the
gmcsfcens
data set. See that help file for details. Once
a gmcsfcens.listfmt
data set is prepare
d into a
cgOneFactorData
object, all the subsequent methods work
on the object in the same way.
GM-CSF stands for Granulocyte macrophage colony stimulating factor, a type of cytokine that is important in the growth of white blood cells. It is one of the outcomes measured in the experiment described in the references section below. Therapeutic inhibition of it may be beneficial in cases where too many white blood cells are produced, such as arthritis. In other situations where white blood cell counts are low, stimulation of it is desired. In the referenced study below, GM-CSF is evaluated in the context of inflammation.
Contact [email protected] for bug reports, questions, concerns, and comments.
Shealy, D., Cai, A., Staquet, K., Baker, A., Lacy, E., Johns, L., Vafa, O., Gunn, G., Tam, S., Sague, S., Wang, D., Brigham-Burke, M., Dalmonte, P., Emmell, E., Pikounis, B., Bugelski, P., Zhou, H., Scallon, B., Giles-Komar, J. (2010). "Characterization of Golimumab (CNTO148), a human monoclonal antibody specific for human tumor necrosis factor ", mAbs, Volume 2, Issue 4, 428-439.
gmcsfcens
, prepareCGOneFactorData
data(gmcsfcens.listfmt1) str(gmcsfcens.listfmt1) data(gmcsfcens.listfmt2) str(gmcsfcens.listfmt2) data(gmcsfcens.listfmt3) str(gmcsfcens.listfmt3) ## Analogous to prepareCGOneFactorData call on gmcsfcens data frame format, ## subsequent methods will work for gmcsfcens.listfmt.data objects below: ## leftcensor argument can be left as default NULL gmcsfcens.listfmt1.data <- prepareCGOneFactorData(gmcsfcens.listfmt1, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## leftcensor=TRUE argument needs to be set gmcsfcens.listfmt2.data <- prepareCGOneFactorData(gmcsfcens.listfmt2, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE, leftcensor=TRUE) ## leftcensor argument can be left as default NULL gmcsfcens.listfmt3.data <- prepareCGOneFactorData(gmcsfcens.listfmt3, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## as they do on gmcsfcens.data: gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE)
data(gmcsfcens.listfmt1) str(gmcsfcens.listfmt1) data(gmcsfcens.listfmt2) str(gmcsfcens.listfmt2) data(gmcsfcens.listfmt3) str(gmcsfcens.listfmt3) ## Analogous to prepareCGOneFactorData call on gmcsfcens data frame format, ## subsequent methods will work for gmcsfcens.listfmt.data objects below: ## leftcensor argument can be left as default NULL gmcsfcens.listfmt1.data <- prepareCGOneFactorData(gmcsfcens.listfmt1, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## leftcensor=TRUE argument needs to be set gmcsfcens.listfmt2.data <- prepareCGOneFactorData(gmcsfcens.listfmt2, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE, leftcensor=TRUE) ## leftcensor argument can be left as default NULL gmcsfcens.listfmt3.data <- prepareCGOneFactorData(gmcsfcens.listfmt3, format="listed", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## as they do on gmcsfcens.data: gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE)
Create a table of estimated group means based on a fit by the cg package.
grpSummaryTable(fit, mcadjust = FALSE, alpha = 0.05, display = "print", ...)
grpSummaryTable(fit, mcadjust = FALSE, alpha = 0.05, display = "print", ...)
fit |
An fit object created with a
|
mcadjust |
Do a multiple comparisons adjustment, based on the simultaneous
inference capabilities of the multcomp package. See Details
below. The default value is |
alpha |
Significance level, by default set to |
display |
One of three valid values:
|
... |
Additional arguments, depending on the specific method written for
the object. Currently, there is only one such specific method; see
|
When mcadjust=TRUE
, a status message of
"Some time may be needed as the critical point"
"from the multcomp::summary.glht function call is calculated"
is displayed at the console. This computed critical point
is used for all subsequent p-value and confidence interval
calculations.
A method-specific grpSummaryTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and
Schuetzenmeister, A. (2010). The multcomp
package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
grpSummaryTable.cgOneFactorFit
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.grpsumm <- grpSummaryTable(canine.fit) data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.grpsumm <- grpSummaryTable(gmcsfcens.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.grpsumm <- grpSummaryTable(canine.fit) data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") gmcsfcens.grpsumm <- grpSummaryTable(gmcsfcens.fit)
Create a table of estimated group means based on the cgOneFactorFit object. Standard errors and confidence intervals are added. A cgOneFactorGrpSummaryTable class object is created.
## S4 method for signature 'cgOneFactorFit' grpSummaryTable(fit, mcadjust=FALSE, alpha=0.05, display="print", ...)
## S4 method for signature 'cgOneFactorFit' grpSummaryTable(fit, mcadjust=FALSE, alpha=0.05, display="print", ...)
fit |
A fit object of class |
mcadjust |
Do a multiple comparisons adjustment, based on the simultaneous
inference capabilities of the multcomp package. See Details
below. The default value is |
alpha |
Significance level, by default set to |
display |
One of three valid values:
|
... |
Additional arguments. Only one is currently valid:
For other possible |
When mcadjust=TRUE
, a status message of
"Some time may be needed as the critical point"
"from the multcomp::summary.glht function call is calculated"
is displayed at the console. This computed critical point
is used for all subsequent p-value and confidence interval
calculations.
The multcomp package provides a unified way to calculate critical points based on the comparisons of interest in a "family". Thus a user does not need to worry about choosing amongst the myriad names of multiple comparison procedures.
Creates an object of class cgOneFactorGrpSummaryTable
, with the
following slots:
ols.grps
The table of group estimates based on the
olsfit
component of the cgOneFactorFit
,
unless model="rronly"
is specified. In that case the slot
value is NULL
. Will not be appropriate in
the case where a valid aftfit
component is present in the
cgOneFactorFit
object. See below for the data frame structure
of the table.
rr.grps
The table of group estimates based on the
rrfit
component of the cgOneFactorFit
object, if a valid resistant & robust fit object is present.
If rrfit
is a simple character value of
"No fit was selected."
, or model="olsonly"
was
specified, then the value is NULL
. See below for the data frame structure
of the table.
aft.grps
The table of group estimates based on the
aftfit
component of the cgOneFactorFit
object if a valid accelerated failure time fit object is present.
If aftfit
is a simple character value of
"No fit was selected."
, then the value is NULL
.
See below for the data frame structure
of the table.
uv.grps
The table of group estimates based on the
uvfit
component of the cgOneFactorFit
object if a valid unequal variances fit object is present.
If uvfit
is a simple character value of
"No fit was selected."
, then the value is NULL
.
See below for the data frame structure
of the table.
settings
A list of settings carried from the
cgOneFactorFit
fit
object, and the addition
of some specified arguments in the method call above: alpha
and mcadjust
. These are used
for the print.cgOneFactorGrpSummaryTable
method,
invoked for example when
display="print"
.
The data frame structure of the comparisons table in a *.comprs
slot consists of row.names
that specify group name (factor
level), and these columns:
estimate
The estimated group mean. If settings$endptscale=="log"
in the
fit
object, this will be back-transformed to a geometric mean.
se
The estimated standard error of the group mean
estimate
. If settings$endptscale=="log"
in the
fit
object, this estimate will be based on the Delta
method, and will begin to be a poor approximation when the
standard error in the logscale exceeds 0.50.
lowerci
The lower 100 * (1-alpha
) % confidence limit of the
group mean estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to the
original scale.
upperci
The upper 100 * (1-alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
object, the confidence limit is first computed in the
logarithmic scale of analysis, and then back-transformed to the
original scale.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and
Schuetzenmeister, A. (2010). The multcomp
package.
Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) grpSummaryTable(canine.fit) grpSummaryTable(canine.fit, mcadjust=TRUE, model="olsonly") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") grpSummaryTable(gmcsfcens.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) grpSummaryTable(canine.fit) grpSummaryTable(canine.fit, mcadjust=TRUE, model="olsonly") data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") grpSummaryTable(gmcsfcens.fit)
Create non-parametric survival or cumulative distribution graphs based on a data object in the cg package.
kmGraph(data, cgtheme = TRUE, distfcn = "survival", ylab = NULL, title = NULL, ...)
kmGraph(data, cgtheme = TRUE, distfcn = "survival", ylab = NULL, title = NULL, ...)
data |
A data object created using the cg
package. The only class of object currently
available is |
cgtheme |
When set to the default |
distfcn |
A |
ylab |
Specify a character value for the y-axis label. The default value is
|
title |
Specify a character value for the main title at the top of the
graph. The default value is
|
... |
Additional arguments, depending on the specific method written for
the object. Currently, there is only one such specific method; see
|
Color assignments of the graphed step functions lines for the groups
match the order of the group name factor levels. The color order is
given in cgLineColors
. The line widths are set to be
thicker (lwd=2
), and the group name label is placed near the line
using label
methodology from the Hmisc package.
The x-axis represents response values, and y-axis represents estimated probabilities. Minimum and maximum values from ranges of data are respectively labeled in the bottom left and right corners of graph regions.
The main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") kmGraph(canine.data, distfcn="cumulative") kmGraph(canine.data, distfcn="cumulative", ticklabels=list(mod="add", marks=c(2))) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) kmGraph(gmcsfcens.data, distfcn="cumulative") kmGraph(gmcsfcens.data, distfcn="cumulative", logscale=FALSE)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") kmGraph(canine.data, distfcn="cumulative") kmGraph(canine.data, distfcn="cumulative", ticklabels=list(mod="add", marks=c(2))) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) kmGraph(gmcsfcens.data, distfcn="cumulative") kmGraph(gmcsfcens.data, distfcn="cumulative", logscale=FALSE)
Create a non-parametric survival or cumulative distribution graph
of groups of data in a cgOneFactorData
object.
## S4 method for signature 'cgOneFactorData' kmGraph(data, cgtheme = TRUE, distfcn ="survival", ylab = NULL, title = NULL, ...)
## S4 method for signature 'cgOneFactorData' kmGraph(data, cgtheme = TRUE, distfcn ="survival", ylab = NULL, title = NULL, ...)
data |
A |
cgtheme |
A |
distfcn |
A |
ylab |
Optional, a |
title |
Optional, a |
... |
Additional arguments. One is currently valid:
|
Graph the estimated survival function or cumulative distribution for
each group in a
cgOneFactorData
object. For censored data, Kaplan-Meier estimates
are used. For uncensored data, the conventional step function empirical
estimates are used.
Color assignments of the graphed step functions lines for the groups
match the order of the group name factor levels. The color order is
given in cgLineColors
. The line widths are set to be
thicker (lwd=2
), and the group name label is placed near the line
using label
methodology from the Hmisc package.
The x-axis represents response values, and y-axis represents estimated probabilities. Minimum and maximum values from ranges of data are respectively labeled in the bottom left and right corners of graph regions.
The label for the x-axis is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its
endptname
and endptunits
arguments.
The number of decimal places printed in the ticks on the x-axis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
kmGraph.cgOneFactorFit
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") kmGraph(canine.data, distfcn="cumulative") kmGraph(canine.data, distfcn="cumulative", ticklabels=list(mod="add", marks=c(2))) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) kmGraph(gmcsfcens.data, distfcn="cumulative") kmGraph(gmcsfcens.data, distfcn="cumulative", logscale=FALSE)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") kmGraph(canine.data, distfcn="cumulative") kmGraph(canine.data, distfcn="cumulative", ticklabels=list(mod="add", marks=c(2))) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) kmGraph(gmcsfcens.data, distfcn="cumulative") kmGraph(gmcsfcens.data, distfcn="cumulative", logscale=FALSE)
Generic function to create point graphs (a.k.a. dot plot, strip plot, one-dimensional scatter plot) of a data object created by the cg package.
pointGraph(data, ...)
pointGraph(data, ...)
data |
A data object created with a |
... |
Additional arguments, depending on the specific method written for
the object. Currently, there is only one such specific method; see
|
Individual points are jitter
ed, and open circles
are used to alleviate potential overlap and the danger of representing
multiple points as a single point.
The point graph is a vertical dot plot or strip plot, with separate areas for each group in the data set, and light gray lines between the groups. For censored data, left-censored values are shown as a shallow "V", which is actually just a rotated downward "<" sign. Similarly, right-censored values are shown as a deeper "^", which is a rotated upward ">" sign.
Minimum and maximum values from ranges of data are respectively labeled in the bottom and top left corners of graph regions.
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 main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") pointGraph(canine.data) # Graph the data on the original scale instead of the log scale. pointGraph(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") pointGraph(canine.data) # Graph the data on the original scale instead of the log scale. pointGraph(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data)
Create a point graph (a.k.a. dot plot, strip plot, one-dimensional
scatter plot) of the data in a cgOneFactorData
object.
## S4 method for signature 'cgOneFactorData' pointGraph(data, ...)
## S4 method for signature 'cgOneFactorData' pointGraph(data, ...)
data |
A |
... |
Additional arguments, both optional. Two are currently valid:
|
If logscale=TRUE
, the tick marks for the y-axis
on the left side of the plot show original values, while the
tick marks for the y-axis on the right side of the graph
show base 10 log values.
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.
Individual points are jitter
ed, and open circles
are used to alleviate potential overlap and the danger of representing
multiple points as a single point.
The point graph is a vertical dot plot or strip plot, with separate areas for each group in the data set, and light gray lines between the groups. For censored data, left-censored values are shown as a shallow "V", which is actually just a rotated downward "<" sign. Similarly, right-censored values are shown as a deeper "^", which is a rotated upward ">" sign.
The heading for the graph is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its analysisname
argument.
The label for the y-axis is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its endptname
and endptunits
arguments.
The number of decimal places printed in the ticks on the y-axis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
The minimum and maximum values from the range of the data are respectively labeled in the bottom and top left corners of the graph region.
If group labels along the x-axis seem to overlap in the standard horizontal form, they will be rotated 45 degrees.
pointGraph.cgOneFactorData
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) pointGraph(canine.data) # Graph the data on the original scale instead of the log scale. pointGraph(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) pointGraph(canine.data) # Graph the data on the original scale instead of the log scale. pointGraph(canine.data, logscale=FALSE) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) pointGraph(gmcsfcens.data)
Reads in a data frame and
settings in order to create a
cg
Data object.
prepare(type, ...)
prepare(type, ...)
type |
Values and synonyms to create a cg data object. For one factor / unpaired samples, either "onefactor" or "unpairedgroups" can be specified. For paired samples, either "paireddifference" or "pairedgroups" can be used. Partial matching also allows shortened forms such as "unpaired" or "paireddiff". |
... |
Depends on the specific function that is called according
to the |
See cgOneFactorData
and
cgPairedDifferenceData
for possible valid objects that are created,
dependent on the type
and ...
arguments that are correctly specified.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
prepareCGOneFactorData
,
prepareCGPairedDifferenceData
data(canine) canine.data <- prepare(type="unpairedgroups", dfr=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 <- prepare(type="onefactor", dfr=gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## Paired Groups data(anorexiaFT) anorexiaFT.data <- prepare(type="paireddiff", ## Partial matching dfr=anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE)
data(canine) canine.data <- prepare(type="unpairedgroups", dfr=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 <- prepare(type="onefactor", dfr=gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## Paired Groups data(anorexiaFT) anorexiaFT.data <- prepare(type="paireddiff", ## Partial matching dfr=anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE)
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.
prepareCGOneFactorData(dfr, format = "listed", analysisname = "", endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL, addconstant = NULL, rightcensor = NULL, leftcensor = NULL, digits = NULL, refgrp = NULL, stamps = FALSE)
prepareCGOneFactorData(dfr, format = "listed", analysisname = "", endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL, addconstant = NULL, rightcensor = NULL, leftcensor = NULL, digits = NULL, refgrp = NULL, stamps = FALSE)
dfr |
A valid data frame, see the |
format |
Default value of
|
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 value or expression. The default
value is the empty |
logscale |
Apply a log-transformation to the data for
evaluations. The default value is |
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 ( |
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 |
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 |
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 |
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 |
stamps |
Optional, specify a time stamp in graphs, along
with cg package
version identification. The default value is |
The input data frame dfr
can be of the format
"listed"
or "groupcolumns"
. Another distinguishing
characteristic is whether or not it contains censored data
representations.
Censored observations can be represented by <
for
left-censoring
and >
for
right-censoring. The <
value refers to values less than or equal
to a numeric value. For example, <0.76
denotes a left-censored
value of 0.76
or less. Similarly, >2.02
denotes a value of 2.02 or greater for
a right-censored value. There must be no space between the direction
indicator and the numeric value. These representations can be used in
either the listed
or groupcolumns
formats for dfr
.
No interval-censored representations are currently handled when
format="groupcolumns"
.
If format="groupcolumns"
for dfr
is specified, then the
number of columns must equal the number of groups, and any censored
values must follow the <
and >
representations.
The individual group values are of mode character, since any
censored values will be represented for example as <0.76
or
>2.02
. If any of the groups have less number of
observations than any others, i.e. there are unequal sample sizes,
then the corresponding "no data" cells in the data frame need to
contain empty quote ""
values.
If format="listed"
for dfr
is specified, then there may be
anywhere from two to four columns for an input data frame.
The first column has the group levels to define the
factor, and the second column contains the response values. Censored
representations of <
and >
can be used here. One or
both of
rightcensor
or leftcensor
may also be specified as a
number. If
a number is specified for rightcensor
, then all values in
the second column equal to this value will be processed as
right-censored. Analogously, if
a number is specified for leftcensor
, then all values in
the second column equal to this value will be processed as
left-censored. WARNING: This should be used cautiously to make sure the
equality occurs as desired. This convention is designed for simple
Type I censoring scenarios.
Like the two column case, the first column has
the group
levels to define the
factor, and the second column contains the response values, which will
all be coerced to numeric. Any censoring information must be specified
in the third column. Borrowing the convention of Surv
from the survival package, 0
=right censored, 1
=no censoring, and
2
=left censored. If rightcensor=NULL
and
leftcensor=NULL
are left as defaults in the call, and
values of 0, 1, and 2 are all represented, then the
processing will create a suitable data frame dfru
for
modeling that the canonical survreg
function understands.
However, if 0 and 1 are the only specified values
in the third censoring status column, then one of
rightcensor=TRUE
or leftcensor=TRUE
must be specified,
but NOT both, or an error message will occur. A column of all 1's or
all 0's will also raise an error message.
Like the two column case, the first column has
the group
levels to define the
factor. The second and third columns need to have numeric response
information, and the fourth column needs to have censoring
status. This is the most general representation, where any combination
of left-censoring, right-censoring, and interval-censoring is
permitted. The rightcensor
and leftcensor
input
arguments are ignored and set to NULL
. IMPORTANT: The
convention of Surv
from the survival package, 0=right censored, 1=no censoring, and
2=left censored, 3=interval censored, and
type="interval"
,
is followed. For status=0, 1, and 2, the second and
third columns match in value, so that the status variable in the
fourth column distinguishes the lower and upper bounds for the
right-censored (0) and left-censored (2) cases.
For status=3, the two values differ to
define the interval boundaries. The
processing will create a suitable data frame dfru
for
modeling that the canonical survreg
and survfit
functions from the survival package understand.
If zeroscore="estimate"
is specified, a number
close to zero is derived to replace all zeroes for subsequent
log-scale analyses. A spline fit (using spline
and
method="natural"
)
of the log of the
response vector on the original response vector is performed. The
zeroscore is then derived from the log-scale value of the spline curve at the original
scale value of zero. This approach comes from the concept of
arithmetic-logarithmic scaling discussed in Tukey, Ciminera, and
Heyse (1985).
If addconstant="simple"
or
addconstant="VR"
is specified, a number is derived and added
to all response values.
"simple"
Taken from the "white" book on S (Chambers and Hastie, 1992),
page 68. The range (max - min
) of the response values
is multiplied by 0.0001
to derive the number to add to all the
response values.
"VR"
Based on the logtrans
function discussed in Venables and Ripley
(2002), pages 171-172 and available in the MASS
package. The algorithm applies a Box-Cox profile likelihood
approach with a log scale translation model.
A cgOneFactorData
object is returned, with the following slots:
dfr |
The original input data frame that is the specified value of the
|
dfru |
Processed version of the input data frame, which will be used for the various evaluation methods. |
fmt.dfru |
A list version of the input data frame, which will only
differ from the |
has.censored |
Boolean |
settings |
A list of properties associated with the data frame:
|
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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.
Surv
, canine
,
gmcsfcens
,
prepare
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)
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)
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.
prepareCGPairedDifferenceData(dfr, format = "listed", analysisname = "", endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL, addconstant = NULL, digits = NULL, expunitname= "", refgrp = NULL, stamps = FALSE)
prepareCGPairedDifferenceData(dfr, format = "listed", analysisname = "", endptname = "", endptunits = "", logscale = TRUE, zeroscore = NULL, addconstant = NULL, digits = NULL, expunitname= "", refgrp = NULL, stamps = FALSE)
dfr |
A valid data frame, see the |
format |
Default value of
|
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 value or expression. The default
value is the empty |
logscale |
Apply a log-transformation to the data for
evaluations. The default value is |
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 ( |
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 |
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 |
stamps |
Optional, specify a time stamp in graphs, along
with cg package
version identification. The default value is |
The input data frame dfr
can be of the format
"listed"
or "groupcolumns"
.
If format="listed"
for dfr
is specified, then there
must be three columns for an input data frame. The first column
needs to be the experimental unit identifier,
the second column needs to be the group identifier,
and the third is the endpoint. The first column of the listed input data format,
needs to have two sets of distinct values since it is the
experimental unit identifier of response pairs. The second column of the listed
input data format needs to have exactly 2 distinct values since
it is the group identifier.
If format="groupcolumns"
for dfr
is specified, then
there can be two columns or three columns.
The column headers specify the two
paired group names. Each row contains the experimental unit
of paired numeric values under those two groups. In the
course of creating the cgPairedDifferenceData
object,
another column will be binded from the left and become the
first column, with the column header of
expunitname
is specified, and "expunit" if the default
expunitname=""
is specified. A sequence of integers
starting with 1 up to the number of pairs/rows will be
generated to uniquely identify each experimental unit pair.
The first column needs to be unique
experimental unit identifiers of the paired numeric values in
the second and third columns. The second and third column
headers will be used to identify the two paired group names.
Each row's second and third column needs to contain the experimental unit
of paired numeric values under those two groups. The name of
the first column will be assigned to the expunitname
setting if expunitname
is not explicity specified to
something else instead of its default expunitname=""
.
As the evaluation data set is prepared for
cgPairedDifferenceData
object, any experimental unit
pairs/rows with
missing values in the
endpoint are flagged. This includes a check to make sure that each
experimental unit identified has a complete pair of numeric observations.
If zeroscore="estimate"
is specified, a number
close to zero is derived to replace all zeroes for subsequent
log-scale analyses. A spline fit (using spline
and
method="natural"
)
of the log of the
response vector on the original response vector is performed. The
zeroscore is then derived from the log-scale value of the spline curve at the original
scale value of zero. This approach comes from the concept of
arithmetic-logarithmic scaling discussed in Tukey, Ciminera, and
Heyse (1985).
If addconstant="simple"
is specified, a number is derived and added
to all response values. The approach taken is
from the "white" book on S (Chambers and Hastie, 1992),
page 68. The range (max - min
) of the response values is
multiplied by 0.0001
to derive the number to add to all the
response values.
A cgPairedDifferenceData
object is returned, with the following slots:
dfr |
The original input data frame that is the specified value of the
|
dfru |
Processed version of the input data frame, which will be used for the various evaluation methods. |
dfr.gcfmt |
A groupcolumns version of the input data frame with
an additional column of the differences between groups, where the
|
settings |
A list of properties associated with the data frame:
|
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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.
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE)
Print a cgOneFactorComparisonsTable
object, which contains a
table of comparisons based on the cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorComparisonsTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorComparisonsTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
An |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the table.
If |
endptname |
The endpoint name, printed out with the table.
If |
... |
Additional arguments. Only one is currently valid:
For other possible |
The smallest actual p-value that will be printed is 0.001
. Anything
less than 0.001
will be displayed as < 0.001
. If you
need more digits, see the cgOneFactorComparisonsTable
object.
The object is printed using a mix of cat
and print
calls. See cgOneFactorComparisonsTable
for details of the *.comprs
and other object slots.
print.cgOneFactorComparisonsTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) print(canine.comps0, digits=1) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") print(canine.comps1, model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.comps0 <- comparisonsTable(canine.fit) print(canine.comps0, digits=1) canine.comps1 <- comparisonsTable(canine.fit, mcadjust=TRUE, type="allgroupstocontrol", refgrp="CC") print(canine.comps1, model="olsonly")
Print a cgOneFactorDescriptiveTable
object, which contains a table of
quantiles and other summary statistics of the data from a
cgOneFactorData
object.
## S4 method for signature 'cgOneFactorDescriptiveTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorDescriptiveTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
A |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the table. If |
endptname |
The endpoint name of the data summarized in the table. If NULL, it is set to
the |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See
cgOneFactorDescriptiveTable
for details of the contents
and other object slots.
print.cgOneFactorDescriptiveTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## Next two calls are equivalent descriptiveTable(canine.data) print(descriptiveTable(canine.data, display="none")) print(descriptiveTable(canine.data, display="none"), title="Quantiles and Summary Statistics") ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## Next two calls are equivalent descriptiveTable(gmcsfcens.data, display="print") print(descriptiveTable(gmcsfcens.data, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") ## Next two calls are equivalent descriptiveTable(canine.data) print(descriptiveTable(canine.data, display="none")) print(descriptiveTable(canine.data, display="none"), title="Quantiles and Summary Statistics") ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) ## Next two calls are equivalent descriptiveTable(gmcsfcens.data, display="print") print(descriptiveTable(gmcsfcens.data, display="none"))
Print a cgOneFactorDownweightedTable
object, as a
table of downweighted observations in a resistant & robust fit from a
cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorDownweightedTable' print(x, digits=NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorDownweightedTable' print(x, digits=NULL, title = NULL, endptname = NULL, ...)
x |
An object of class |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the p-value.
If |
endptname |
The endpoint name, printed out with the p-value.
If |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See cgOneFactorDownweightedTable
for details of the contents
and other object slots.
print.cgOneFactorDownweightedTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console. If any observations meet the cutoff criteria, a
table is displayed.
If no observations meet the cutoff criteria, a text message of table emptiness is displayed instead.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25%
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.dwtable <- downweightedTable(canine.fit, cutoff=0.95) downweightedTable(canine.fit, cutoff=0.75) ## No observation ## downweighted at least 25%
Print a cgOneFactorFit
object, which contains fitted model information.
## S4 method for signature 'cgOneFactorFit' print(x, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorFit' print(x, title = NULL, endptname = NULL, ...)
x |
An |
title |
The title printed out with the fitted model information.
If |
endptname |
The endpoint name, printed out with the fitted model information.
If |
... |
Additional arguments. Only one is currently valid:
For other possible |
The object is printed using a mix of cat
and print
calls. See cgOneFactorFit
for details of the *fit
and other object slots.
This method simply echoes print methods for individual fit classes,
such as lm
and rlm
.
Note that show
is an alias for print
for this method. A
showObj.cgOneFactorFit
method is defined to display the
raw form of the object.
print.cgOneFactorFit
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) print(canine.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) print(canine.fit)
Print a cgOneFactorGlobalTest
object, which contains global
F-test p-value information taken from a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorGlobalTest' print(x, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorGlobalTest' print(x, title = NULL, endptname = NULL, ...)
x |
An |
title |
The title printed out with the p-value.
If |
endptname |
The endpoint name, printed out with the p-value.
If |
... |
Additional arguments. Only one is currently valid:
For other possible |
The smallest actual p-value that will be printed is 0.001
. Anything
less than 0.001
will be displayed as < 0.001
. If you
need more digits, see the cgOneFactorGlobalTest
object.
The notion of a global F test, or equivalently, of ,
for resistant & robust linear models is
murky, as no clear theoretical analogue to the ordinary classical
least squares approach exists. See
cgOneFactorGlobalTest
for details, and regard the output p-value here as ad-hoc.
The object is printed using a mix of cat
and print
calls. See cgOneFactorGlobalTest
for details of the *.gpval
and other object slots.
print.cgOneFactorGlobalTest
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.global <- globalTest(canine.fit) print(canine.global)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.global <- globalTest(canine.fit) print(canine.global)
Print a cgOneFactorGrpSummaryTable
object, which contains a
table of group means and variability based on the cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorGrpSummaryTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorGrpSummaryTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
An |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the table.
If |
endptname |
The endpoint name, printed out with the table.
If |
... |
Additional arguments. Only one is currently valid:
For other possible |
The object is printed using a mix of cat
and print
calls. See cgOneFactorGrpSummaryTable
for details of the *.grps
and other object slots.
print.cgOneFactorGrpSummaryTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.grpsumm <- grpSummaryTable(canine.fit) print(canine.grpsumm, digits=2)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.grpsumm <- grpSummaryTable(canine.fit) print(canine.grpsumm, digits=2)
Print a cgOneFactorSampleSizeTable
object, which contains a table of
sample size estimates based on a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorSampleSizeTable' print(x, title=NULL, endptname=NULL, ...)
## S4 method for signature 'cgOneFactorSampleSizeTable' print(x, title=NULL, endptname=NULL, ...)
x |
A |
title |
The title for the table. If |
endptname |
The endpoint name, printed out with the table.
If |
... |
Additional arguments. Currently one is valid:
|
The object is printed using a mix of cat
and print
calls. See
cgOneFactorSampleSizeTable
for details of the *.sstable
and other object slots.
print.cgOneFactorSampleSizeTable
returns invisible
.
The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", model="olsonly", mmdvec=c(10, 25, 50, 75, 100), display="none") print(canine.samplesize)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", model="olsonly", mmdvec=c(10, 25, 50, 75, 100), display="none") print(canine.samplesize)
Print a cgPairedDifferenceComparisonsTable
object, which contains a
table of comparisons based on the cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceComparisonsTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceComparisonsTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
An |
digits |
The number of decimal places to use in the output.
If |
title |
The title printed out with the table. If |
endptname |
The endpoint name, printed out with the table.
If |
... |
Additional arguments. Only one is currently valid:
|
The smallest actual p-value that will be printed is 0.001
. Anything
less than 0.001
will be displayed as < 0.001
. If you
need more digits, see the cgPairedDifferenceComparisonsTable
object.
The object is printed using a mix of cat
and print
calls. See cgPairedDifferenceComparisonsTable
for details of the *.comprs
and other object slots.
print.cgPairedDifferenceComparisonsTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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) anorexiaFT.comps <- comparisonsTable(anorexiaFT.fit) print(anorexiaFT.comps, digits=2) print(anorexiaFT.comps, model="olsonly")
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) anorexiaFT.comps <- comparisonsTable(anorexiaFT.fit) print(anorexiaFT.comps, digits=2) print(anorexiaFT.comps, model="olsonly")
Print a cgPairedDifferenceCorrelationTable
object, which contains a table of
correlations of the data from a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceCorrelationTable' print(x, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceCorrelationTable' print(x, title = NULL, endptname = NULL, ...)
x |
A |
title |
The title printed out with the table. If |
endptname |
The endpoint name of the data summarized in the table. If NULL, it is set to
the |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See
cgPairedDifferenceCorrelationTable
for details of the contents
and other object slots.
Two decimal places are used in the display of the correlations.
print.cgPairedDifferenceCorrelationTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceCorrelationTable
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent correlationTable(anorexiaFT.data) print(correlationTable(anorexiaFT.data, display="none")) ## A change in title print(correlationTable(anorexiaFT.data, display="none"), title="Correlations")
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent correlationTable(anorexiaFT.data) print(correlationTable(anorexiaFT.data, display="none")) ## A change in title print(correlationTable(anorexiaFT.data, display="none"), title="Correlations")
Print a cgPairedDifferenceDescriptiveTable
object, which contains a table of
quantiles and other summary statistics of the data from a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceDescriptiveTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceDescriptiveTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
A |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the table. If |
endptname |
The endpoint name of the data summarized in the table. If NULL, it is set to
the |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See
cgPairedDifferenceDescriptiveTable
for details of the contents
and other object slots.
print.cgPairedDifferenceDescriptiveTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceDescriptiveTable
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent descriptiveTable(anorexiaFT.data) print(descriptiveTable(anorexiaFT.data, display="none")) ## A change in title print(descriptiveTable(anorexiaFT.data, display="none"), title="Quantiles and Summary Statistics")
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent descriptiveTable(anorexiaFT.data) print(descriptiveTable(anorexiaFT.data, display="none")) ## A change in title print(descriptiveTable(anorexiaFT.data, display="none"), title="Quantiles and Summary Statistics")
Print a cgPairedDifferenceDownweightedTable
object, as a
table of downweighted observations in a resistant & robust fit from a
cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceDownweightedTable' print(x, digits=NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceDownweightedTable' print(x, digits=NULL, title = NULL, endptname = NULL, ...)
x |
An object of class |
digits |
The number of decimal places to use in the output. If |
title |
The title printed out with the p-value.
If |
endptname |
The endpoint name, printed out with the p-value.
If |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See cgPairedDifferenceDownweightedTable
for details of the contents
and other object slots.
print.cgPairedDifferenceDownweightedTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console. If any observations meet the cutoff criteria, a
table is displayed.
If no observations meet the cutoff criteria, a text message of table emptiness is displayed instead.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceDownweightedTable
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) anorexiaFT.dw <- downweightedTable(anorexiaFT.fit, cutoffwt=0.25, display='none') print(anorexiaFT.dw) ## No observation
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) anorexiaFT.dw <- downweightedTable(anorexiaFT.fit, cutoffwt=0.25, display='none') print(anorexiaFT.dw) ## No observation
Print a cgPairedDifferenceFit
object, which contains fitted model information.
## S4 method for signature 'cgPairedDifferenceFit' print(x, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceFit' print(x, title = NULL, endptname = NULL, ...)
x |
An |
title |
The title printed out with the fitted model information.
If |
endptname |
The endpoint name, printed out with the fitted model information.
If |
... |
Additional arguments. Only one is currently valid:
|
The object is printed using a mix of cat
and print
calls. See cgPairedDifferenceFit
for details of the *fit
and other object slots.
This method simply echoes print methods for individual fit classes,
such as lm
and rlm
.
Note that show
is an alias for print
for this method. A
showObj.cgPairedDifferenceFit
method is defined to display the
raw form of the object.
print.cgPairedDifferenceFit
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorFit
, cgPairedDifferenceFit
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr") print(anorexiaFT.fit)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr") print(anorexiaFT.fit)
Print a cgPairedDifferenceSampleSizeTable
object, which contains a table of
sample size estimates based on a cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' print(x, title=NULL, endptname=NULL, ...)
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' print(x, title=NULL, endptname=NULL, ...)
x |
A |
title |
The title for the table. If |
endptname |
The endpoint name, printed out with the table.
If |
... |
Additional arguments. None are currently defined. |
The object is printed using a mix of cat
and print
calls. See
cgPairedDifferenceSampleSizeTable
for details of the *.sstable
and other object slots.
print.cgPairedDifferenceSampleSizeTable
returns invisible
.
The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceSampleSizeTable
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), display="none") print(anorexiaFT.samplesize) ## The above two calls produce the same screen output as samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20)) ## since the default in the call is display="print"
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), display="none") print(anorexiaFT.samplesize) ## The above two calls produce the same screen output as samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20)) ## since the default in the call is display="print"
Print a cgPairedDifferenceVarianceTable
object, which contains a table of
variances from a
cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceVarianceTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceVarianceTable' print(x, digits = NULL, title = NULL, endptname = NULL, ...)
x |
A |
digits |
The number of decimal places to use in the output, after any leading
zeroes right of the decimal point.
If |
title |
The title printed out with the table. If |
endptname |
The endpoint name of the data summarized in the table. If NULL, it is set to
the |
... |
Additional arguments. None are currently defined for this method. |
The object is printed using a mix of cat
and print
calls. See
cgPairedDifferenceVarianceTable
for details of the contents
and other object slots.
Two decimal places (after any leading zeroes) are used by default in the display of the variances.
As described in cgPairedDifferenceVarianceTable
, the
table displays a decomposition of the total variance into its
within-experimental unit and between-experimential
unit variance compoments. The variance estimates are provided in the
first column, and the relative percents of these two components are in
the second column. The third column is the square root of the
first column of variances, to provide Spread/StdDev
values in
the units of the endpoint.
Below the printed table is a series of Notes. The first note narrates the estimated gain in sensitivity from using a paired groups design instead of an unpaired groups design. The gains are expressed in terms of reduced experimental unit sample size.
The label portion "experimental unit" in the printed output
is replaced by the expunitname
component of the
settings
slot of the cgPairedDifferenceVarianceTable
object.
print.cgPairedDifferenceVarianceTable
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceVarianceTable
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) ## Next two calls are equivalent varianceTable(anorexiaFT.fit) print(varianceTable(anorexiaFT.fit, display="none")) ## A change in title print(varianceTable(anorexiaFT.fit, display="none"), title="Estimated Variances") ## Show three digits in display print(varianceTable(anorexiaFT.fit), digits=3)
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) ## Next two calls are equivalent varianceTable(anorexiaFT.fit) print(varianceTable(anorexiaFT.fit, display="none")) ## A change in title print(varianceTable(anorexiaFT.fit, display="none"), title="Estimated Variances") ## Show three digits in display print(varianceTable(anorexiaFT.fit), digits=3)
Generic function to create a graph of experimental unit profiles of a data object created by the cg package.
profileGraph(data, ...)
profileGraph(data, ...)
data |
A data object created with a |
... |
Additional arguments, depending on the specific method written for
the object. Currently, there is only one such specific method; see
|
Individual points are jitter
ed, and open circles
are used to alleviate potential overlap and the danger of representing
multiple points as a single point.
The profile graph for paired difference data is the simplest of profiles as each experimental unit has exactly two points connected by a straight line. Labels for the experimental units are added for identification.
Minimum and maximum values from ranges of data are respectively labeled in the bottom and top left corners of graph regions.
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 main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
profileGraph.cgPairedDifferenceData
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) profileGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. profileGraph(anorexiaFT.data, logscale=FALSE)
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) profileGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. profileGraph(anorexiaFT.data, logscale=FALSE)
Create a profile graph of the data in a cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceData' profileGraph(data, ...)
## S4 method for signature 'cgPairedDifferenceData' profileGraph(data, ...)
data |
A |
... |
Additional arguments, both optional. Two are currently valid:
|
The profile graph for paired difference data is the simplest of profiles as each experimental unit has exactly two points connected by a straight line. Labels for the experimental units are added for identification.
Individual points are jitter
ed, and open circles
are used to alleviate potential overlap and the danger of representing
multiple points as a single point.
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 heading for the graph is taken from the cgPairedDifferenceData
object,
whichprepareCGPairedDifferenceData
sets from its analysisname
argument.
The label for the y-axis is taken from the cgPairedDifferenceData
object,
whichprepareCGPairedDifferenceData
sets from its endptname
and endptunits
arguments.
The number of decimal places printed in the ticks on the y-axis is taken
from the cgPairedDifferenceData
object,
which prepareCGPairedDifferenceData
sets from its digits
argument.
Minimum and maximum values from ranges of data are respectively labeled in the bottom and top left corners of graph regions.
profileGraph.cgPairedDifferenceData
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) profileGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. profileGraph(anorexiaFT.data, logscale=FALSE)
data(anorexia.FT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) profileGraph(anorexiaFT.data) # Graph the data on the original scale instead of the log scale. profileGraph(anorexiaFT.data, logscale=FALSE)
Create a Quantile-Quantile (Q-Q) Gaussian graph of the residuals of a fitted object from the cg package.
qqGraph(fit, line = TRUE, cgtheme = TRUE, device = "single", ...)
qqGraph(fit, line = TRUE, cgtheme = TRUE, device = "single", ...)
fit |
A fit object, typically created by the |
line |
Add a line to help assess the distribution of the residuals. See
specific method written for the |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
qqGraph
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) qqGraph(canine.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) qqGraph(canine.fit)
Create a Q-Q Gaussian graph of the residuals of a cgOneFactorFit object
## S4 method for signature 'cgOneFactorFit' qqGraph(fit, line=NULL, cgtheme = TRUE, device = "single", ...)
## S4 method for signature 'cgOneFactorFit' qqGraph(fit, line=NULL, cgtheme = TRUE, device = "single", ...)
fit |
A fit object of class |
line |
Add a line through the estimated 25th and 75th percentiles.
When set to the default |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments. One is currently valid:
|
For censored data residuals, left-censored values are shown as a shallow "V", which is actually just a rotated downward "<" sign. Similarly, right-censored values are shown as a deeper "^", which is a rotated upwared ">" sign.
For the line
argument, an added line when censored data residuals
are present needs to be interpreted very cautiously. If "too many"
censored data values are present, the line will appear nonsensical if
indeed it can even be estimated with 25th and 75th percentiles in the
presence of the the censored data residuals. These percentiles are
estimated via the Kaplan-Meier method as proposed by Gentleman and Crowley
(1991), with the survival::survfit
function.
The heading for the graph is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its analysisname
argument.
The label for the Y-axis of residuals is derived from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its endptname
argument.
The number of decimal places printed in the ticks on the Y-axis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
The minimum and maximum values from the range of the residuals are respectively labeled in the bottom and top left corners of the graph region.
qqGraph.cgOneFactorFit
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Gentleman, R.C. and Crowley, J. (1991). "Graphical Methods for Censored Data", Journal of the American Statistical Association, Volume 86, 678-683.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) qqGraph(canine.fit) qqGraph(canine.fit, model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) qqGraph(canine.fit) qqGraph(canine.fit, model="olsonly")
Create a Q-Q Gaussian graph of the residuals of a cgPairedDifferenceFit object
## S4 method for signature 'cgPairedDifferenceFit' qqGraph(fit, line=TRUE, cgtheme = TRUE, device = "single", ...)
## S4 method for signature 'cgPairedDifferenceFit' qqGraph(fit, line=TRUE, cgtheme = TRUE, device = "single", ...)
fit |
A fit object of class |
line |
Add a line through the estimated 25th and 75th percentiles,
when set to the default |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments. One is currently valid:
|
The heading for the graph is taken from the cgPairedDifferenceData
object,
whichprepareCGPairedDifferenceData
sets from its analysisname
argument.
The label for the Y-axis is taken from the cgPairedDifferenceData
object,
whichprepareCGPairedDifferenceData
sets from its endptname
argument.
The number of decimal places printed in the ticks on the Y-axis is taken
from the cgPairedDifferenceData
object,
which prepareCGPairedDifferenceData
sets from its digits
argument.
The minimum and maximum values from the range of the residuals are respectively labeled in the bottom and top left corners of the graph region.
qqGraph.cgPairedDifferenceFit
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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) qqGraph(anorexiaFT.fit) qqGraph(anorexiaFT.fit, model="olsonly")
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) qqGraph(anorexiaFT.fit) qqGraph(anorexiaFT.fit, model="olsonly")
Generic function to graph a table of estimated sample sizes, using a Sample Size table created by the cg package.
samplesizeGraph(sstable, Nscale = "log", mmdscale = "log", ...)
samplesizeGraph(sstable, Nscale = "log", mmdscale = "log", ...)
sstable |
A |
Nscale |
A |
mmdscale |
A |
... |
Additional arguments, depending on the specific method written for the object. See the specific methods for additional details. |
The main purpose is the side effect of graphing to the current device. See the specific methods for discussion of any return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
samplesizeGraph.cgOneFactorSampleSizeTable
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize) #### Paired Difference data 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)
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize) #### Paired Difference data 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)
Creates a graph to see estimated sample sizes in a cgOneFactorSampleSizeTable object.
## S4 method for signature 'cgOneFactorSampleSizeTable' samplesizeGraph(sstable, Nscale="log", mmdscale = "log", ...)
## S4 method for signature 'cgOneFactorSampleSizeTable' samplesizeGraph(sstable, Nscale="log", mmdscale = "log", ...)
sstable |
A sample size object of class |
Nscale |
A |
mmdscale |
A |
... |
Additional arguments:
|
The minimum and maximum 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
cgOneFactorSampleSizeTable
object.
samplesizeGraph.cgOneFactorSampleSizeTable
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) ## print method shows table samplesizeGraph(canine.samplesize) samplesizeGraph(canine.samplesize, model="olsonly", mmdticklabels=list(mod="add", marks=100))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) ## print method shows table samplesizeGraph(canine.samplesize) samplesizeGraph(canine.samplesize, model="olsonly", mmdticklabels=list(mod="add", marks=100))
Creates a graph to see estimated sample sizes in a cgPairedDifferenceSampleSizeTable object.
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' samplesizeGraph(sstable, Nscale, mmdscale, ...)
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' samplesizeGraph(sstable, Nscale, mmdscale, ...)
sstable |
A sample size object of class |
Nscale |
A |
mmdscale |
A |
... |
Additional arguments. Two are currently valid:
|
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.
samplesizeGraph.cgPairedDifferenceSampleSizeTable
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceSampleSizeTable
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))
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))
Estimate the sample size required to detect a specified difference in a future study. The estimate is based on the variability in a data fit with the cg package.
samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
fit |
An object created by calling a
|
direction |
A |
mmdvec |
A |
power |
The power for the future study, set by default to be |
alpha |
The significance level or alpha for the future study, set by default
as |
nmax |
The maximum number of subjects per group. If more subjects are estimated to be required, than the exact number required is not reported, only the fact that more than the maximum number would be required. This is in place to prevent long and likely unnecessary calculations. |
display |
One of three valid values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
A method-specific SampleSizeTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
samplesizeTable.cgOneFactorFit
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize)
#### One Factor data data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeGraph(canine.samplesize)
Estimate the sample size that would be required to detect a specified difference in a one factor study. The estimate is based on the variability that was observed in a previous one factor study. A cgOneFactorSampleSizeTable class object is created.
## S4 method for signature 'cgOneFactorFit' samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
## S4 method for signature 'cgOneFactorFit' samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
fit |
A |
direction |
A |
mmdvec |
A |
power |
The power for the future study, set by default to be |
alpha |
The significance level or alpha for the future study, set by default
as |
nmax |
The maximum number of subjects per group. If more subjects are estimated to be required, then the exact number required is not reported, only the fact that more than the maximum number would be required. This is in place to prevent long and likely unnecessary calculations. |
display |
One of three valid values:
|
... |
Additional arguments.
|
This sample size method does not work for fitted models that allowed unequal variances or censored observations.
Sample sizes are estimated for detecting a minimum difference with a global
F test. The algorithm is detailed in Fleiss (1986), Appendix A. When
there are more than 2 groups, the lower bound of possible
noncentrality parameter values is calculated from assuming only two of
the ngrps
number of groups differ by the mmdvec/2
amount
from the "grand mean" while the rest of the groups are equal to the grand
mean.
For detecting an absolute difference, the sample size is the
smallest group size n for which1 - pf (qf (1 - alpha, numdf, dendf), numdf,
dendf, ncp)
exceeds power
,
where ncp = (n * mmdvec ^ 2) / (2 *
sigamest ^ 2)
, and sigmaest
is the residual mean square error from the model in
fit
. For detecting a relative difference, the calculations are
the same exceptncp = (n * (log (sign * mmdvec / 100 + 1) ) ^ 2) / (2
* sigmaest ^ 2)
, wheresign = -1
if direction="decreasing"
,
and sign = 1
if direction = "increasing"
.
Creates an object of class cgOneFactorSampleSizeTable
, with the
following slots:
ols.sstable
A matrix with the estimated sample sizes based on the
classical model variance estimates, or NULL
. The matrix has 3 columns and
one row for each element of the mmdvec
vector
.
The first column specifies the minimum meaningful difference ("mmd"
).
The second column gives the number of subjects required for each
group ("n"
), possibly truncated at nmax
.
The third column gives the total number of
subjects required ("N"
), also truncated if
nmax
is truncated.
rr.sstable
A matrix with the estimated sample sizes based on the
robust model variance estimates, or else NULL
if
model="olsonly"
was specified. See the ols.sstable
slot description above for the analogous layout of the matrix.
settings
A list of properties mostly carried as-is from the
data
argument object of class
cgOneFactorData
, with the following additional members:
sigmaest
A list with 2 members, ols
, containing the
estimated spread (sigma, standard deviation) from
the classical model of fit
,
and rr
,
containing the estimated spread (sigma, standard deviation)
from the robust model of
fit
, or
NULL
if the robust model was not fit.
planningname
A character
describing the study
or purpose of the sample size analysis. Taken from the
settings$analysisname
of the fit
object.
ngrps
A saved copy of the ngrps
argument.
direction
A saved copy of the direction
argument.
alpha
A saved copy of the alpha
argument.
power
A saved copy of the power
argument.
nmax
A saved copy of the nmax
argument.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
Fleiss, J.L. (1986). The Design and Analysis of Clinical Experiments, Appendix A, pages 371 - 376. New York: Wiley.
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeTable(canine.fit, direction="decreasing", mmdvec=c(25, 50, 75), model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) canine.samplesize <- samplesizeTable(canine.fit, direction="increasing", mmdvec=c(10, 25, 50, 75, 100)) samplesizeTable(canine.fit, direction="decreasing", mmdvec=c(25, 50, 75), model="olsonly")
Estimate the sample size that would be required to detect a specified difference in a paired difference data study. The estimate is based on the variability that was observed in a previous paired difference data study. A cgPairedDifferenceSampleSizeTable class object is created.
## S4 method for signature 'cgPairedDifferenceFit' samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
## S4 method for signature 'cgPairedDifferenceFit' samplesizeTable(fit, direction, mmdvec, power = 0.80, alpha = 0.05, nmax = 1000, display = "print", ...)
fit |
A |
direction |
A |
mmdvec |
A |
power |
The power for the future study, set by default to be |
alpha |
The significance level or alpha for the future study, set by default
as |
nmax |
The maximum number of subjects per group. If more subjects are estimated to be required, than the exact number required is not reported, only the fact that more than the maximum number would be required. This is in place to prevent long and likely unnecessary calculations. |
display |
One of three valid values:
|
... |
Additional arguments. Only one is currently valid:
|
Here, the estimated sample size actually refers to the number of experimental units. Hence the number of observations will always be twice the number of experimental units, due to the paired structure.
This sample size method only works for the classical least squares fitted model, since there is no analogous decomposition of total variance into between-experimental unit and within-experimental unit variance components. Sample sizes are estimated for detecting a minimum difference with the classical least squares t-test / F-test.
The correction = "df"
argument specifies a method that Fleiss
(1986, pages 129-130) attributes to Cochran and Cox (1957) and Fisher.
The correction decreases the relative efficiency that is calculated
from accounting for correlated paired observations, relative to the unpaired two group
design. The adjustment accounts for the different degrees of freedom
used for the variance components in the paired design
(between-experimental unit, within-experimettal unit, total variability.)
Since the correction reduces the relative efficiency, and the
noncentrality parameter is also reduced. The correction
is a multiplicative factor bounded below
by 0.833 and approaches 1 as the number of experimental units
increments from the minimum of n=2
. The reduction in the
noncentrality parameter increases the computed sample size.
Creates an object of class cgPairedDifferenceSampleSizeTable
, with the
following slots:
ols.sstable
A matrix with the estimated experimental
unit sample sizes based on the
classical model variance estimates. The matrix has 3 columns and
one row for each element of the mmdvec
vector
.
The first column specifies the minimum meaningful difference ("mmd"
).
The second column gives the number of experimental units
("n"
) required,
possibly truncated at nmax
.
The third column gives the total number of
observations ("N"
), also possibly truncated at
nmax
. Since this for the paired groups design, N = n
* 2
will always hold.
settings
A list of properties mostly carried as-is from the
data
argument object of class
cgPairedDifferenceData
, with the following additional members:
sigmaest
A list with 1 member, ols
, containing the
estimated spread (sigma, standard deviation) variance
estimates from
the classical model of fit
. This list component is a
vector of length 3, providing the within-experimental unit,
between experimental unit, and total variability estimates.
planningname
A character
describing the study
or purpose of the sample size analysis. Taken from the
settings$analysisname
of the fit
object.
direction
A saved copy of the direction
argument.
alpha
A saved copy of the alpha
argument.
power
A saved copy of the power
argument.
nmax
A saved copy of the nmax
argument.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis, John Oleynick, and Eva Ye
Fleiss, J. L. (1986). The Design and Analysis of Clinical Experiments, pages 129 - 130. New York: Wiley.
Cochran, W. G. and Cox, G. M. (1957), Experimental Designs. Second edition. Wiley.
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) ## Recall the interest is in increased weight for the anorexia FT ## (family treatment) group of patients samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20)) ## and with the adjustment on the noncentrality parameter samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20), correction="df")
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) ## Recall the interest is in increased weight for the anorexia FT ## (family treatment) group of patients samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20)) ## and with the adjustment on the noncentrality parameter samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20), correction="df")
Show a cgOneFactorComparisonsTable
object, which contains
information of comparisons based on a fit
in a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorComparisonsTable' show(object)
## S4 method for signature 'cgOneFactorComparisonsTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorComparisonsTable
for details of the object slots.
show.cgOneFactorComparisonsTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorComparisonsTable
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(comparisonsTable(canine.fit, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(comparisonsTable(canine.fit, display="none"))
Show a cgOneFactorDescriptiveTable
object, which contains a table of
quantiles and other summary statistics of the data from a
cgOneFactorData
object.
## S4 method for signature 'cgOneFactorDescriptiveTable' show(object)
## S4 method for signature 'cgOneFactorDescriptiveTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorDescriptiveTable
for details of the object slots.
show.cgOneFactorDescriptiveTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorDescriptiveTable
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") show(descriptiveTable(canine.data, display="none")) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) show(descriptiveTable(gmcsfcens.data, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") show(descriptiveTable(canine.data, display="none")) ## Censored Data data(gmcsfcens) gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE) show(descriptiveTable(gmcsfcens.data, display="none"))
Show a cgOneFactorDownweightedTable
object, which contains
information of downweighted observations in a resistant & robust fit
from a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorDownweightedTable' show(object)
## S4 method for signature 'cgOneFactorDownweightedTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorDownweightedTable
for details of the object slots.
show.cgOneFactorDownweightedTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorDownweightedTable
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(downweightedTable(canine.fit, cutoffwt=0.95, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(downweightedTable(canine.fit, cutoffwt=0.95, display="none"))
Show a cgOneFactorGlobalTest
object, which contains p-value
information from a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorGlobalTest' show(object)
## S4 method for signature 'cgOneFactorGlobalTest' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorGlobalTest
for details of the object slots.
show.cgOneFactorGlobalTest
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorGlobalTest
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) globalTest(canine.fit, display="show") show(globalTest(canine.fit, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) globalTest(canine.fit, display="show") show(globalTest(canine.fit, display="none"))
Show a cgOneFactorGrpSummaryTable
object, which contains
information of group mean and standard error summaries based on a fit
in a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorGrpSummaryTable' show(object)
## S4 method for signature 'cgOneFactorGrpSummaryTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorGrpSummaryTable
for details of the object slots.
show.cgOneFactorGrpSummaryTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorGrpSummaryTable
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(grpSummaryTable(canine.fit, display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(grpSummaryTable(canine.fit, display="none"))
Show a cgOneFactorSampleSizeTable
object, which contains a table of
sample size estimates based on a cgOneFactorFit
object.
## S4 method for signature 'cgOneFactorSampleSizeTable' show(object)
## S4 method for signature 'cgOneFactorSampleSizeTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorSampleSizeTable
for details of the object
slots.
show.cgOneFactorSampleSizeTable
returns
invisible
. The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorSampleSizeTable
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(samplesizeTable(canine.fit, direction="increasing", mmdvec=c(25, 50, 75, 100), display="none"))
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) show(samplesizeTable(canine.fit, direction="increasing", mmdvec=c(25, 50, 75, 100), display="none"))
Show a cgPairedDifferenceComparisonsTable
object, which contains
information of comparisons based on a fit
in a cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceComparisonsTable' show(object)
## S4 method for signature 'cgPairedDifferenceComparisonsTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceComparisonsTable
for details of the object slots.
show.cgPairedDifferenceComparisonsTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceComparisonsTable
, showDefault
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) show(comparisonsTable(anorexiaFT.fit, display="none"))
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) show(comparisonsTable(anorexiaFT.fit, display="none"))
Show a cgPairedDifferenceCorrelationTable
object, which contains a table of
correlations of the data from a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceCorrelationTable' show(object)
## S4 method for signature 'cgPairedDifferenceCorrelationTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceCorrelationTable
for details of the object slots.
show.cgPairedDifferenceCorrelationTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceCorrelationTable
, showDefault
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent correlationTable(anorexiaFT.data, display="show") show(correlationTable(anorexiaFT.data, display="none"))
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent correlationTable(anorexiaFT.data, display="show") show(correlationTable(anorexiaFT.data, display="none"))
Show a cgPairedDifferenceDescriptiveTable
object, which contains a table of
quantiles and other summary statistics of the data from a
cgPairedDifferenceData
object.
## S4 method for signature 'cgPairedDifferenceDescriptiveTable' show(object)
## S4 method for signature 'cgPairedDifferenceDescriptiveTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceDescriptiveTable
for details of the object slots.
show.cgPairedDifferenceDescriptiveTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceDescriptiveTable
, showDefault
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent descriptiveTable(anorexiaFT.data, display="show") show(descriptiveTable(anorexiaFT.data, display="none"))
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) ## Next two calls are equivalent descriptiveTable(anorexiaFT.data, display="show") show(descriptiveTable(anorexiaFT.data, display="none"))
Show a cgPairedDifferenceDownweightedTable
object, which contains
information of downweighted observations in a resistant & robust fit
from a cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceDownweightedTable' show(object)
## S4 method for signature 'cgPairedDifferenceDownweightedTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceDownweightedTable
for details of the object slots.
show.cgPairedDifferenceDownweightedTable
returns invisible
.
The main purpose is the side effect of printing the whole object to the current output
connection, which is typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceDownweightedTable
, showDefault
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) show(downweightedTable(anorexiaFT.fit, cutoffwt=0.25, display="none"))
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) show(downweightedTable(anorexiaFT.fit, cutoffwt=0.25, display="none"))
Show a cgPairedDifferenceSampleSizeTable
object, which contains a table of
sample size estimates based on a cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' show(object)
## S4 method for signature 'cgPairedDifferenceSampleSizeTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceSampleSizeTable
for details of the object
slots.
show.cgPairedDifferenceSampleSizeTable
returns
invisible
. The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceSampleSizeTable
, showDefault
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) ## Recall the interest is in increased weight for the anorexia FT ## (family treatment) group of patients show(samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20), display="none"))
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) ## Recall the interest is in increased weight for the anorexia FT ## (family treatment) group of patients show(samplesizeTable(anorexiaFT.fit, direction="increasing", mmdvec=c(5, 10, 15, 20), display="none"))
Show a cgPairedDifferenceVarianceTable
object, which contains a table of
variances from a
cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceVarianceTable' show(object)
## S4 method for signature 'cgPairedDifferenceVarianceTable' show(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceVarianceTable
for details of the object slots.
show.cgPairedDifferenceVarianceTable
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgPairedDifferenceVarianceTable
, showDefault
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) ## Next two calls are equivalent varianceTable(anorexiaFT.fit, display="show") show(varianceTable(anorexiaFT.fit, display="none"))
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) ## Next two calls are equivalent varianceTable(anorexiaFT.fit, display="show") show(varianceTable(anorexiaFT.fit, display="none"))
Show the raw form of an object from the cg package.
showObj(object)
showObj(object)
object |
An object created by the cg package. |
The object raw form is shown using showDefault
. The name
showObj
is designed for use when the conventional show
name is an alias for print
in the cg package.
A method-specific fit
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorFit
, cgPairedDifferenceFit
, showDefault
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) showObj(canine.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) showObj(canine.fit)
Show the raw form of a cgOneFactorFit
object, which contains model fit
information.
## S4 method for signature 'cgOneFactorFit' showObj(object)
## S4 method for signature 'cgOneFactorFit' showObj(object)
object |
A |
The object is shown using showDefault
. See
cgOneFactorFit
for details of the object slots.
The name showObj
is designed for use for cases like this when
the coventional show
name is an alias for print
.
showObj.cgOneFactorFit
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) showObj(canine.fit) show(canine.fit) ## alias for print method on the object
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) showObj(canine.fit) show(canine.fit) ## alias for print method on the object
Show the raw form of a cgPairedDifferenceFit
object, which contains model fit
information.
## S4 method for signature 'cgPairedDifferenceFit' showObj(object)
## S4 method for signature 'cgPairedDifferenceFit' showObj(object)
object |
A |
The object is shown using showDefault
. See
cgPairedDifferenceFit
for details of the object slots.
The name showObj
is designed for use for cases like this when
the coventional show
name is an alias for print
.
showObj.cgPairedDifferenceFit
returns invisible
.
The main purpose is the side
effect of printing the whole object to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
cgOneFactorFit
, cgPairedDifferenceFit
,
showDefault
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr") showObj(anorexiaFT.fit) show(anorexiaFT.fit) ## alias for print method on the object
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr") showObj(anorexiaFT.fit) show(anorexiaFT.fit) ## alias for print method on the object
Summary printing of a cgOneFactorFit
object,
which contains fitted model information.
## S4 method for signature 'cgOneFactorFit' summary(object, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgOneFactorFit' summary(object, title = NULL, endptname = NULL, ...)
object |
An |
title |
The title printed out with the summary of the fitted model(s).
If |
endptname |
The endpoint name, printed out with the fitted model information.
If |
... |
Additional arguments. Only one is currently valid:
For other possible |
The object summary is printed using a mix of cat
and print
calls. See cgOneFactorFit
for details of the *fit
and other object slots.
This method simply echoes summary methods for individual fit classes,
such as lm
and rlm
.
summary.cgOneFactorFit
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) summary(canine.fit)
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) summary(canine.fit)
Summary printing of a cgPairedDifferenceFit
object,
which contains fitted model information.
## S4 method for signature 'cgPairedDifferenceFit' summary(object, title = NULL, endptname = NULL, ...)
## S4 method for signature 'cgPairedDifferenceFit' summary(object, title = NULL, endptname = NULL, ...)
object |
An |
title |
The title printed out with the summary of the fitted model(s).
If |
endptname |
The endpoint name, printed out with the fitted model information.
If |
... |
Additional arguments. Only one is currently valid:
|
The object summary is printed using a mix of cat
and print
calls. See cgPairedDifferenceFit
for details of the *fit
and other object slots.
This method simply echoes summary methods for individual fit classes,
such as lm
and rlm
.
summary.cgPairedDifferenceFit
returns
invisible
. The main purpose is the side
effect of printing to the current output connection, which is
typically the console.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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) summary(anorexiaFT.fit)
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) summary(anorexiaFT.fit)
Create an equal variance assessment graph of the residuals of a fitted object from the cg package
varianceGraph(fit, trend = NULL, cgtheme = TRUE, device = "single", ...)
varianceGraph(fit, trend = NULL, cgtheme = TRUE, device = "single", ...)
fit |
A fit object, typically created by the |
trend |
Add a trend line to help assess the trend of the residuals. See
specific method written for the |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details. |
The graphs plot the square root of the absolute value of the residuals against the fitted value. The notion of using the squared root of the absolute residuals is attributed to John Tukey.
varianceGraph
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) varianceGraph(canine.fit) varianceGraph(canine.fit, model="olsonly")
data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) varianceGraph(canine.fit) varianceGraph(canine.fit, model="olsonly")
Graph residuals of a cgOneFactorFit object to assess equal variance assumption
## S4 method for signature 'cgOneFactorFit' varianceGraph(fit, trend = NULL, cgtheme = TRUE, device = "single", ...)
## S4 method for signature 'cgOneFactorFit' varianceGraph(fit, trend = NULL, cgtheme = TRUE, device = "single", ...)
fit |
A fit object of class |
trend |
Add a trend line. When set to the default |
cgtheme |
When set to the default |
device |
Can be one of three values:
|
... |
Additional arguments. Two are currently valid:
|
The graph plots the square root of the absolute value of the residuals against the fitted value. The square root spacing on the y-axis has tick marks in the fitted scale. The notion of using the squared root of the absolute residuals is attributed to John Tukey.
The values are automatically jittered to minimize overlapping points. For censored data, left-censored values are shown as a shallow "V", which is actually just a rotated downward "<" sign. Similarly, right-censored values are shown as a deeper "^", which is a rotated upward ">" sign.
For the trend
argument, an added trend line when censored data residuals
are present needs to be interpreted cautiously. When there are 7 or more
groups, a cubic smoothing spline based on VGAM::vgam
is fit; otherwise, the group means of the residuals are estimated with
an accelerated failure time model and then just connected. If "too many"
censored data values are present, the line may be withheld and
warnings will be issued, or if forced with line=TRUE
, for
example, may appear nonsensical.
The heading for the graph is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its analysisname
argument.
The label for the Y-axis is taken from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its endptname
argument.
The number of decimal places printed in the ticks on the Y-axis is taken
from the cgOneFactorData
object,
which prepareCGOneFactorData
sets from its digits
argument.
The minimum and maximum values from the range of the absolute valued residuals are respectively labeled in the bottom and top left corners of the graph region.
If group labels along the x-axis seem to overlap in the standard horizontal form, they will be rotated 45 degrees.
varianceGraph.cgOneFactorFit
returns
an invisible NULL
. The main purpose is the side
effect of graphing to the current device.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
## From running examples of cgOneFactorData objects data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) varianceGraph(canine.fit) varianceGraph(canine.fit, model="olsonly") gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE, digits=1) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") varianceGraph(gmcsfcens.fit, trend=TRUE) varianceGraph(gmcsfcens.fit) ## will yield a warning message why no line ## is graphed varianceGraph(gmcsfcens.fit, trend=FALSE)
## From running examples of cgOneFactorData objects data(canine) canine.data <- prepareCGOneFactorData(canine, format="groupcolumns", analysisname="Canine", endptname="Prostate Volume", endptunits=expression(plain(cm)^3), digits=1, logscale=TRUE, refgrp="CC") canine.fit <- fit(canine.data) varianceGraph(canine.fit) varianceGraph(canine.fit, model="olsonly") gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns", analysisname="cytokine", endptname="GM-CSF (pg/ml)", logscale=TRUE, digits=1) gmcsfcens.fit <- fit(gmcsfcens.data, type="aft") varianceGraph(gmcsfcens.fit, trend=TRUE) varianceGraph(gmcsfcens.fit) ## will yield a warning message why no line ## is graphed varianceGraph(gmcsfcens.fit, trend=FALSE)
Create a table of variances from a cg fit object.
varianceTable(fit, display = "print", ...)
varianceTable(fit, display = "print", ...)
fit |
A fit object created and prepared (see |
display |
One of three valid values:
|
... |
Additional arguments. Currently none are valid. |
A method-specific varianceTable
object is returned.
See the specific methods for discussion of return values.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
varianceTable.cgPairedDifferenceFit
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data) varianceTable(anorexiaFT.fit)
data(anorexiaFT) anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns", analysisname="Anorexia FT", endptname="Weight", endptunits="lbs", expunitname="Patient", digits=1, logscale=TRUE) anorexiaFT.fit <- fit(data=anorexiaFT.data) varianceTable(anorexiaFT.fit)
Create a table of variance component estimates of the data in a
cgPairedDifferenceFit
object.
## S4 method for signature 'cgPairedDifferenceFit' varianceTable(fit, display = "print", ...)
## S4 method for signature 'cgPairedDifferenceFit' varianceTable(fit, display = "print", ...)
fit |
A |
display |
One of three valid values:
|
... |
Additional arguments. Currently none are valid. |
The returned table contains variance component estimates for the classical least squares fit. There is no analogous decomposition of variance component estimates calculated for the resistant & robust fit.
Creates an object of class cgPairedDifferenceVarianceTable
, with the
following slots:
contents
The table of variance component
estimates. There are two, the "within experimental unit" variance
and the "between experimental unit" variance. See below for the
data frame structure of the table. The label portion "experimental
unit" will be replaced by the expunitname
component of the
settings
slot of the cgPairedDifferenceFit
fit
object, if previously specified.
efficiency
A table of efficiency estimates, derived from the variance component estimates. The goal is to quantify the reduced number of experimental units needed since a paired difference design was employed, instead of a an unpaired design. See below for the data frame structure of the table.
settings
A list of settings carried from the
cgPairedDifferenceFit
fit
object. These are used
for the print.cgPairedDifferenceVarianceTable
method,
invoked for example when display="print"
.
The data frame structure of the variance components table from the
classical least squares fit is provided in the contents
slot. The data frame consists of row.names
based on the
expunitname
component of the settings
slot in the
cgPairedDifferenceFit
fit
object. The first row
is for the "within" component, and the second is for the "between"
component. The "total" variance is in the third row of the table, the
sum of the between and within variance components. The
first column of the table is the variance components estimates, and
the third column is the square root of the variance components,
labeled Spread(StdDev)
. In the second column is the Percent
calculation of the two variance components relative to the total sum variance.
The data frame structure of the efficiency table
from the classical least squares fit is
provided in the efficiency
slot. There are four rows and one column. All values are derived from
the variance components estimates in the contents
slot described above. The first row of Relative Efficiency
comes from dividing the total variance by the between experimental
unit variance component. The second row expresses the estimated gain in
sensitivity by using a paired difference design and analysis over
using a unpaired design and analysis. This is equal to the within
experimental unit variance component divided by the total variance,
and is expressed here as Percent Reduction
. The third row is
the number of experimental units based on the input data set paired
structure. The last row contains the estimated number of unpaired
design experimental units that would have been needed for the same
sensitivity. The label portion "experimental unit" in these last
two row names will be replaced by the expunitname
component of the
settings
slot of the cgPairedDifferenceFit
fit
object if previously specified.
Contact [email protected] for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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) varianceTable(anorexiaFT.fit)
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) varianceTable(anorexiaFT.fit)