Displaying 20 results from an estimated 27 matches for "basehaz".
Did you mean:
basea
2007 Sep 27
2
center option of basehaz in survfit
I have a very general question about what the centering option in basehaz does to factors. (basehaz computes the baseline cumulative hazard for a coxph object using the Breslow estimator).
Lets say I'm interested in a survival model with two (dichotomous) factors and a continuous covariate.
Variable Possible Values
Factor1 0 or 1
Factor...
2012 Aug 08
1
basehaz() in package 'Survival' and warnings() with coxph
Hello,
I have a couple of questions with regards to fitting a coxph model to a data
set in R:
I have a very large dataset and wanted to get the baseline hazard using the
basehaz() function in the package : 'survival'.
If I use all the covariates then the output from basehaz(fit), where fit is
a model fit using coxph(), gives 507 unique values for the time and the
corresponding cumulative hazard function. However if I use a subset of the
varaibles, basehaz() gives 6...
2008 Apr 07
2
basehaz and newdata
I am unable to get the basehaz function to apply a proportional
hazards model to a new data frame. I replicated my specific situation
with the example for coxph in the help, where I changed the x value of
the first record from 0 to 1. Is there something incorrect in the
syntax that I am using? Thanks in advance!
test1 <-...
2012 Aug 09
1
basehaz() in package survival and warnings with coxph
...de, what is your sessionInfo()?
Terry Therneau
On 08/09/2012 04:11 AM, r-help-request at r-project.org wrote:
> I have a couple of questions with regards to fitting a coxph model to a data
> set in R:
>
> I have a very large dataset and wanted to get the baseline hazard using the
> basehaz() function in the package : 'survival'.
> If I use all the covariates then the output from basehaz(fit), where fit is
> a model fit using coxph(), gives 507 unique values for the time and the
> corresponding cumulative hazard function. However if I use a subset of the
> varaible...
2007 Jan 19
1
Error in basehaz function ?
Hello R-users.
I believe that the way basehaz (in the survival package) compute the
baseline hazard function is false.
I come to question this function when it gives me hazard probabilities
greater than 1.
Looking at the code I think I've localised the error :
hazard probability is computed as :
H <- -log(surv)
but it seems to me...
2009 Mar 14
1
obtaining the values for the hazard function in a cox regression
...h the package survival (v.
2.34-1) and a log-log plot obtained using Design (v. 2.1-2).
For two variables, the lines in the survival curves crossed. The
statistician I been obtaining advice from (who does not use R) asked
me to obtain the hazard function values. I am wanting to confirm
whether basehaz is the correct command to obtain such values, to
better understand what is occurring in the log plots.
Below is the code that I have been using. Any assistance is appreciated,
regards
Bob
library(survival)
recidivismv <- read.csv("g://Chapsurv_v.csv",header=T)
cox.V <- coxph...
2012 Jan 25
4
formula error inside function
I want use survfit() and basehaz() inside a function, but it doesn't work.
Could you take a look at this problem. Thanks for your help. Following is my
codes:
library(survival)
n <- 50 # total sample size
nclust <- 5 # number of clusters
clusters <- rep(1:nclust,each=n/nclust)
beta0 <- c(1,2)
set.seed(13)
#...
2009 Dec 16
1
Baseline survival estimate
Dear R-help,
I am trying to obtain the baseline survival estimate of a fitted Cox model
(S_0 (t)). I know that previous posts have said use 'basehaz' but this
gives the baseline hazard function and not the baseline survival estimate.
Is there a way to obtain the baseline survival estimate or do I have to use
the formula which does something like S(t) = exp[- the integral from 0 to t
of h(u) du]?
Thank you for your assistance,
Laura
fit1...
2009 Oct 27
2
cox regression extract strata as numeric
...I perform a stratified cox and then I need the strata as a numeric array "straft.ln"
ft.ln <- coxph(Surv(times,deaths)~ages+chemos+chemos:f1+chemos:f2+horms+horms:f1+horms:f2+grades+grades:f1+grades:f2+positives+positives:f1+positives:f2+sizes+sizes:f1+sizes:f2+strata(stra),data=ddd)
basehazzft.ln=basehaz(ft.ln,centered=FALSE)
H0ft.ln=c(basehazzft.ln[,1])
timeft.ln=c(basehazzft.ln[,2])
straft.ln=c(basehazzft.ln[,3])
I notice that basehazzft.ln[,3] is not the same with straft.ln with respect to the values i.e.:
(basehazzft.ln$stra[1])
[1] stra=1
134 Levels: stra=1 stra=10 stra=100 str...
2006 Mar 07
1
breslow estimator for cumulative hazard function
Dear R-users,
I am checking the proportional hazard assumption of a cox model for a
given covariate, let say Z1, after adjusting for other relavent covariates
in the model. To this end, I fitted cox model stratified on the discrete
values of Z1 and try to get beslow estimator for the baseline cumulative
hazard function (H(t)) in each stratum. As far as i know, if the
proportionality assumption
2005 Jun 10
1
Estimate of baseline hazard in survival
...)^exp(X_iB) is the expression for the survival
function
And
-ln(S_o(t_i) ) is the expression for the cumulative baseline hazard
function, H_o(t_i)
Then by rearranging the expression for the survival function I get the
following:
-ln(S_o(t_i) ) = -ln( S(t_i|X_i,B) ) / exp(X_iB)
= basehaz(fit)/exp(fit$linear.predictors)
Am I right so far and is there an easier way?
The plot of the cumulative baseline hazard function , H_o(t_i), should be
linear across time. Once I have, H_o(t_i), to get at h_o(t_i) I then need
to reverse the cumsum operation. The corresponding plot should have a
c...
2011 Jun 16
0
coxph: cumulative mortality hazard over time with associated confidence intervals
...cumulative mortality hazard
over time for both males and females with associated confidence
intervals. I would like to make sure I obtained proper estimates of
the cumulative hazard for both males and females with associated
confidence intervals but I have doubts regarding my calculations
# I used basehaz ?H0? to get to the baseline hazard (covariate level
0, males in this case)
basehazard <- basehaz(M1, centered=FALSE)[,1]
NBLOWCI <- basehazard * exp(1.96*sqrt(M1$var[1]))
NBHIGHCI <- basehazard * exp(-1.96*sqrt(M1$var[1]))
# I applied the following equation H0*exp(Beta*X) to get to the...
2009 May 04
1
Nelson-Aalen estimator of cumulative hazard
...Can anyone explain to me the reason for the discrepancy?
require(foreign)
gb <- read.dta("GB.dta") # Green & Byar data; N = 483
# Method 1
fit1 <- coxph( Surv(time, status=="Cancer" | status=="CVD" | status=="Other") ~ 1, data=gb)
h1 <- basehaz(fit1)
# Method 2
fit2 <- survfit(Surv(time, status=="Cancer" | status=="CVD" | status=="Other") ~ 1, data=gb)
jump <- fit2$n.event > 0
h2 <- cumsum(fit2$n.event[jump]/fit2$n.risk[jump])
plot(h1$time, h1$hazard - h2)
Thank you,
Ravi.
_________________...
2004 Aug 13
1
How to use the whole dataset (including between events) in Cox model (time-varying covariates) ?
...zard (e.g. by package pspline) and ask for its
derivative" (https://stat.ethz.ch/pipermail/r-help/2004-July/052376.html)
the following code could be use to estimate (and plot) a smooth baseline
hazard:
> t<-seq(min(data$start),max(data$stop),length=100)
> lines(t,
predict(sm.spline(x=basehaz(coxfit)[,2],y=basehaz(coxfit)[,1],norder=2),
t,1))
#there is a problem with this code. One should add the contraint that the
baseline hazard cannot be negative.
The following computes the parametric part of the cox model.
> risk <- predict(coxfit, type='risk') # gives exp(X'b)
s...
2003 Jul 11
2
hazard estimate
Dear list,
is there a function available which provides an estimate of the hazard
function
based on a cox proportional hazard model? I only found the cumulative
hazard and the survival function as survfit options.
Thanks for your help
Peter
2009 Feb 23
1
predicting cumulative hazard for coxph using predict
...ant to predict the cumulative hazard for each person for their next event at a given time in future.What is the best way to compute it?
Currently I am doing it by pulling the different elements and putting them together using my own code.
For example, I get the cumulative baseline hazard from the basehaz function
bh<-basehaz(m)
bh$hazard for the strata in which the predicted event is and the time that matches to the prediction time.
xbeta from predict function
xbeta<-predict(m,newdata,type="lp")
fval<-m$frail
Regards
Zainab
2003 Aug 04
1
coxph and frailty
...60313783 2.39101856 1.20878208 0.18226221 0.39845758
[7] 0.33727506 0.23804627 0.02622108
What do the means fitf2$means[6:9] correspond to?
I am asking these questions because I would like to clarify how the
frailty terms enter into the computation of the baseline cumulative hazard
via the basehaz(fitf, centered=FALSE) function. It would seem that the way
the basehaz function operates is different dependening upon how many
frailty groups there are.
Thank you very much for your help.
giacomo
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 <- -log(sfit$surv)
Since sfit$surv is monotonic, H will be monotonic too, which makes me think
it is a cumulative function. I think H(t) it is the "sum" (&q...
2012 Jul 06
1
How to compute hazard function using coxph.object
...d function(H_0(t)) ##
Hazard.Function <- -log(MODEL.COXPH.SURVFIT.SURV)
################################################
################################################
# Baseline hazard function can also be calculated explicitly ##
MODEL.COXPH.BASELINEHAZ <- basehaz(MODEL.COXPH)
##########################################################################################
##########################################################################################
##########################################################################################
############...
2006 Nov 03
1
How to obtain the estimate of baseline survival function?
Hi,
If I fit a Cox model using "coxph", is there a R function so that I
could obtain the estimate of baseline survival function? Thank you.
Zheng
--
Zheng Yuan
Ph.D student
Department of Biostatistics
University of Michigan
Ann Arbor, MI 48109