similar to: R makepredictcall

Displaying 20 results from an estimated 10000 matches similar to: "R makepredictcall"

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 draft a paragraph about that which
2008 Nov 25
1
how to check linearity in Cox regression
On examining non-linearity of Cox coefficients with penalized splines - I have not been able to dig up a completely clear description of the test performed in R or S-plus. >From the Therneau and Grambsch book (2000 - page 126) I gather that the test reported for "linear" has as its null hypothesis that the spline coefficient is the same at the center of basis. Thus, in the example
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 =
2012 Jul 18
0
Building a web risk calculator based on Cox, PH--definitive method for calculating probability?
Here is an example of how to do it. > library(survival) > vfit <- coxph(Surv(time, status) ~ celltype + trt, data=veteran) > userinput <- data.frame(celltype="smallcell", trt = 1) > usercurve <- survfit(vfit, newdata=userinput) #the entire predicted survival curve > user2 <- summary(usercurve, time= 2*365.25) # 2 year time point > user2$surv [1]
2008 Sep 30
0
Hazard curves
-- begin included message ----- I am looking at a continuous variable, age. I am looking at time to 12-month remission and can calculate the HR and 95% confidence interval are follows: coxfita = coxph(Surv(rem.Remtime,rem.Rcens)~nearma$all.age,data=nearma) exp(coxfita$coefficients) exp(confint(coxfita)) However, because I am looking at age as a continuous variable I cannot draw a Kaplan-Meier
2010 Dec 07
0
coxph failure
Larry, You found a data set that kills coxph. I'll have to think about what to do since on the one hand it's your own fault for trying to fit a very bad model, and on the other I'd like the routine to give a nice error message before it dies. In the data set you sent me the predictor variable is very skewed: > quantile(anomaly1$CREAT, c(0, .5, .9, .999, 1)) 0% 50%
2013 Jul 11
0
[R-pkgs] Major Update to rms package
The rms ("Regression Modeling Strategies") package has undergone a massive update. The entire list of updates is at the bottom of this note. CRAN has the update for linux and will soon have it for Windows and Mac - check http://cran.r-project.org/web/packages/rms/ for availability. This rms update relies on a major update of the Hmisc package. The most user-visible changes are:
2011 Apr 06
1
help on pspline in coxph
Hi there, I have a question on how to extract the linear term in the penalized spline in coxph. Here is a sample code: n=100 set.seed(1) x=runif(100) f1 = cos(2*pi*x) hazard = exp(f1) T = 0 for (i in 1:100) { T[i] = rexp(1,hazard[i]) } C = runif(n)*4 cen = T<=C y = T*(cen) + C*(1-cen) data.tr=cbind(y,cen,x) fit=coxph(Surv(data.tr[,1],
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable that interacted with strata (zed) was not a factor variable. But I had stated the problem incorrectly. It's not that there are too many strata terms; there are too many non-strata terms when the variable interacting with the stratification factor is a factor variable. Here is a simple example, where I have
2015 Jun 15
2
Different behavior of model.matrix between R 3.2 and R3.1.1
Terry - your example didn't demonstrate the problem because the variable that interacted with strata (zed) was not a factor variable. But I had stated the problem incorrectly. It's not that there are too many strata terms; there are too many non-strata terms when the variable interacting with the stratification factor is a factor variable. Here is a simple example, where I have
2011 Sep 23
0
Using method = "aic" with pspline & survreg
--- begin inclusion -- Hi everybody. I'm trying to fit a weibull survival model with a spline basis for the predictor, using the survival library. I've noticed that it doesn't seem to be possible to use the aic method to choose the degrees of freedom for the spline basis in a parametric regression (although it's fine with the cox model, or if the degrees of freedom are specified
2012 Oct 19
1
Addition of plot=F argument to termplot
I have a suggested addition to termplot. We have a local mod that is used whenever none of the termplot options is quite right. It is used here almost daily for Cox models in order to put the y axis on a risk scale: ---- fit <- coxph(Surv(time, status) ~ ph.ecog + pspline(age), data=lung) zz <- termplot(fit, se=TRUE, plot=FALSE) yy <- zz$age$y + outer(zz$age$se, c(0, -2, 2),
2008 May 09
1
predicting from coxph with pspline
Hello. I get a bit confused by the output from the predict function when used on an object from coxph in combination with p-spline, e.g. fit <- coxph(Surv(time1, time2, status)~pspline(x), Data) predict(fit, newdata=data.frame(x=1:2)) It seems like the output is somewhat independent of the x-values to predict at. For example x=1:2 gives the same result as x=21:22. Does the result span the
2010 Nov 17
1
where are my pspline knots?
Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot. Best, Federico -- Federico C. F. Calboli Department of Epidemiology
2020 Sep 25
1
Extra "Note" in CRAN submission
When I run R CMD check on the survival package I invariably get a note: ... * checking for file ?survival/DESCRIPTION? ... OK * this is package ?survival? version ?3.2-6? * checking CRAN incoming feasibility ... NOTE Maintainer: ?Terry M Therneau <therneau.terry at mayo.edu>? ... This is sufficient for the auto-check process to return the following failure message: Dear maintainer,
2011 Sep 24
1
help
Mathew Brown Institute of Bioclimatology University of G?ttingen B?sgenweg 2 37077 G?ttingen, Germany t: +49 551 39 9359 mathew.brown at forst.uni-goettingen.de On 9/24/2011 6:00 PM, r-help-request at r-project.org wrote: > Send R-help mailing list submissions to > r-help at r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit >
2002 May 20
1
suggestion for example for base:naresid
Dear list: since it took me a little while to figure out how to make use of naresid, I thought that the below R code might be useful as an example on the help page. Regards, Markus # generate some data x1 <- runif(20) y <- 10 + 5*x1 + rnorm(20) summary(lm.0 <- lm(y ~ x1)) # append some NA's to y y <- c(y, rep(NA, 5)) # generate some further x1s x1 <- c(x1, runif(5)) #
2013 Nov 04
0
Fwd: Re: How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
-------- Original Message -------- Subject: Re: How to obtain nonparametric baseline hazard estimates in the gamma frailty model? Date: Mon, 04 Nov 2013 17:27:04 -0600 From: Terry Therneau <therneau.terry at mayo.edu> To: Y <yuhanusa at gmail.com> The cumulative hazard is just -log(sfit$surv). The hazard is essentially a density estimate, and that is much harder. You'll notice
2001 Aug 29
1
suggestion for example for base:naresid
Dear list: since it took me a little while to figure out how to make use of naresid, I thought that the below R code might be useful as an example on the help page. Regards, Markus # generate some data x1 <- runif(20) y <- 10 + 5*x1 + rnorm(20) summary(lm.0 <- lm(y ~ x1)) # append some NA's to y y <- c(y, rep(NA, 5)) # generate some further x1s x1 <- c(x1, runif(5)) #
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