Displaying 8 results from an estimated 8 matches for "makepredictcall".
2013 May 21
1
making makepredictcall() work
Dear All,
I'm interested in creating a function similar to ns() from package
splines that can be passed in a model formula. The idea is to produce
"safe" predictions from a model using this function. As I have seen, to
do this I need to use makepredictcall(). Consider the following toy example:
myns <- function (x, df = NULL, knots = NULL, intercept = FALSE,
Boundary.knots = range(x),
extraArg = 0) {
ns.x <- if (is.null(knots)) {
ns(x, df = df, intercept = intercept, Boundary.knots =
Boundary.knots)
} e...
2014 Mar 06
1
makepredictcall
An issue came up with the rms package today that makepredictcall would solve, and I was
going to suggest it to the author. But looking in the help documents I couldn't find any
reference to it. There is a manual page, but it does not give much aid in creating code
for a new transformation function. Did I miss something?
If not, I'd be willing to dr...
2014 Mar 07
0
R makepredictcall
...:
> See the developer site, e.g.
> http://developer.r-project.org/model-fitting-functions.txt .
>
> That is where specialized info is (and this is specialized).
>
> On 06/03/2014 18:19, Therneau, Terry M., Ph.D. wrote:
>> >An issue came up with the rms package today that makepredictcall would
>> >solve, and I was going to suggest it to the author. But looking in the
>> >help documents I couldn't find any reference to it. There is a manual
>> >page, but it does not give much aid in creating code for a new
>> >transformation function. Did I...
2018 Apr 27
5
predict.glm returns different results for the same model
Hi all,
Very surprising (to me!) and mystifying result from predict.glm(): the
predictions vary depending on whether or not I use ns() or
splines::ns(). Reprex follows:
library(splines)
set.seed(12345)
dat <- data.frame(claim = rbinom(1000, 1, 0.5))
mns <- c(3.4, 3.6)
sds <- c(0.24, 0.35)
dat$wind <- exp(rnorm(nrow(dat), mean = mns[dat$claim + 1], sd =
sds[dat$claim + 1]))
dat <-
2018 Apr 27
0
predict.glm returns different results for the same model
....2270250736796,
35.4093171222502, 43.038645381669), Boundary.knots = c(12.9423820390783,
108.071583734075), intercept = FALSE))
> attr(m2$terms, "predvars")
list(claim, splines::ns(wind, df = 5))
This appears to be due to a bug in the splines package. There, the
function splines:::makepredictcall.ns looks like this:
makepredictcall.ns <- function(var, call)
{
if(as.character(call)[1L] != "ns") return(call)
at <- attributes(var)[c("knots", "Boundary.knots", "intercept")]
xxx <- call[1L:2L]
xxx[names(at)] <- at
xxx...
2006 Apr 06
1
polynomial predict with lme
Does lme prediction work correctly with poly() terms?
In the following simulated example, the predictions
are wildly off.
Or am I doing something daft?
Milk yield for five cows is measured weekly for 45 weeks.
Yield is simulated as cubic function of weekno + random
cow effect (on intercept) + residual error.
I want to recover an estimate of the fixed curve.
###############
library(nlme)
2018 Jun 26
3
list of methods
I recently got a request to add head() and tail() methods for Surv objects, which is quite
reasonable, but not unlike other requests for logLik,? vcov, extractAIC, ...?? What they
all have in common is that are methods added since creation of the survival package, and
that I didn't know they existed.
To try and get ahead of the curve, is there a way to list names of all of the default
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
...text html latex example
make.link text html latex example
make.names text html latex example
make.socket text html latex example
make.tables text html latex
makepredictcall text html latex example
manova text html latex
margin.table text html latex example
mat.or.vec text html latex example
match text html lat...