Last data update: 2014.03.03

R: Plot the non-parametric regression surface.
plot.NparRegOutR Documentation

Plot the non-parametric regression surface.

Description

Takes as input a NparRegOut object from the function createNparReg. This plotting function makes a countour plot of the non-parametric regression prediction surface.

Usage

## S3 method for class 'NparRegOut'
plot(x,...)

Arguments

x

an object of type NparRegOut returned by createNparReg.

...

other arguments to be passed to functions plot, points, lines.

Author(s)

Ronald P. Barry rpbarry@alaska.edu

Examples

data(nparExample)
attach(nparExample)
plot.new()
#  Simulate a response variable
index1 = (grid2[,2]<0.8)|(grid2[,1]>0.6)
Z = rep(NA,length(grid2[,1]))
n1 = sum(index1)
n2 = sum(!index1)
Z[index1] = 3*grid2[index1,1] + 4 + rnorm(n1,0,sd=0.4)
Z[!index1] = -2*grid2[!index1,1] + 4 + rnorm(n2,0,sd=0.4)
#
plot(rbind(polygon2,polygon2[1,]),type="l")
points(grid2,pch=19,cex=0.5,xlim=c(-0.1,1))
text(grid2,labels=round(Z,1),pos=4,cex=0.5)
#  Following is the generation of the nonparametric
#  regression prediction surface.
nodeFillingOutput = nodeFilling(poly=polygon2,node.spacing=0.025)
plot(nodeFillingOutput)
formLatticeOutput = formLattice(nodeFillingOutput)
plot(formLatticeOutput)
NparRegOut = createNparReg(formLatticeOutput,Z,PointPattern=grid2,k=2)
plot(NparRegOut)

Results