The R Project SVN R

Rev

Rev 27625 | Rev 36816 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27625 Rev 28044
Line 10... Line 10...
10
         partial.resid=FALSE, rug=FALSE,
10
         partial.resid=FALSE, rug=FALSE,
11
         terms=NULL, se=FALSE, xlabs=NULL, ylabs=NULL, main = NULL,
11
         terms=NULL, se=FALSE, xlabs=NULL, ylabs=NULL, main = NULL,
12
         col.term = 2, lwd.term = 1.5,
12
         col.term = 2, lwd.term = 1.5,
13
         col.se = "orange", lty.se = 2, lwd.se = 1,
13
         col.se = "orange", lty.se = 2, lwd.se = 1,
14
         col.res = "gray", cex = 1, pch = par("pch"),
14
         col.res = "gray", cex = 1, pch = par("pch"),
-
 
15
         col.smth = "darkred", lty.smth=2, span.smth=2/3,
15
         ask = interactive() && nb.fig < n.tms && .Device !="postscript",
16
         ask = interactive() && nb.fig < n.tms && .Device !="postscript",
16
         use.factor.levels=TRUE,
17
         use.factor.levels=TRUE, smooth=NULL,
17
         \dots)
18
         \dots)
18
}
19
}
19
\arguments{
20
\arguments{
20
  \item{model}{fitted model object}
21
  \item{model}{fitted model object}
21
  \item{data}{data frame in which variables in \code{model} can be
22
  \item{data}{data frame in which variables in \code{model} can be
Line 39... Line 40...
39
    \code{\link{points}}.}
40
    \code{\link{points}}.}
40
   \item{ask}{logical; if \code{TRUE}, the user is \emph{ask}ed before
41
   \item{ask}{logical; if \code{TRUE}, the user is \emph{ask}ed before
41
     each plot, see \code{\link{par}(ask=.)}.}
42
     each plot, see \code{\link{par}(ask=.)}.}
42
   \item{use.factor.levels}{Should x-axis ticks use factor levels or
43
   \item{use.factor.levels}{Should x-axis ticks use factor levels or
43
     numbers for factor terms?}
44
     numbers for factor terms?}
-
 
45
   \item{smooth}{\code{NULL} or a function with the same arguments as
-
 
46
     \code{\link{panel.smooth}} to draw a smooth through the partial
-
 
47
     residuals for non-factor terms}
-
 
48
   \item{lty.smth,col.smth, span.smth}{Passed to \code{smooth}}
44
  \item{\dots}{other graphical parameters}
49
  \item{\dots}{other graphical parameters}
45
}
50
}
46
\details{
51
\details{
47
  The model object must have a \code{predict} method that accepts
52
  The model object must have a \code{predict} method that accepts
48
  \code{type=terms}, eg \code{\link{glm}} in the \pkg{base} package,
53
  \code{type=terms}, eg \code{\link{glm}} in the \pkg{base} package,
Line 69... Line 74...
69
model <- glm(y ~ ns(x,6) + z)
74
model <- glm(y ~ ns(x,6) + z)
70
 
75
 
71
par(mfrow=c(2,2)) ## 2 x 2 plots for same model :
76
par(mfrow=c(2,2)) ## 2 x 2 plots for same model :
72
termplot(model, main = paste("termplot( ", deparse(model$call)," ...)"))
77
termplot(model, main = paste("termplot( ", deparse(model$call)," ...)"))
73
termplot(model, rug=TRUE)
78
termplot(model, rug=TRUE)
74
termplot(model, partial=TRUE, rug= TRUE,
-
 
75
         main="termplot(..., partial = TRUE, rug = TRUE)")
-
 
76
termplot(model, partial=TRUE, se = TRUE, main = TRUE)
79
termplot(model, partial=TRUE, se = TRUE, main = TRUE)
-
 
80
termplot(model, partial=TRUE, smooth=panel.smooth,span.smth=1/4)
77
if(!had.splines && rs) detach("package:splines")
81
if(!had.splines && rs) detach("package:splines")
78
}
82
}
79
\keyword{hplot}
83
\keyword{hplot}
80
\keyword{regression}
84
\keyword{regression}