geeUOmega {saws} | R Documentation |
Modified gee function to output extra objects for saws
Description
This function is normally not to be called directly, but one should usually use mgee
(see warning below).
This function takes output from the gee
function from the gee
package and creates a score matrix
(i.e., estimating equation) and information array (i.e., minus the derivative of the estimating equation).
Note the function creates the X matrix assuming the data set is the same as it was for the original call to gee, see Warning section.
Usage
geeUOmega(geeOutput)
Arguments
geeOutput |
object of class gee, output from gee function |
Value
A gee object with two extra elements to the list, u and omega (see saws
).
Warning
It is safer to use the mgee
function, which internally calls gee
then geeUOmega
. If you do not use mgee
,
and instead call geeUOmega
directly,
there could be a problem if the data set has been changed after the initial gee
call. This is
because the model matrix (i.e., the X matrix) is not saved as part of the gee object, we must recreate it from the gee call. So it is created assuming that the
data argument in gee means the same thing that it did when gee was called. So if you change the data set between the original gee call and using the geeUOmega function, there may be problems.
Note
The function recalculates the fitted.values and the residuals to the gee object, since in gee (version 4.13-18 at least) the fited.values and residuals can be wrong if there is an offset or if y is a matrix (as in the binomial model).
Author(s)
M.P. Fay, with some lines copied from gee
function
See Also
Examples
## example from gee help
data(warpbreaks)
geeout<-gee(breaks~tension,id=wool,data=warpbreaks,corstr="exchangeable")
guo<-geeUOmega(geeout)
saws(guo)