该sfsmisc软件包为进行 Wald 测试提供了有用的功能:
library(MASS)
library(sfsmisc)
summary(rsl <- rlm(stack.loss ~ ., stackloss))
#Call: rlm(formula = stack.loss ~ ., data = stackloss)
#Residuals:
# Min 1Q Median 3Q Max
#-8.91753 -1.73127 0.06187 1.54306 6.50163
#
#Coefficients:
# Value Std. Error t value
#(Intercept) -41.0265 9.8073 -4.1832
#Air.Flow 0.8294 0.1112 7.4597
#Water.Temp 0.9261 0.3034 3.0524
#Acid.Conc. -0.1278 0.1289 -0.9922
#
#Residual standard error: 2.441 on 17 degrees of freedom
f.robftest(rsl, var = "Air.Flow")
# robust F-test (as if non-random weights)
#
#data: from rlm(formula = stack.loss ~ ., data = stackloss)
#F = 50.879, p-value = 1.677e-06
#alternative hypothesis: true Air.Flow is not equal to 0
f.robftest(rsl, var = "Acid.Conc.")
# robust F-test (as if non-random weights)
#
#data: from rlm(formula = stack.loss ~ ., data = stackloss)
#F = 1.0447, p-value = 0.3211
#alternative hypothesis: true Acid.Conc. is not equal to 0