gsummary {gfunctions} | R Documentation |
The gsummary()
function
Description
The gsummary()
function provides an alternative to the summary()
function by returning different information. The prefix g
is a reminder of who to blame if things do not work properly.
Usage
## generic:
gsummary(object, ...)
## Default S3 method:
gsummary(object, ...)
## S3 method for class 'data.frame'
gsummary(object, ...)
## S3 method for class 'lm'
gsummary(object, vcov.type = c("ordinary", "robust", "hac"), confint.level = 0.95, ...)
## S3 method for class 'glm'
gsummary(object, confint.level = 0.95, ...)
Arguments
object |
an object of suitable class, for example |
vcov.type |
a character string that determines the variance-vcovariance estimator. If |
confint.level |
a number between 0 and 1 (the default is |
... |
additional arguments |
Value
No value is returned, the function only prints. The content of the print depends on the class of its main argument object
.
Author(s)
Genaro Sucarrat, http://www.sucarrat.net/
References
Halbert White (1980): 'A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity', Econometrica 48, pp. 817-838. Whitney K. Newey and Kenned D. West (1987): 'A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix', Econometrica 55, pp. 703-708.
See Also
summary()
Examples
##simulate some data:
set.seed(123)
y <- rnorm(20); x <- rnorm(20); z <- rnorm(20)
##illustrate gsummary.data.frame():
mydataframe <- as.data.frame(cbind(y,x,z))
gsummary(mydataframe)
##illustrate gsummary.lm():
mymodel <- lm(y ~ x + z)
gsummary(mymodel)
gsummary(mymodel, vcov.type="robust")
gsummary(mymodel, vcov.type="hac")
gsummary(mymodel, confint.level=0.90)
gsummary(mymodel, confint.level=0.99)
gsummary(mymodel, confint.level=NULL)
##illustrate gsummary.glm():
y <- as.numeric( y > 0 )
mymodel <- glm(y ~ x + z, family=binomial)
gsummary(mymodel)