Notes on R statistics and programming language

Monday, January 12, 2004

Some good R functions:

names(object) reports all of the elements in the object. Useful as a reminder after lm to get all of the returned stuff.

vcov(lm.object) and hccm(lm.object) give the var-covar matrix and White's var covar matrix. Need to load library(car) to get hccm.

sqrt(diag(hccm(lm.object,type=hc1))) gives the same standard errors as comma robust in Stata.

Named vectors can be accessed by index:

sqrt(diag(hccm(lm.object,type=hc1))) ["myvar"]


Sweave is cool

This page is powered by Blogger. Isn't yours?