| fit.cgOneFactorData {cg} | R Documentation |
Fit models to a cgOneFactorData object
Description
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.
Usage
## S4 method for signature 'cgOneFactorData'
fit(data, type="rr", ...)
Arguments
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
|
Details
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.
Value
Creates an object of class cgOneFactorFit, with the
following slots:
olsfitThe contents of a
lmfit to the data. This is always populated with anlmobject no matter the choice of thetypeargument, even though it is certainly inappropriate in thetype="aft"case.rrfitThe contents of a
rlmfit to the data, housed as arrfitclass object. Iftype="rr"is not selected, then this is set to a simple character value of"No fit was selected.".aftfitThe contents of a
survregfit to the data, with some annotations, to be aaftfitclass object. Iftype="aft"is not selected, then this is set to a simple character value of"No fit was selected.".uvfitThe contents of a
glsfit to the data, housed as auvfitclass object. Iftype="uv"is not selected, then this is set to a simple character value of"No fit was selected.".settingsA list of properties carried as-is from the
dataargument object of classcgOneFactorData. In particular, ifzeroscoreis specified as a non-NULLnumber in thecgOneFactorDataobject in thedataargument, then a score value near zero was derived to replace all zeroes for subsequent log-scale analyses. Alternatively, ifaddconstantis specified as a non-NULLnumber in thecgOneFactorDataobject in thedataargument, then a value was added to shift up all observations for subsequent log-scale analyses.
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
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.
Examples
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")