1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| > library(robust)
...
> phones.lmr <- lmRob(calls ~ year, data = phones)
> summary(phones.lmr, cor = FALSE)
Call: lmRob(formula = calls ~ year, data = phones)
Residuals:
Min 1Q Median 3Q Max
-1.8420632 -0.5041827 0.1458648 38.9179179 188.3659217
Coefficients:
Value Std. Error t value Pr(>|t|)
(Intercept) -5.254140e+01 3.625321e+00 -1.449289e+01 9.792167e-13
year 1.103992e+00 6.083312e-02 1.814788e+01 1.021405e-14
Residual standard error: 2.02696 on 22 degrees of freedom
Multiple R-Squared: 0.493735
Test for Bias:
statistic p-value
M-estimate 1.400730 0.4964041
LS-estimate 0.242754 0.8857000
> plot(phones.lmr)
Make plot selections (or 0 to exit):
1: plot: All
2: plot: Normal QQ-Plot of Residuals
3: plot: Estimated Kernel Density of Residuals
4: plot: Robust Residuals vs Robust Distances
5: plot: Residuals vs Fitted Values
6: plot: Sqrt of abs(Residuals) vs Fitted Values
7: plot: Response vs Fitted Values
8: plot: Standardized Residuals vs Index (Time)
9: plot: Overlaid Normal QQ-Plot of Residuals
10: plot: Overlaid Estimated Density of Residuals
11: plot: Scatter Plot with Fits
Sélection : 11
...
> anova(phones.lmr)
Terms added sequentially (first to last)
Chisq Df RobustF Pr(F)
(Intercept) 1
year 1 68.013 < 2.2e-16 ***
---
Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
> |
Partager