Bunu keşfetmenin bir yolu, aynı modeli farklı araçlar kullanarak takmayı denemektir, işte bir örnek:
> fit1 <- lm( Sepal.Length ~ ., data=iris )
> fit2 <- glm( Sepal.Length ~ ., data=iris )
> summary(fit1)
Call:
lm(formula = Sepal.Length ~ ., data = iris)
Residuals:
Min 1Q Median 3Q Max
-0.79424 -0.21874 0.00899 0.20255 0.73103
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.17127 0.27979 7.760 1.43e-12 ***
Sepal.Width 0.49589 0.08607 5.761 4.87e-08 ***
Petal.Length 0.82924 0.06853 12.101 < 2e-16 ***
Petal.Width -0.31516 0.15120 -2.084 0.03889 *
Speciesversicolor -0.72356 0.24017 -3.013 0.00306 **
Speciesvirginica -1.02350 0.33373 -3.067 0.00258 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.3068 on 144 degrees of freedom
Multiple R-squared: 0.8673, Adjusted R-squared: 0.8627
F-statistic: 188.3 on 5 and 144 DF, p-value: < 2.2e-16
> summary(fit2)
Call:
glm(formula = Sepal.Length ~ ., data = iris)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.79424 -0.21874 0.00899 0.20255 0.73103
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.17127 0.27979 7.760 1.43e-12 ***
Sepal.Width 0.49589 0.08607 5.761 4.87e-08 ***
Petal.Length 0.82924 0.06853 12.101 < 2e-16 ***
Petal.Width -0.31516 0.15120 -2.084 0.03889 *
Speciesversicolor -0.72356 0.24017 -3.013 0.00306 **
Speciesvirginica -1.02350 0.33373 -3.067 0.00258 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 0.09414226)
Null deviance: 102.168 on 149 degrees of freedom
Residual deviance: 13.556 on 144 degrees of freedom
AIC: 79.116
Number of Fisher Scoring iterations: 2
> sqrt( 0.09414226 )
[1] 0.3068261
Dolayısıyla, doğrusal modelin artık standart hatasının glm'den dağılımın sadece kare kökü olduğunu, başka bir deyişle dağılımın (Gauss modelleri için) ortalama kare hatasıyla aynı olduğunu görebilirsiniz.