~showard314/ubuntu/karmic/r-base/remove_start_comments

« back to all changes in this revision

Viewing changes to src/library/stats/man/isoreg.Rd

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2009-01-19 12:40:24 UTC
  • mfrom: (5.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090119124024-abxsf4e0y7713w9m
Tags: 2.8.1-2
debian/control: Add another Build-Depends: exclusion for the 
'kfreebsd-i386 kfreebsd-amd64 hurd-i386' architecture to openjdk-6-jdk.
Thanks to Petr Salinger for the heads-up.               (Closes: 512324)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
% File src/library/stats/man/isoreg.Rd
2
2
% Part of the R package, http://www.R-project.org
3
 
% Copyright 1995-2007 R Core Development Team
 
3
% Copyright 1995-2008 R Core Development Team
4
4
% Distributed under GPL 2 or later
5
5
 
6
6
\name{isoreg}
74
74
(ir4 <- isoreg(1:10, y4 <- c(5, 9, 1:2, 5:8, 3, 8)))
75
75
cat(sprintf("R^2 = \%.2f\n",
76
76
            1 - sum(residuals(ir4)^2) / ((10-1)*var(y4))))
 
77
 
 
78
## If you are interested in the knots alone :
 
79
with(ir4, cbind(iKnots, yf[iKnots]))
 
80
 
 
81
## Example of unordered x[] with ties:
 
82
x <- sample((0:30)/8)
 
83
y <- exp(x)
 
84
x. <- round(x) # ties!
 
85
plot(m <- isoreg(x., y))
 
86
stopifnot(all.equal(with(m, yf[iKnots]),
 
87
                    as.vector(tapply(y, x., mean))))
77
88
}
78
89
\keyword{regression}
79
90
\keyword{smooth}