downweightedTable.cgPairedDifferenceFit {cg}R Documentation

Create a table of downweighted observations from a Resistant & Robust fit.

Description

Create a table of downweighted observations based on a rrfit object within a cgPairedDifferenceFit object. A cgPairedDifferenceDownweightedTable class object is created.

Usage

## S4 method for signature 'cgPairedDifferenceFit'
downweightedTable(fit, cutoffwt, display = "print",...)

Arguments

fit

A fit object of class cgPairedDifferenceFit.

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 cutoffwt=0.90 will yield those observations that were downweighted by at least 10%.

display

One of three valid values:

"print"

The default value; It calls a print method for the created
cgPairedDifferenceDownweightedTable object, which is a formatted text output of the table(s).

"none"

Supresses any printing. Useful, for example, when just assignment of the resulting object is desired.

"show"

Calls the default showDefault method, which will just print out the cgPairedDifferenceDownweightedTable components.

...

Additional arguments. None are currently defined for this method.

Details

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.

Value

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".

Note

Contact cg@billpikounis.net for bug reports, questions, concerns, and comments.

Author(s)

Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]

References

Venables, W. N. and Ripley, B. D. (2002), Modern Applied Statistics with S. Fourth edition. Springer.

See Also

cgPairedDifferenceFit, MASS::rlm

Examples

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%
                                           

[Package cg version 1.0-3 Index]