Displaying 20 results from an estimated 2000 matches similar to: "Question on survival"
2008 Mar 03
1
Problem plotting curve on survival curve
Calum had a long question about drawing survival curves after fitting a Weibull
model, using pweibull, which I have not reproduced.
It is easier to get survival curves using the predict function. Here is a
simple example:
> library(survival)
> tfit <- survreg(Surv(time, status) ~ factor(ph.ecog), data=lung)
> table(lung$ph.ecog)
0 1 2 3 <NA>
63 113 50 1
2012 May 16
1
survival survfit with newdata
Dear all,
I am confused with the behaviour of survfit with newdata option.
I am using the latest version R-2-15-0. In the simple example below I am building a coxph model on 90 patients and trying to predict 10 patients. Unfortunately the survival curve at the end is for 90 patients. Could somebody please from the survival package confirm that this behaviour is as expected or not - because I
2004 Jul 04
2
smooth non cumulative baseline hazard in Cox model
Hi everyone.
There's been several threads on baseline hazard in Cox model but I think
they were all on cumulative baseline hazard,
for instance
http://tolstoy.newcastle.edu.au/R/help/01a/0464.html
http://tolstoy.newcastle.edu.au/R/help/01a/0436.html
"basehaz" in package survival seems to do a cumulative hazard.
extract from the basehaz function:
sfit <- survfit(fit)
H
2007 Dec 05
4
coxme frailty model standard errors?
Hello,
I am running R 2.6.1 on windows xp
I am trying to fit a cox proportional hazard model with a shared
Gaussian frailty term using coxme
My model is specified as:
nofit1<-coxme(Surv(Age,cen1new)~ Sex+bo2+bo3,random=~1|isl,data=mydat)
With x1-x3 being dummy variables, and isl being the community level
variable with 4 levels.
Does anyone know if there is a way to get the standard error
2010 Oct 27
2
coxph linear.predictors
I would like to be able to construct hazard rates (or unconditional death prob) for many subjects from a given survfit.
This will involve adjusting the ( n.event/n.risk)
with (coxph object )$linear.predictors
I must be having another silly day as I cannot reproduce the linear predictor:
fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)
fit$linear.predictors[1]
[1] 2.612756
2011 May 12
3
Survival Rate Estimates
Dear List,
Is there an automated way to use the survival package to generate survival
rate estimates and their standard errors? To be clear, *not *the
survivorship estimates (which are cumulative), but the survival *rate *
estimates...
Thank you in advance for any help.
Best,
Brian
[[alternative HTML version deleted]]
2007 Jul 24
1
Fit t distribution
Hi all, I am trying to fit t distribution using the function "tFit" in the
library(fBasics).
I am using the code tFit(datac[[2]]) and it returns the following list.
Title:
Student-t Parameter Estimation
Call:
tFit(x = datac[[2]])
Model:
Student-t Distribution
Estimated Parameter(s):
df
78.4428
I just wonder how can I refer to the estimated parameters. I tried
2008 Apr 25
3
Use of survreg.distributions
Dear R-user:
I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way:
tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(id), dist="gaussian", data=y.data, scale=0, weights=w)
my.gaussian<-survreg.distributions$gaussian
2008 Dec 02
1
Left-truncated regression
Hi.
I am looking for a function for left-truncated data.
I have one data set with 2 variables (Hours~Yrs_Ed).
I already left-censored the data at 200 and left-truncated it at the same
spot, so that I am able to make 2 estimations (one for censoring and one for
truncation).
I know how to make the linear regression for the left-censored variable
(hours) and how to plot the regression line into the
2010 Oct 06
4
problem with abline
Hi All,
I am running a scatter plot and trying to add a best fit line. I use an abline function, but get no line drawn over the points. I also get no error. I arm using V 2.10.0 on Windows 7.
Here is my code, including the SAS transport file import:
require (foreign)
require (chron)
require (Hmisc)
require (lattice)
clin <- sasxport.get("y:\\temp\\subset.xpt")
attach(clin)
2006 Jan 19
2
Tobit estimation?
Folks,
Based on
http://www.biostat.wustl.edu/archives/html/s-news/1999-06/msg00125.html
I thought I should experiment with using survreg() to estimate tobit
models.
I start by simulating a data frame with 100 observations from a tobit model
> x1 <- runif(100)
> x2 <- runif(100)*3
> ystar <- 2 + 3*x1 - 4*x2 + rnorm(100)*2
> y <- ystar
> censored <- ystar <= 0
2011 Apr 05
6
simple save question
Hi,
When I run the survfit function, I want to get the restricted mean
value and the standard error also. I found out using the "print"
function to do so, as shown below,
print(km.fit,print.rmean=TRUE)
Call: survfit(formula = Surv(diff, status) ~ 1, type = "kaplan-meier")
records n.max n.start events *rmean *se(rmean) median
200.000
2012 Oct 19
1
Looping survdiff
The number of recent questions from umn.edu makes me wonder if there's homework involved....
Simpler for your example is to use get and subset.
dat <- structure(..... as found below
var.to.test <- names(dat)[4:6] #variables of interest
nvar <- length(var.to.test)
chisq <- double(nvar)
for (i in 1:nvar) {
tfit <- survdiff(Surv(time, completion==2) ~
2007 Dec 17
2
Capture warning messages from coxph()
Hi,
I want to fit multiple cox models using the coxph() function. To do
this, I use a for-loop and save the relevant results in a separate
matrix. In the example below, only two models are fitted (my actual
matrix has many more columns), one gives a warning message, while the
other does not. Right now, I see all the warning message(s) after the
for-loop is completed but have no idea which model
2012 May 12
1
access the se of a forecast
Hi everybody,
I am currently trying to forecast some double seasonal time series by using
the function dshw. I want to access the standard errors to build the
confident interval for my forecast. I am using to following code :
fit<-dshw(eem,period1=7,period2=48,h=48)
then by using summary(fit), I see that my se are contained in the vector :
$s20
but when I call fit$s20, I get NULL.
I
2008 May 12
3
help with rpart
Hi,
I am using rpart as a part of my masters' project. I am trying to print out
the resulting model using plot() function along with text() function. I am
having difficulties with labels being cut-off. In text() function, I am
using use.n=T option to get the number of people in each nodes but the on
the lower and left part of the plot, the numbers get cut off. Thanks!
Linus
[[alternative
2008 Aug 12
2
ANOVA tables - storing F values
When I run a summary(anova) I get output for all of the elements (columns)
as these are multiple - single anova results. Can I store the F values? I
can't find the attribute of the fitted model attributes(fit) that stores
these F values, and for that matter, P values.
Thanks
--
Gareth Campbell
PhD Candidate
The University of Auckland
P +649 815 3670
M +6421 256 3511
E
2009 Dec 22
1
Slow survfit -- is there a faster alternative?
Using R 2.10 on Windows:
I have a filtered database of 650k event observations in a data frame
with 20+ variables.
I'd like to be able to quickly generate estimate and plot survival
curves. However the survfit and cph() functions are extremely slow.
As an example: I tried
results.cox<-coxph(Surv(duration, success) ~ start_time + factor1+
factor2+ variable3, data=filteredData) #(took a
2012 May 07
1
estimating survival times with glmnet and coxph
Dear all,
I am using glmnet (Coxnet) for building a Cox Model and
to make actual prediction, i.e. to estimate the survival function S(t,Xn) for a
new subject Xn. If I am not mistaken, glmnet (coxnet) returns beta, beta*X and
exp(beta*X), which on its own cannot generate S(t,Xn). We miss baseline
survival function So(t).
Below is my code which takes beta coefficients from
glmnet and creates coxph
2009 Feb 09
2
CMD check puzzle
I am getting an error that I don't understand from R CMD check on my current
instance of the survival code. R2.7.1 on Linux. Here is the last of the
log
* checking line endings in Makefiles ... OK
* checking for portable use of $BLAS_LIBS ... OK
* creating survival-Ex.R ... OK
* checking examples ... OK
* checking tests ...
make[1]: Entering directory