Learn R Programming

cg (version 0.9.0)

globalTest.cgOneFactorFit: Perform a global Test of significance with cgOneFactorFit object

Description

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.

Usage

## S3 method for class 'cgOneFactorFit':
globalTest(fit, display="print", ...)

Arguments

fit
A fit object of class cgOneFactorFit.
display
One of three valid values: [object Object],[object Object],[object Object]
...
Additional arguments. Only one is currently valid: [object Object] For other possible cgOneFactorFit fit components such as accelerated failure time or unequal variance models, the model argument is not relevant

Value

  • Creates an object of class cgOneFactorGlobalTest, with the following slots: [object Object],[object Object],[object Object],[object Object]

concept

global test

Details

The notion of a global F test, or equivalently, of $R^2$, 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.

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

Run the code above in your browser using DataLab