| Line 22... |
Line 22... |
| 22 |
\code{\link{plot}} and \code{\link{pairs}} methods for objects of
|
22 |
\code{\link{plot}} and \code{\link{pairs}} methods for objects of
|
| 23 |
class \code{"profile"}.
|
23 |
class \code{"profile"}.
|
| 24 |
}
|
24 |
}
|
| 25 |
\usage{
|
25 |
\usage{
|
| 26 |
\method{plot}{profile}(x, ...)
|
26 |
\method{plot}{profile}(x, ...)
|
| 27 |
\method{pairs}{profile}(x, colours = 2:3, ...)
|
27 |
\method{pairs}{profile}(x, colours = 2:3, which = names(x), ...)
|
| 28 |
}
|
28 |
}
|
| 29 |
\arguments{
|
29 |
\arguments{
|
| 30 |
\item{x}{an object inheriting from class \code{"profile"}.}
|
30 |
\item{x}{an object inheriting from class \code{"profile"}.}
|
| 31 |
\item{colours}{Colours to be used for the mean curves conditional on
|
31 |
\item{colours}{colours to be used for the mean curves conditional on
|
| 32 |
\code{x} and \code{y} respectively.}
|
32 |
\code{x} and \code{y} respectively.}
|
| - |
|
33 |
\item{which}{names or number of parameters in pairs plot}
|
| 33 |
\item{\dots}{arguments passed to or from other methods.}
|
34 |
\item{\dots}{arguments passed to or from other methods.}
|
| 34 |
}
|
35 |
}
|
| 35 |
\details{
|
36 |
\details{
|
| 36 |
This is the main \code{plot} method for objects created by
|
37 |
This is the main \code{plot} method for objects created by
|
| 37 |
\code{\link{profile.glm}}. It can also be called on objects created
|
38 |
\code{\link{profile.glm}}. It can also be called on objects created
|
| Line 43... |
Line 44... |
| 43 |
give the loci of the points at which the tangents to the contours of
|
44 |
give the loci of the points at which the tangents to the contours of
|
| 44 |
the bivariate profile likelihood become vertical and horizontal,
|
45 |
the bivariate profile likelihood become vertical and horizontal,
|
| 45 |
respectively. In the case of an exactly bivariate normal profile
|
46 |
respectively. In the case of an exactly bivariate normal profile
|
| 46 |
likelihood, these two curves would be straight lines giving the
|
47 |
likelihood, these two curves would be straight lines giving the
|
| 47 |
conditional means of y|x and x|y, and the contours would be exactly
|
48 |
conditional means of y|x and x|y, and the contours would be exactly
|
| - |
|
49 |
elliptical. The \code{which} argument allows you to select a subset
|
| - |
|
50 |
of parameters; the default corresponds to the set of parameters that have
|
| 48 |
elliptical.
|
51 |
been profiled.
|
| 49 |
}
|
52 |
}
|
| 50 |
\author{
|
53 |
\author{
|
| 51 |
Originally, D. M. Bates and W. N. Venables for S (in 1996).
|
54 |
Originally, D. M. Bates and W. N. Venables for S (in 1996).
|
| 52 |
Taken from \pkg{MASS} where these functions were re-written by
|
55 |
Taken from \pkg{MASS} where these functions were re-written by
|
| 53 |
B. D. Ripley for \R (by 1998).
|
56 |
B. D. Ripley for \R (by 1998).
|
| 54 |
}
|
57 |
}
|
| 55 |
\seealso{
|
58 |
\seealso{
|
| 56 |
\code{\link{profile.glm}}, \code{\link{profile.nls}}.
|
59 |
\code{\link{profile.glm}}, \code{\link{profile.nls}}.
|
| 57 |
}
|
60 |
}
|
| 58 |
\examples{
|
61 |
\examples{
|
| 59 |
## see ?profile.glm for an example using glm fits.
|
62 |
## see ?profile.glm for another example using glm fits.
|
| 60 |
|
63 |
|
| 61 |
## a version of example(profile.nls) from R >= 2.8.0
|
64 |
## a version of example(profile.nls) from R >= 2.8.0
|
| 62 |
fm1 <- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD)
|
65 |
fm1 <- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD)
|
| 63 |
pr1 <- profile(fm1, alphamax = 0.1)
|
66 |
pr1 <- profile(fm1, alphamax = 0.1)
|
| 64 |
stats:::plot.profile(pr1) ## override dispatch to plot.profile.nls
|
67 |
stats:::plot.profile(pr1) ## override dispatch to plot.profile.nls
|
| Line 67... |
Line 70... |
| 67 |
## an example from ?nls
|
70 |
## an example from ?nls
|
| 68 |
x <- -(1:100)/10
|
71 |
x <- -(1:100)/10
|
| 69 |
y <- 100 + 10 * exp(x / 2) + rnorm(x)/10
|
72 |
y <- 100 + 10 * exp(x / 2) + rnorm(x)/10
|
| 70 |
nlmod <- nls(y ~ Const + A * exp(B * x), start=list(Const=100, A=10, B=1))
|
73 |
nlmod <- nls(y ~ Const + A * exp(B * x), start=list(Const=100, A=10, B=1))
|
| 71 |
pairs(profile(nlmod))
|
74 |
pairs(profile(nlmod))
|
| - |
|
75 |
|
| - |
|
76 |
## example from Dobson (1990) (see ?glm)
|
| - |
|
77 |
counts <- c(18,17,15,20,10,20,25,13,12)
|
| - |
|
78 |
outcome <- gl(3,1,9)
|
| - |
|
79 |
treatment <- gl(3,3)
|
| - |
|
80 |
## this example is only formally a Poisson model. It is really a
|
| - |
|
81 |
## comparison of 3 multinomials. Only the interaction parameters are of
|
| - |
|
82 |
## interest.
|
| - |
|
83 |
glm.D93i <- glm(counts ~ outcome * treatment, family = poisson())
|
| - |
|
84 |
pr1 <- profile(glm.D93i)
|
| - |
|
85 |
pr2 <- profile(glm.D93i, which=6:9)
|
| - |
|
86 |
plot(pr1)
|
| - |
|
87 |
plot(pr2)
|
| - |
|
88 |
pairs(pr1)
|
| - |
|
89 |
pairs(pr2)
|
| 72 |
}
|
90 |
}
|
| - |
|
91 |
|
| 73 |
\keyword{models}
|
92 |
\keyword{models}
|
| 74 |
\keyword{hplot}
|
93 |
\keyword{hplot}
|