Add a curves to an existing plot.

Share:

Description

Takes a fitted spm object produced by spm() and adds a curve. The function is only appropriate in the case of a single predictor.

Usage

1
2
## S3 method for class 'spm'
lines(x,...)

Arguments

x

a fitted spm object as produced by spm().

...

other graphics parameters described in Appendix B of the SemiPar Users' Manual http:uow.edu.au/~mwand/SPmanu.pdf

Details

Takes a fitted spm object produced by spm() and adds a curve. The function is only appropriate in the case of a single predictor.

Value

The function adds a curve to a plot.

Author(s)

M.P. Wand mwand@uow.edu.au (other contributors listed in SemiPar Users' Manual).

References

Ruppert, D., Wand, M.P. and Carroll, R.J. (2003)
Semiparametric Regression Cambridge University Press.
http://stat.tamu.edu/~carroll/semiregbook/

Ganguli, B. and Wand, M.P. (2005)
SemiPar 1.0 Users' Manual.
http://www.uow.edu.au/~mwand/SPmanu.pdf

See Also

spm plot.spm predict.spm summary.spm residuals.spm fitted.spm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(SemiPar)
data(fossil)
attach(fossil)
fit <- spm(strontium.ratio~f(age))
plot(fossil,type="n")
lines(fit)
points(fossil)

# Now do several customisations

op <- par(bg="white")
par(bg="honeydew")
plot(fossil,type="n")
lines(fit,col="green",lwd=5,shade.col="mediumpurple1")   
points(fossil,col="orange",pch=16)
par(op)