简体   繁体   English

r 的线性模型摘要中的“未缩放方差”是什么?

[英]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. R的线性模型汇总对象具有未缩放的方差特征,这似乎是直接计算solve(t(X)%*%X)*sigma^2时计算的。 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.使它“未缩放”的是它没有按估计方差sigma^2缩放,即: solve(t(X) %*% X)其中X指的是设计矩阵。 This is in contrast to the (scaled) variance of the coefficients: solve(t(X) %*% X)*sigma^2 .这与系数的(缩放的)方差形成对比: 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() .如果您需要缩放方差,即solve(t(X) %*% X)*sigma^2 ,那么您可以简单地缩放它或使用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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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