anova.loess(object, ... , test = "F")
If just one object is given, the model is summarized. For two or more objects the result depends on the test. For "F", F tests are carried out; object k is tested against object k-1 with the scale estimate from the object with the largest value of enp. For "Cp", Mallows' statistic is computed with the scale estimate from the object with the largest value of enp. For "none", no test is carried out.
attach(ethanol) # create sample objects gas.m <- loess(formula = NOx ~ E, span = 1, data = gas) gas.m.null <- loess(formula = NOx ~ E, span = 2/3, data = gas)anova(gas.m.null, gas.m)
# produces the following output: Model 1: loess(formula = NOx ~ E, data = gas, span = 1) Model 2: loess(formula = NOx ~ E, data = gas, span = 2/3) Analysis of Variance Table ENP RSS Test F Value Pr(F) 1 3.5 4.8489 1 vs 2 10.14 0.0008601 2 5.5 1.7769