Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

11.5 Curvature and Nonparametric Regress... > 11.5.3 R Functions lplot and kerreg - Pg. 561

Chapter 11 More Regression Methods 561 11.5.3 R Functions lplot and kerreg It is a fairly simple matter to create a plot of the smooth returned by the built-in R function lowess, which applies Cleveland's method described in the previous section. But to facilitate the use of lowess, a function is supplied that creates the plot automatically. It has the form lplot(x, y, span=0.75, pyhat=F, eout=F, xout=F, outfun=out, plotit=T, expand=0.5, low.span=2/3, varfun=pbvar, cor.op=F, cor.fun=pbcor, pr=T, scale=F, xlab="X", ylab="Y", zlab="", theta=50, phi=25, family="gaussian", duplicate="error", pc="*",ticktype="simple"), where the argument span is f. (More than one predictor can be handled using a method outlined in Section 11.5.13. With two predictors, setting the argument ticktype="detailed" will create ticks as done when using a two-dimensional plot.) If the argument pyhat=T and the number or predictors is less than or equal to 4, the function returns the m(x i ) values, ^ i = 1, . . . , n. If eout=T, the function first eliminates any outliers among the (x i , y i ) values using the outlier detection method specified by the argument outfun. If xout=T instead, the function removes outliers (leverage points) among the x i values only. To suppress the plot, set plotit=F. (The argument family is relevant only when p = 2; see Section 11.5.13.) The arguments theta and phi can be used to rotate a three-dimensional plot. The arguments xlab,