简体   繁体   中英

what is the “unscaled variance” in r's linear model summary?

R's linear model summary object has a unscaled variance feature, which appears to be what is calculated when solve(t(X)%*%X)*sigma^2 is calculated directly. What makes this "unscaled" ? What is the alternative?

What makes it "unscaled" is that it's not scaled by the estimated variance sigma^2 , that is: solve(t(X) %*% X) where X refers to the design-matrix. This is in contrast to the (scaled) variance of the coefficients: solve(t(X) %*% X)*sigma^2 .

If you need the scaled variance, ie solve(t(X) %*% X)*sigma^2 , then you can simply scale it or use vcov() . A small example follows:

x <- 1:100
y <- x + rnorm(100, 2)
fit <- lm(y ~ x)
summary(fit)$cov*summary(fit)$sigma^2 # One way  
vcov(fit) # Another way

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM