[R] A comment about R:

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Jan 5 17:27:40 CET 2006


As John and myself seem to have written our replies in parallel, hence
I added some more clarifying remarks in this mail:

> Note that the Anova() function, also in car, can more conveniently compute
> Wald tests for certain kinds of hypotheses. More generally, however, I'd be
> interested in your suggestions for an alternative method of specifying
> linear hypotheses.

My understanding was that Peter just wants to eliminate various elements
from the terms(obj) which is what waldtest() in lmtest supports. If some
other way of specifying nested models is required, I'd also be interested
in that.

> The Anova() function with argument white=TRUE will give you F-tests
> corresponding to the t-tests to which you refer (though it will combine df
> for multiple-df terms in the model). To get the kind of summary you
> describe, you could use something like
>
> mysummary <- function(model){
> 	coef <- coef(model)
> 	se <- sqrt(diag(hccm(model)))
> 	t <- coef/se
> 	p <- 2*pt(abs(t), df=model$df.residual, lower=FALSE)
> 	table <- cbind(coef, se, t, p)
> 	rownames(table) <- names(coef)
> 	colnames(table) <- c("Estimate", "Std. Error", "t value",
> "Pr(>|t|)")
> 	table
> 	}

This is supported out of the box in coeftest() in lmtest.
Z




More information about the R-help mailing list