Learn R Programming

cg (version 1.0-3)

downweightedTable.cgOneFactorFit: 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 cgOneFactorFit object. A cgOneFactorDownweightedTable class object is created.

Usage

"downweightedTable"(fit, cutoffwt, display="print", ...)

Arguments

fit
A fit object of class cgOneFactorFit.
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 cgOneFactorDownweightedTable 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 cgOneFactorDownweightedTable components.

...
Additional arguments. None are currently defined for this method.

Value

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

Details

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.

References

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

See Also

cgOneFactorFit, MASS::rlm

Examples

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

Run the code above in your browser using DataLab