Displaying 20 results from an estimated 10000 matches similar to: "Table vs unique"
2016 Mar 16
2
match and unique
Is the phrase "index <- match(x, sort(unique(x)))" reliable, in the sense that it will
never return NA?
Context: Calculation of survival curves involves the concept of unique death times. I've
had reported cases in the past where survfit failed, and it was due to the fact that two
"differ by machine precision" values would sometimes match and sometimes not,
2012 Nov 26
1
Plotting an adjusted survival curve
First a statistical issue: The survfit routine will produce predicted survival curves for
any requested combination of the covariates in the original model. This is not the same
thing as an "adjusted" survival curve. Confusion on this is prevalent, however. True
adjustment requires a population average over the confounding factors and is closely
related to the standardized
2011 Oct 01
4
Is the output of survfit.coxph survival or baseline survival?
Dear all,
I am confused with the output of survfit.coxph.
Someone said that the survival given by summary(survfit.coxph) is the
baseline survival S_0, but some said that is the survival S=S_0^exp{beta*x}.
Which one is correct?
By the way, if I use "newdata=" in the survfit, does that mean the survival
is estimated by the value of covariates in the new data frame?
Thank you very much!
2009 Feb 25
3
survival::survfit,plot.survfit
I am confused when trying the function survfit.
my question is: what does the survival curve given by plot.survfit mean?
is it the survival curve with different covariates at different points?
or just the baseline survival curve?
for example, I run the following code and get the survival curve
####
library(survival)
fit<-coxph(Surv(futime,fustat)~resid.ds+rx+ecog.ps,data=ovarian)
2012 Nov 27
4
Fitting and plotting a coxph with survfit, package(surv)
Hi Dear R-users
I have a database with 18000 observations and 20 variables. I am running
cox regression on five variables and trying to use survfit to plot the
survival based on a specific variable without success.
Lets say I have the following coxph:
>library(survival)
>fit <- coxph(Surv(futime, fustat) ~ age + rx, data = ovarian)
>fit
what I am trying to do is plot a survival
2012 Nov 17
4
survfit & number of variables != number of variable names
This works ok:
> cox = coxph(surv ~ bucket*(today + accor + both) + activity, data = data)
> fit = survfit(cox, newdata=data[1:100,])
but using strata leads to problems:
> cox.s = coxph(surv ~ bucket*(today + accor + both) + strata(activity),
> data = data)
> fit.s = survfit(cox.s, newdata=data[1:100,])
Error in model.frame.default(data = data[1:100, ], formula = ~bucket + :
2007 Dec 09
2
Getting estimates from survfit.coxph
Dear all,
I'm having difficulty getting access to data generated by survfit and
print.survfit when they are using with a Cox model (survfit.coxph).
I would like to programmatically access the median survival time for
each strata together with the 95% confidence interval. I can get it on
screen, but can't get to it algorithmically. I found myself examining
the source of print.survfit to
2019 Jun 01
4
survival changes
In the next version of the survival package I intend to make a non-upwardly compatable
change to the survfit object.? With over 600 dependent packages this is not something to
take lightly, and I am currently undecided about the best way to go about it.? I'm looking
for advice.
The change: 20+ years ago I had decided not to include the initial x=0,y=1 data point in
the survfit object
2013 Jan 31
1
obtainl survival curves for single strata
Dear useRs,
What is the syntax to obtain survival curves for single strata on many subjects?
I have a model based on Surv(time,response) object, so there is a single row per subject and no start,stop and no switching of strata.
The newdata has many subjects and each subject has a strata and the survival based on the subject risk and the subject strata is needed.
If I do
newpred <-
2006 Dec 29
2
Survfit with a coxph object
I am fitting a coxph model on a large dataset (approx 100,000 patients), and
then trying to estimate the survival curves for several new patients based
on the coxph object using survfit. When I run coxph I get the coxph object
back fairly quickly however when I try to run survfit it does not come
back. I am wondering if their is a more efficient way to get predicted
survival curves from a coxph
2007 Nov 13
2
plotting coxph results using survfit() function
i want to make survival plots for a coxph object using survfit
function. mod.phm is an object of coxph class which calculated results
using columns X and Y from the DataFrame. Both X and Y are
categorical. I want survival plots which shows a single line for each
of the categories of X i.e. '4' and 'C'. I am getting the following
error:
> attach(DataFrame)
>
2011 Feb 03
3
coxph fails to survfit
I have a model with quant vars only and the error message does not make sense:
(mod1 <- coxph(Surv(time=strt,time2=stp,event=(resp==1))~ +incpost+I(amt/1e5)+rate+strata(termfac),
subset=dt<"2010-08-30", data=inc,method="efron"))
Call:
coxph(formula = Surv(time = strt, time2 = stp, event = (resp ==
1)) ~ +incpost + I(amt/1e+05) + rate + strata(termfac),
2019 Jun 01
3
survival changes
> On Jun 1, 2019, at 12:59 PM, Peter Langfelder <peter.langfelder at gmail.com> wrote:
>
> On Sat, Jun 1, 2019 at 3:22 AM Therneau, Terry M., Ph.D. via R-devel
> <r-devel at r-project.org> wrote:
>>
>> In the next version of the survival package I intend to make a non-upwardly compatable
>> change to the survfit object. With over 600 dependent packages
2011 May 06
2
coxph and survfit issue - strata
Dear users,
In a study with recurrent events:
My objective is to get estimates of survival (obtained through a Cox model) by rank of recurrence and by treatment group.
With the following code (corresponding to a model with a global effect of the treatment=rx), I get no error and manage to obtain what I want :
data<-(bladder)
2010 Sep 23
2
extending survival curves past the last event using plot.survfit
Hello,
I'm using plot.survfit to plot cumulative incidence of an event.
Essentially, my code boils down to:
cox <-coxph(Surv(EVINF,STATUS) ~ strata(TREAT) + covariates, data=dat)
surv <- survfit(cox)
plot(surv,mark.time=F,fun="event")
Follow-up time extends to 54 weeks, but the last event occurs at week
30, and no more people are censored in between. Is there a
2009 Feb 25
3
survival::predict.coxph
Hi,
if I got it right then the survival-time we expect for a subject is the
integral over the specific survival-function of the subject from 0 to t_max.
If I have a trained cox-model and want to make a prediction of the
survival-time for a new subject I could use
survfit(coxmodel, newdata=newSubject) to estimate a new
survival-function which I have to integrate thereafter.
Actually I thought
2011 Jan 14
1
Survfit: why different survival curves but same parameter estimates?
Hello,
I'm trying to estimate a Cox proportional hazard model with time-varying covariates using coxph. The parameter estimates are fine but there is something wrong with the survival curves I get with survfit (results are not plausible).
Let me explain why I think something's wrong.
To make sure I'm setting up my data correctly to estimate a model with time-varying covariates, I
2013 Jan 17
3
coxph with smooth survival
Hello users,
I would like to obtain a survival curve from a Cox model that is smooth and does not have zero differences due to no events for those particular days.
I have:
> sum((diff(surv))==0)
[1] 18
So you can see 18 days where the survival curve did not drop due to no events.
Is there a way to ask survfit to fit a nice spline for the survival??
Note: I tried survreg and it did not
2012 Oct 13
4
Problems with coxph and survfit in a stratified model with interactions
I?m trying to set up proportional hazard model that is stratified with
respect to covariate 1 and has an interaction between covariate 1 and
another variable, covariate 2. Both variables are categorical. In the
following, I try to illustrate the two problems that I?ve encountered, using
the lung dataset.
The first problem is the warning:
To me, it seems that there are too many dummies
2012 Oct 08
1
Survival prediction
> Dear All,
>
> I have built a survival cox-model, which includes a covariate * time interaction. (non-proportionality detected)
> I am now wondering how could I most easily get survival predictions from my model.
>
> My model was specified:
> coxph(formula = Surv(event_time_mod, event_indicator_mod) ~ Sex +
> ageC + HHcat_alt + Main_Branch + Acute_seizure +