Re: [R] p-values from coxph?

2010-10-18 Thread Terry Therneau
On Oct 15, 2010, at 9:21 AM, ?hagen Patrik wrote: Dear List, I each iteration of a simulation study, I would like to save the p- value generated by coxph. I fail to see how to adress the p-value. Do I have to calculate it myself from the Wald Test statistic? No. Look at

Re: [R] coxph linear.predictors

2010-10-28 Thread Terry Therneau
. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] multi-level cox ph with time-dependent covariates

2010-11-04 Thread Terry Therneau
. Your models assume that marker1, marker2, ... each have the same effect across tissue types. Adding a random effect gave per subject or per subject/tissue intercepts. Do you instead want to do shrinkage of the marker1, .. coefficients? Terry Therneau

[R] predict.coxph

2010-11-12 Thread Terry Therneau
regression on the observed times is wrong. Censored data is more complex than that. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] interpretation of coefficients in survreg AND obtaining the hazard function

2010-11-15 Thread Terry Therneau
1. The weibull is the only distribution that can be written in both a proportional hazazrds for and an accelerated failure time form. Survreg uses the latter. In an ACF model, we model the time to failure. Positive coefficients are good (longer time to death). In a PH model, we model the

Re: [R] ... predict.coxph

2010-11-15 Thread Terry Therneau
If you are looking at radioactive decay maybe but how often do you actually see exponential KM curves in real life? Exponential curves are rare. But proportional hazards does not imply exponential. A trial design could in fact try to get all the control sample to event at the same time if

Re: [R] where are my pspline knots?

2010-11-18 Thread Terry Therneau
The pspline function uses P-splines (Eilers and Marx, Statistical Science, 1981), which are a spline basis using a regular set of knots. Looking at the code for pspline, which isn't so hard, let dx = (max(x) - min(x))/ ntermwhere nterm is round(2.5 * desired degrees of freedom)

[R] PS

2010-11-18 Thread Terry Therneau
Note that there is NOT an intercept term in my pspline basis. One of the features of psplines is that \sum beta_i f_i(x) (where f_i are the spline basis functions) is linear if and only if the coefficients beta are a linear sequence. This makes it easy to decompose the fit into linear and

Re: [R] calculating martingale residual on new data using predict.coxph

2010-11-22 Thread Terry Therneau
This feature has been added in survival 2.36-1, which is now on CRAN. (2.36-2 should appear in another day or so) Terry T. -begin included message I was trying to use predict.coxph to calculate martingale residuals on a test data, however, as pointed out before

Re: [R] Tobit model on unbalanced panel

2010-11-24 Thread Terry Therneau
For tobit regression, also see the last example of help(survreg) in the survival package. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-26 Thread Terry Therneau
for accelerated failure time models, or even better Escobar and Meeker which comes from the industrial reliability view. For predicted survival from a Cox model see Chapter 10 of Therneau and Grambsch. The answers to your specific questions would be a document rather than an email. Terry Therneau

Re: [R] aftreg vs survreg loglogistic aft model (different intercept term)

2010-11-29 Thread Terry Therneau
that significant changes in a log-likihood are on the order of 3.94/2 =2 units, I do not get very excited by a .08 difference in convergence. Terry Therneau -- begin included message -- I add an example , all the variables are mutually excluding dummy variables, notice

Re: [R] Extreme Value model

2010-07-15 Thread Terry Therneau
Just like a Poisson regression model, is there a package in R to do Extreme Value Regression model? Thanks. The survreg routine includes the extreme value distribution. It allows for cenored data, but the data can be uncensored. fit - survreg(Surv(y) ~ x1 + x2 + x3, dist='extreme') Terry

Re: [R] CART with a circular response

2010-07-16 Thread Terry Therneau
. You need to decide how to define goodness. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Standard Error for individual patient survival with survfit and summary.survfit

2010-07-16 Thread Terry Therneau
series argument to compute the se of the survival. (The are several reasons for this choice, including that se(survival) is not well defined by the standard formulas when S=0). Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Survival Analysis Daily Time-Varying Covariate....

2010-09-17 Thread Terry Therneau
since the start of the experiment cumulative CO2 dose days over a threshold etc You can examine each of these one by one or in combinations. It would be very difficult, however, to ask your program to find the pattern. Terry Therneau

Re: [R] extending survival curves past the last event using plot.survfit

2010-09-23 Thread Terry Therneau
be the easiest code for multiple strata, at least that I can think of offhand. plot(surv, mark.time=F, fun='event', xlim=c(0, 54)) for (i in 1:length(surv$strata)) { #number of curves temp - surv[i] lines(c(max(temp$time), 54), 1- rep(min(temp$surv),2)) } Terry Therneau

Re: [R] 95% CI of Kaplan-Meier survival in package survival

2010-09-27 Thread Terry Therneau
), or logit (good) scales. I expect that Minitab and S default to different choices. See the conf.type argument in help(survfit.formula). Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Weibull survival regression model with different shape parameters

2009-10-03 Thread Terry Therneau
of the families. I looked it up in the help pdf and on the internet, but I couldn't find anything. Would it be possible to do such a thing ? --- end inclusion -- Yes it is possible -- but clearly I need to add one more example to the help page; use a strata() term. Terry Therneau survreg(Surv(time

Re: [R] error using frailty term

2009-10-03 Thread Terry Therneau
. For one thing I made the maximizer much more intelligent: I now use optim :-). Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] [R-pkgs] General mixed effects Cox models

2009-10-05 Thread Terry Therneau
this to include more examples over the next few months. Terry Therneau Mayo Clinic ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r

Re: [R] Plot with CART results

2009-10-09 Thread Terry Therneau
-begin included message --- With rpart we can get several terminals and draw it in the TREE plot. Now I am trying to draw a plot like this: x-axis is each terminal's value, and y-axis is those observe values. Does anyone has idea what gramma should I use? Thanks in advance.

Re: [R] Nelder-Mead with output of simplex vertices

2009-10-12 Thread Terry Therneau
-- begin included Greetings! I want to follow the evolution of a Nelder-Mead function minimisation (a function of 2 variables). Hence each simplex will have 3 vertices. Therefore I would like to have a function which can output the coordinates of the 3 vertices after each new

Re: [R] time grid for survfit Survival function outputs

2009-10-14 Thread Terry Therneau
( summary(fit, times=c(0,10,20,30,... Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] MLE for lambda of Poisson distribution using fitdistr

2009-10-28 Thread Terry Therneau
,standard errors, residuals, etc. The other covariates are optional of course. If n=1 for all observations the offset can be omitted. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] cox regression extract strata as numeric

2009-10-28 Thread Terry Therneau
-- begin included message --- (basehazzft.ln$stra[285]) [1] stra=2 134 Levels: stra=1 stra=10 stra=100 stra=101 stra=102 ... stra=99 c(basehazzft.ln$stra[285]) [1] 47 while the desired value is 2, I get a 47. What am I doing wrong? I tried the as.numeric function but I have the same problem..

Re: [R] about the cox result

2009-11-03 Thread Terry Therneau
To extract various portions of the coxph standard printout, look at summary.coxph help('summary.coxph') fit - coxph(... sfit - summary(fit) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Help: coxph() in {survival} package

2010-04-20 Thread Terry Therneau
The best answer to your question is help(coxph.object) This is a manual page describing the contents of a coxph fit. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] question on rpart

2010-04-22 Thread Terry Therneau
this without issue. I'd have to see the data; perchance you have found a never-before-seen infinite loop. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Interpreting output of coxph with frailty.gamma

2010-04-27 Thread Terry Therneau
degree of freedom. The frailty terms don't usually have 1 df, so one can't use the special case. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] Problem with time in coxph/survfit

2010-04-28 Thread Terry Therneau
Your problem appears to be with coxphw, not coxph. I have never before heard of the coxphw function; you should identify what package it is from in your request, and perhaps also contact the author. If you have found a similar issue in survfit I would be glad to see an example. Terry Therneau

Re: [R] Understanding of survfit.formula output

2010-05-07 Thread Terry Therneau
a relapse early when all 5 are still at risk, dropping the curve by .2 units. Their death is late when only 2 are at risk, dropping the curve by 1/2. This crossing anomaly usually only happens near the end of a Kaplan-Meier, when the confidence intervals are as wide as a river. Terry Therneau

Re: [R] Mantel-Byar test

2010-05-11 Thread Terry Therneau
The Mantel-Byar test is a simple modification to the logrank test. Can R perform this test or any other similar test? The logrank test = score test from coxph The Mantel-Byar is the score test from a Cox model with a time dependent covariate. Terry Therneau

Re: [R] Splines under tension

2010-05-12 Thread Terry Therneau
a penalty mulitplier. To get a clearer answer you would need to give the explicit definition of tension factor from the literature you are quoting. It's not just that different disciplines rediscover the same ideas, they also relabel them. Terry Therneau

Re: [R] Time dependent Cox model

2010-05-21 Thread Terry Therneau
to use cox.zph() to investigate which variables need time interaction... The cox.zph function is primarily graphical; I would respond to your question with is it good to look at scatterplots before fitting a linear model? My answer to this is emphatically yes. Terry Therneau

Re: [R] Relative Risk/Hazard Ratio plots for continuous variables

2010-05-26 Thread Terry Therneau
plot(data1$cts, predict(coxfit1)) or if you want confidence intervals, this gives the data to plot pr1 - predict(coxfit1, type='terms', se=T) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] How do I specify a partially completed survival analysis model

2009-11-20 Thread Terry Therneau
to program and thus was the first one implimented. However, for simulated data there will not be any ties in time so the two are identical. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] anova() method for coxph objects with robust standard errors

2009-11-24 Thread Terry Therneau
option. There is certainly room for disagreement. Opinions welcome. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Error in text.rpart(fit) : fit is not a tree, just a root

2009-11-25 Thread Terry Therneau
pass the F-to-enter threshold. The plot and text routines won't plot anything for a null tree, because there is nothing interesting to plot. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] rpart: how to assign observations to nodes in regression trees

2009-12-01 Thread Terry Therneau
help('rpart.object') will give you information on the return value from rpart. I think you want the 'where' portion. For new data help('predict.rpart') gives the predicted results. Terry T -- Hi, I am building a regression tree (method=anova) by using

Re: [R] Tobit model fluid milk consumption

2009-12-04 Thread Terry Therneau
to interpret rescaled coefficients, I don't know how to interpret them either. 3. The residual for a censored observation is not a well defined quantity. Hence both the computation and meaning of R^2 are unclear to me. Terry Therneau Terry Therneau __ R-help

Re: [R] problem in labeling the nodes of tree drawn by rpart

2009-12-09 Thread Terry Therneau
In the nodes of the tree, the values of the covariates are represented with a, b or c (tree attached). Try help('text.rpart'), and note the 'pretty' argument therein. There is often not enough room for long labels, and so the default is to do the severe truncation you speak of. Terry Therneau

Re: [R] library(survival)-- cluster

2009-12-11 Thread Terry Therneau
The query was why survreg() with a cluster() statement fails. The answer: a bug. A call to resid() preceded setting the class of the result to 'survreg'. I am currently adding another case to the test suite so that this does not happen again, and to formally validate that the numeric

Re: [R] rpart - classification and regression trees (CART)

2009-12-14 Thread Terry Therneau
When two variables have exactly the same figure of merit, they will be listed in the output in the same order in which they appeared in your model statement. Terry Therneau -- begin inclusion --- I had a question regarding the rpart command in R. I used seven continuous predictor variables

Re: [R] Non-linear Weibull model for aggregated parasite data

2009-12-14 Thread Terry Therneau
*season, data=... One day I should update it so that if there is no censoring then the Surv() wrapper is not required. Also, see the examples in the ?survreg documentation for comments on shape and scale. This routine uses a location-scale parameterization which is different than rweibull. Terry

Re: [R] user-written splits in rpart

2009-12-16 Thread Terry Therneau
of a single variable driving each split, what you are asking for would require an entirely different program. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] rcart - classification and regression trees (CART)

2009-12-16 Thread Terry Therneau
Is there a way to tell it to make a tree with only one node? - see the maxdepth parameter in ?rpart.control Is it safe to assume that the cut-off value on the primary node is the ideal cut-off? - trees are built sequentially; the first split will be the same for a tree with only one split or

Re: [R] Covariate adjusted survival curves

2009-12-18 Thread Terry Therneau
to know the answer too, both how to compute and what the result is worth.) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] 3-D barplot

2009-12-23 Thread Terry Therneau
that most of the data fits an additive model and how well it does so. It is much better than what you requested -- which isn't hard as a 3-d barplot is one of the worst tools ever made for information conveyance. Terry Therneau __ R-help@r

Re: [R] Survival analysis extrapolation

2010-05-27 Thread Terry Therneau
) ~ Treatment, data=survdata) lines(kmfit, mark.time=F, col=1:2) Terry Therneau --- begin included message -- I'm trying to fit a curve to some 1 year failure-time data, so that I can extrapolate and predict failure rates up to 3 years. The data is in the general form: Treatment Time

Re: [R] Problem with plotting survival predictions from cph model

2010-05-27 Thread Terry Therneau
of the day. Terry Therneau (author of the package) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] recurrent events data analysis

2010-06-21 Thread Terry Therneau
explanations, examples, and discussion see T. Therneau and P Grambsch, Modeling Survival Data: Extending the Cox Model, Springer-Verlag, 2000. The book and software evolved together. Terry Therneau __ R-help@r-project.org mailing list https

Re: [R] survfit function - event information??

2010-06-22 Thread Terry Therneau
The table component is a matrix. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Using coxph with Gompertz-distributed survival data.

2010-07-01 Thread Terry Therneau
distributions. For a multivariate model the call above would use mean = sum(x* fit$coef), where x was the vector of values for a hypothetical subject. An alternative is to use predict(fit2, type='quantile'), there is an example in help(predict.survreg). Terry Therneau PS Your title was wrong, the quesion

Re: [R] Modelling survival with time-dependent covariates

2010-07-02 Thread Terry Therneau
increments, the same for each subject. b. the form of the non-ph is actally a linear change in beta over time. Use cox.zph on the original model to look at this. When I see non-ph (the plot from cox.zph is not horizontal) life is rarely so simple. Terry Therneau

Re: [R] Appropriateness of survdiff {survival} for non-censored data

2010-07-08 Thread Terry Therneau
. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Using coxph with Gompertz-distributed survival data.

2010-02-05 Thread Terry Therneau
, but the note below talks about how to do so approximately with survreg. It's a note to myself of something to add to the survival package documentation, not yet done, and to my embarassment the file has a time stamp in 1996. Ah well. Terry Therneau My document A Package for Survival

[R] WMF conversion

2010-02-11 Thread Terry Therneau
Could you save the original graphics as a pdf, and include the pdf in Powerpoint? -- begin included message -- Unfortunately, after placed in the PowerPoint and the PowerPoint is converted to PDF via MS Office's built in conversion utility, the resulting image have diagonal

Re: [R] Total least squares linear regression

2010-02-11 Thread Terry Therneau
, Regression techniques for the detection of analytical bias, Analyst 112:377-383, 1987. K Linnet, Estimation of the linear relationship between the measurements of two methods with proportional errors. Statistics in Medicine 9:1463-1473, 1990. } \author{Terry Therneau} \examples{ # Data from

Re: [R] survival - ratio likelihood for ridge coxph()

2010-02-16 Thread Terry Therneau
it anew. Hindsight is always 20/20. BUT -- I would be quite happy to have someone write a better ridge() plugin. Interested? Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] BMDP and SAS (was R in clinical trials)

2010-02-19 Thread Terry Therneau
you had to cut and paste your block of setup code onto the front of each program's instructions. Cut and paste with a keypunch machine is not quite as simple as with a mouse, if you needed a listing, some frequencies, 2-3 regressions, ... it got rather tedious. Terry Therneau

Re: [R] Class probabilities in rpart

2007-09-17 Thread Terry Therneau
? That is almost correct. If there are prior probabilities, it will be the expected proportion of each class, accounting for priors. If there are no priors, then the expected proportion = observed proportion. Terry Therneau __ R-help@r-project.org

Re: [R] Correlated frailty model

2007-09-24 Thread Terry Therneau
matrix to dense form. The vector of frequencies for group might also be useful. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Apparently Conflicting Results with coxph

2007-10-02 Thread Terry Therneau
, you find that the former group has a much higher death rate. Terry Therneau Kevin E. Thorpe wrote: Dear List: I have a data frame prepared in the couting process style for including a binary time-dependent covariate. The first few rows look like this. PtNo StartEnd

Re: [R] Apparently Conflicting Results with coxph

2007-10-03 Thread Terry Therneau
I thought about this some more, and I'm not sure that possibility is to blame. In my time-dependent model, I don't think I'm doing anything different than is done for transplant in the Stanford Heart Study (the often used example for this kind of time-dependent covariate). As in my case,

Re: [R] some question about partial prediction in survival

2007-10-15 Thread Terry Therneau
For numerical accuracy, the coxph routine centers each covariate before doing the computation. All of the downstream results (predict, survfit, etc) use this centered data. Terry Therneau __ R-help@r-project.org mailing list https

Re: [R] survreg's algorithm

2007-10-16 Thread Terry Therneau
/ In particular, #53 contains information on the parametric models that is not found elsewhere. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] X matrix deemed to be singular in counting process coxph

2007-10-19 Thread Terry Therneau
the current covariate values AT THAT TIME. Since the value of your t is always a constant within the set, the variable contains no information for discriminating the events from the non-events. Zero information -- a coefficient of NA. Terry Therneau Mayo Clinic

Re: [R] plotting survival curves

2007-10-26 Thread Terry Therneau
You have (unimportant lines omitted) c2= survdiff(Surv(act.surv.time,censoring)~treatgrp ,data=b) plot(c2) The problem is that you are using the wrong function. It is survfit that creates plottable survival curves, survdiff only does the log-rank test. Terry Therneau

Re: [R] R validation

2007-11-06 Thread Terry Therneau
of SAS infallability). Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Direct adjusted survival?

2008-01-31 Thread Terry Therneau
method (1961) brought forward to a Cox model. The ideas are not hard, but it does take a whole chapter. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Log rank test power

2008-02-01 Thread Terry Therneau
retires, whichever comes first. L.L. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal

Re: [R] R programming style

2008-02-12 Thread Terry Therneau
that improves readability is a good thing. Agreements: 98% of what they say. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Formulae for R functions

2008-02-13 Thread Terry Therneau
printing out the R internal code, which has been stripped of all comments. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Cox model

2008-02-13 Thread Terry Therneau
you should research before going forward. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal

Re: [R] User defined split function in Rpart

2008-02-14 Thread Terry Therneau
this behavior. I happen to slightly prefer option 1, which of course means that it became the default behavior in rpart. (For a categorical y with many levels, however, rpart orders on the percent of observations in category 1, which may not be particularly useful.) Terry

Re: [R] Confidence Interval for SMR

2008-02-20 Thread Terry Therneau
cipoisson(observed, expected) Terry Therneau Mayo Clinic cipoisson - function(k, time = 1, p = 0.95, method = c(exact, anscombe) ) { nn - max(length(k), length(time), length(p)) if(nn 1) { k - rep(k, length = nn) time - rep(time

Re: [R] Compare mean survival time

2008-02-20 Thread Terry Therneau
is the sum of the variances. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Nested frailty model

2008-02-22 Thread Terry Therneau
as the random effect. A Cox model with one random effect per subject is not stable -- actually an one where df(random effect) approaches the number of events is not --- and you will likely get a variance estimate whose confidence interval is (0, huge number). Terry Therneau

Re: [R] Problem plotting curve on survival curve

2008-03-03 Thread Terry Therneau
the se.fit=T argument to get confidence bounds for the curves. (A couple more lines for your matplot call of course). Terry Therneau Mayo Clinic __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Cox model+ROCR

2008-03-04 Thread Terry Therneau
. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] coxme - fitting random treatment effect nested within centre

2008-03-05 Thread Terry Therneau
) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] survival analysis and censoring

2008-03-12 Thread Terry Therneau
censored at 2. The gambling analogy would be kicking someone out of the casino just before they win -- it does odd things to the odds. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] How to set type of censored data in coxph regression

2008-03-13 Thread Terry Therneau
defined for right-censored data. That is why you get an error when you include left and interval censored observations. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Recursive partitioning algorithms in R vs. alia

2009-06-23 Thread Terry Therneau
A point of history: Both the commercial CART program and the rpart() function are based on the book Classification and Regression Trees (Breiman, Friedman, Olshen, Stone, 1984). As a reader/commentator on one of the early drafts I got to know the material well. CART started as a large

Re: [R] Coxph frailty model counting process error X matrix deemed singular

2009-06-25 Thread Terry Therneau
' in coxph. Why substitute an inferior approximation for the better one? Of course with simulated data there are no ties, in which case all the methods are identical. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Question about rpart decision trees (being used to predict customer churn)

2009-07-27 Thread Terry Therneau
to be just right you can get your data to split. You need to make them such that 85/5 is predicted as 'no cancel' and 5/5 as 'yes cancel'; 1:2 losses would suffice. In the example where you set losses to 1:1 both nodes are scored as a 'yes'. Terry Therneau

Re: [R] Cox ridge regression

2009-08-03 Thread Terry Therneau
one. Not surprisingly, the second ends up with a coefficient of 0 (within machine precision of zero). The warning message you got about NaN is likely related to this, that there are redundant terms in the model. Terry Therneau __ R-help@r

Re: [R] survdiff for left-truncated data?

2009-08-04 Thread Terry Therneau
=na.exclude) o.minus.e - tapply(resid(fit0), mydata$group, sum) obs - tapply(mydata$status, mdata$group, sum) cbind(observed=obs, expected= obs- o.minus.e, o-e=o.minus.e) Terry Therneau __ R-help@r-project.org mailing list https

Re: [R] Trying to run simple survival program in R

2008-08-08 Thread Terry Therneau
) Call: survfit(formula = data) It is best to use a formula with the survfit program; the preferred way to call it would be km - survfit(Surv(t, c) ~1) print(km) plot(km) etc. Terry Therneau __ R-help@r-project.org mailing list https

Re: [R] predicted survival curves from a Cox time dep model

2008-08-11 Thread Terry Therneau
: the cluster() directive confuses the survfit function. This is a bug. I will address it. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] non-negative least squares

2008-09-08 Thread Terry Therneau
I have a problem whose solution requires non-negative least squares. That is minimize sum(y - Xbeta)^2 subject to beta =0 Splus has the nnls.fit command. Is there an R alternative? Terry Therneau __ R-help@r-project.org

Re: [R] Coxph and loglik converged before variable X

2008-09-18 Thread Terry Therneau
. Spline fits based on the truncated power basis (which Frank Harrell uses) are one way to generate such spurious messages. Frank has argued with me that these messages may be shedding more confusion than illumination. He has a point. Terry Therneau

Re: [R] cch function and time dependent covariates

2008-06-12 Thread Terry Therneau
? It causes the case to have a relative weight of approx 0 in a particular weighted mean; exp(-100) is small enough and doesn't cause trouble for the exp function. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] case-cohort

2008-06-12 Thread Terry Therneau
coefficients as the cch example, along with the infinitesimal jackknife or robust variance estimate. Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] cch() and coxph() for case-cohort

2008-06-16 Thread Terry Therneau
. So what? Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Capturing coxph warnings and errors

2008-06-18 Thread Terry Therneau
could be ignored. However, I am very interested in the error message; it is one I have not seen before. If you could recreate the data set that produces it and send it to be that would be useful. Terry Therneau (author of coxph

Re: [R] Survival Analysis with two different events

2008-06-30 Thread Terry Therneau
for a multi-line dataset =1 if THIS interval ends with an event. Look at the survival analysis chapter of Venables Ripley, Modern Applied Statistics with S, for further insight. (or many other books) Terry Therneau __ R-help@r-project.org mailing

Re: [R] cohort sampling

2008-07-01 Thread Terry Therneau
# remember who was chosen chosen[cases] - i # link them to the right case } fit - coxph(Surv(time, status) ~ x1 + x2 + strata(chosen), subset= (chosen 0)) Terry Therneau

Re: [R] survival package test stats

2008-07-03 Thread Terry Therneau
so omitted Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

  1   2   3   4   5   >