Description Usage Arguments Details Value Author(s) Examples
Provide alternative model summaries specifically for use with apsrtable
1 2 3 4 | ## S3 method for class 'gee'
apsrtableSummary(x)
## S3 method for class 'lrm'
apsrtableSummary(x)
|
x |
A model object to be summarized in a format suitable
for |
When preparing model objects for output, apsrtable
uses primarily the representation of the model provided by its summary
method. However, some packages return summaries with information that can be confusing to apsrtable
.
In such an event, you have two options: provide a custom apsrtableSummary
method, or work with the package maintainers to produce a suitable summary
object. Ideally, the former is a stopgap for the latter.
A summary
representation of a model object, probably derived from the object's own summary
method.
Michael Malecki <malecki at wustl.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ### summary.gee produces z scores but not Pr(z). This converts the relevant columns
### to Pr(z) so that apsrstars() works on it, and places the vector of robust se's in
### an $se position which apsrtable expects.
apsrtableSummary.gee <- function(x) {
s <- summary(x)
newCoef <- coef(s)
## which columns have z scores? (two of them in robust case)
zcols <- grep("z",colnames(newCoef))
newCoef[,zcols] <- pnorm(abs(newCoef[,zcols]), lower.tail=FALSE)
colnames(newCoef)[zcols] <- "Pr(z)"
s$coefficients <- newCoef
## put the robust se in $se so that notefunction works automatically
## the se checker will overwrite [,4] with pt, but this doesn't matter
## because the last column Pr(z) is used by apsrstars() anyway
## and the se are pulled from $se.
if( class(x) == "gee.robust") {
s$se <- coef(s)[,4]
}
return(s)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.