<!doctype s-function-doc system "s-function-doc.dtd" [
<!entity % S-OLD "INCLUDE">
]
>
<s-function-doc>
<s-topics>
   <s-topic>glmRob</s-topic>
</s-topics>

<s-title>
Fit a Robust Generalized Linear Model 
</s-title>

<s-description>
Produces an object of class <s-expression>glmRob</s-expression> which is a
Robust Generalized Linear Model fit. 
</s-description>

<s-usage>
<s-old-style-usage>
glmRob(formula = formula(data), family = binomial, data = sys.parent(),  
subset, na.action = na.fail, start = eta, fit.method = "cubif", 
model = F, x = F, y = T, contrasts = NULL, 
cubif.control = glmRob.cubif.control(...), 
mallows.control = glmRob.mallows.control(...),
misclass.control = glmRob.misclass.control(...),
method = "glmRob.fit", estim = "mcd", robust.cov.control =
covRob.control(estim = estim, quan = 0.75, ...), ...) 
</s-old-style-usage>
</s-usage>

<s-args-required>
<s-arg name="formula">
a formula expression as for other regression models, of the form  
response ~ predictors. See the documentation of <s-expression>lm</s-expression> and <s-expression>formula</s-expression> for  
details. 
</s-arg>
</s-args-required>

<s-args-optional>
<s-arg name="family">
a family object - only <s-expression>binomial</s-expression> and <s-expression>poisson</s-expression> are implemented. See the  
documentation of <s-expression>glm</s-expression> for details.  
</s-arg>

<s-arg name="data">
an optional data frame in which to interpret the variables occuring in 
the formula. 
</s-arg>

<s-arg name="subset">
expression saying which subset of the rows of the data should 
be used in the fit. This can be a logical vector (which is replicated 
to have length equal to the number of observations), or a numeric vector 
indicating which observation numbers are to be included, or a character  
vector of the row names to be included. All observations are 
included by default. 
</s-arg>

<s-arg name="na.action">
a function to filter missing data. This is applied to the <s-expression>model.frame</s-expression> 
after any <s-expression>subset</s-expression> argument has been used. The default (with <s-expression>na.fail</s-expression>) 
is to create an error if any missing values are found. A possible 
alternative is <s-expression>na.exclude</s-expression>, which deletes observations that contain 
one or more missing values. 
</s-arg>

<s-arg name="start">
a vector of initial values on the scale of the linear predictor. 
</s-arg>

<s-arg name="fit.method">
a character vector indicating the fitting method. Conditionally
unbiased bounded influence estimators are obtained with this
argument equal to
<s-expression>"cubif"</s-expression>, Mallow's leverage
downweighting estimates are fit with <s-expression>fit.method =
"mallows"</s-expression> and <s-expression>"misclass"</s-expression>
fits a consistent estimate based on the misclassification model. 
The last two estimators are only defined for logistic regression
models with a Bernoulli response variable.
</s-arg>

<s-arg name="model">
logical flag: if <s-expression>TRUE</s-expression>, the <s-expression>model.frame</s-expression> is returned. If this argument 
is itself a <s-expression>model.frame</s-expression>, then the <s-expression>formula</s-expression> and <s-expression>data</s-expression> arguments are 
ignored, and <s-expression>model</s-expression> is used to define the model. 
</s-arg>

<s-arg name="x">
logical flag: if <s-expression>TRUE</s-expression>, the
<s-expression>model.matrix</s-expression> is returned. 
</s-arg>

<s-arg name="y">
logical flag: if <s-expression>TRUE</s-expression>, the response variable
is returned (default is <s-expression>TRUE</s-expression>). 
</s-arg>

<s-arg name="contrasts">
a list of contrasts to be used for some or all of the factors  
appearing as variables in the model formula. The names of the list 
should be the names of the corresponding variables, and the  
elements should either be contrast-type matrices (matrices with 
as many rows as levels of the factor and with columns linearly  
independent of each other and of a column of one's), or else they 
should be functions that compute such contrast matrices.  
</s-arg>

<s-arg name="cubif.control">
a list of iteration and algorithmic constants to control the  
conditionally unbiased bounded influence
robust fit. See <s-expression>glmRob.cubif.control</s-expression> for their
names and default values. These can also be set as arguments of
<s-expression>glmRob</s-expression> itself.
</s-arg>

<s-arg name="mallows.control">
a list of iteration and algorithmic constants to control the  
Mallows leverage downweighted
robust fit. See <s-expression>glmRob.mallows.control</s-expression> for their names and default 
values. These can also be set as arguments of <s-expression>glmRob</s-expression> itself.  
</s-arg>

<s-arg name="misclass.control">
a list of iteration and algorithmic constants to control the  
robust fit based on the misclassification model. 
See <s-expression>glmRob.misclass.control</s-expression> for their names
and default values. These can also be set as arguments of
<s-expression>glmRob</s-expression> itself.
</s-arg>

<s-arg name="estim">
the robust covariance estimator used in the initial step of the "cubif"
method.  The choices are the same as those for covRob.
</s-arg>

<s-arg name="robust.cov.control">
a list of parameters affecting the robust covariance estimation during the
initial step of the "cubif" method.
</s-arg>

<s-arg name="...">
control arguments maybe given directly.  
See the documentation of <s-expression>glmRob.cubif.control</s-expression>,
<s-expression>glmRob.mallows.control</s-expression> or
<s-expression>glmRob.misclass.control</s-expression> for details.  
</s-arg>
</s-args-optional>

<s-value>
an object of class <s-expression>glmRob</s-expression> that contains the
Robust Generalized Linear Model fit.  
</s-value>

<s-section name=" REFERENCES">
Copas, J. B. (1988). Binary Regression Models for 
Contaminated Data. <it>JRSS \fB50\fR, 225-265.</it>
<br>
Kunsch, L., Stefanski L. and Carroll, R. (1989).
Conditionally Unbiased Bounded-Influence Estimation in General 
Regression Models, with Applications to Generalized Linear 
Models. 
<it>JASA \fB84\fR, 460-466.</it>
<br>
Carroll, R. J. and Pederson, S. (1993). On Robustness in
the Logistic Regression Model. <it>JRSS \fB55\fR, 693-706.</it>
<br>
Marazzi, A. (1993).
<it>Algorithms, routines and S functions for robust statistics.</it>
Wadsworth &#38; Brooks/Cole, Pacific Grove, CA. 
</s-section>

<s-see>
<s-function name="glmRob.object.sgm">glmRob.object</s-function>,
<s-function name="glmRob.cubif.control.sgm">glmRob.cubif.control</s-function>,
<s-function name="glmRob.mallows.control.sgm">glmRob.mallows.control</s-function>,
<s-function name="glmRob.misclass.control.sgm">glmRob.misclass.control</s-function>,
<s-function name="covRob.sgm">covRob</s-function>,
<s-function name="glm.sgm">glm</s-function>.
</s-see>

<s-examples>
<s-example type = text>
glmRob(sumY~Age10+Base4*Trt, family=poisson, data=breslow.dat, fit.method =
"cubif")
</s-example>
</s-examples>

<s-keywords>
<s-keyword>robust</s-keyword>
<s-keyword>regression</s-keyword>
<s-keyword>models</s-keyword>
<s-keyword>librobust</s-keyword>
</s-keywords>

<s-docclass>
function
</s-docclass>

</s-function-doc>
