Displaying 20 results from an estimated 1000 matches similar to: "Survival analysis extrapolation"
2010 Sep 21
2
Survival curve mean adjusted for covariate: NEED TO DO IN NEXT 2 HOURS, PLEASE HELP
Hi
I am trying to determine the mean of a Weibull function that has been fit to
a data set, adjusted for a categorical covariate , gender (0=male,1=female).
Here is my code:
library(survival)
survdata<-read.csv("data.csv")
##Fit Weibull model to data
WeiModel<-survreg(Surv(survdata$Time,survdata$Status)~survdata$gender)
summary(WeiModel)
P<-pweibull(n,
2008 Feb 08
2
Catching NaNs from pweibull()
Hello,
I am working with the nls() function and inserting a formula into it that
uses the pweibull function. However the pweibull function is annoyingly
producing NaNs, which nls() refuses to handle. I have put a sample of the
code below. Is there a way to prevent these NaNs from interfering, for
example a method to catch them? I get the following error when I try to run
the code:
res.nls <-
2013 Mar 03
1
distribution functions and lists
Hello everyone,
I have a quick question but I am stuck with it and I do not know how to solve it.
Imagine I need the distribution function of a Weibull(1,1) at t=3, then I will write pweibull(3,1,1).
I want to keep the shape and scale parameters in a list (or a vector or whatever). Then I have
parameters<-list(shape=1,scale=1)
but when I write pweibull(3,parameters) I get the following
2002 May 11
4
Is this a bug of pweibull()?
In rw1050, I found that
> pweibull(3:10, 2)
[1] 0.9998766 0.9999999 1.0000000 1.0000000 NaN NaN
[7] NaN NaN
Warning message:
NaNs produced in: pweibull(q, shape, scale, lower.tail, log.p)
more surprisingly,
> pweibull(3:10, 2.1)
[1] 0.9999566 1.0000000 1.0000000 -Inf NaN NaN
[7] NaN NaN
Warning message:
NaNs produced in: pweibull(q,
2002 May 12
2
Is this a bug of pweibull()? (Follow up)
Please allow me to add just a little more about this:
nothing wrong with pweibull(), namely, the two cases I reported:
pweibull(3:10, 2) and pweibull(3:10, 2.1),
in rw1041 and earlier version.
I wonder this might just due to the change from rw1041 to rw1050,
however, I can't find anything relevant (seems to me) in the News
or Readme.
Thanks Sundar for the suggestion of using 1 -
2008 Nov 26
1
survreg and pweibull
Dear all -
I have followed the thread the reply to which was lead by Thomas
Lumley about using pweibull to generate fitted survival curves for
survreg models.
http://tolstoy.newcastle.edu.au/R/help/04/11/7766.html
Using the lung data set,
data(lung)
lung.wbs <- survreg( Surv(time, status)~ 1, data=lung, dist='weibull')
curve(pweibull(x, scale=exp(coef(lung.wbs)),
2011 Jun 23
2
Confidence interval from resampling
Dear R gurus,
I have the following code, but I still not know how to estimate and extract
confidence intervals (95%CI) from resampling.
Thanks!
~Adriana
#data
penta<-c(770,729,640,486,450,410,400,340,306,283,278,260,253,242,240,229,201,198,190,186,180,170,168,151,150,148,147,125,117,110,107,104,85,83,80,74,70,66,54,46,45,43,40,38,10)
x<-log(penta+1)
plot(ecdf(x),
2004 Nov 23
6
Weibull survival regression
Dear R users,
Please can you help me with a relatively straightforward problem that I
am struggling with? I am simply trying to plot a baseline survivor and
hazard function for a simple data set of lung cancer survival where
`futime' is follow up time in months and status is 1=dead and 0=alive.
Using the survival package:
lung.wbs <- survreg( Surv(futime, status)~ 1, data=lung,
2004 Apr 22
1
slower execution in R 1.9.0
I have an R function (about 1000 lines long) that takes more than 20
times as long to run under R Windows 1.9.0 and 1.8.1 than it does under
1.7.1. Profile results indicate that the $<-.data.frame operation is
the culprit, but I don't understand exactly what that is (assignment of
data frame elements to another variable?), or why it's only a problem
under 1.8.1 and 1.9.0. Any advice?
2013 Apr 24
2
Trouble Computing Type III SS in a Cox Regression
I should hope that there is trouble, since "type III" is an undefined concept for a Cox
model. Since SAS Inc fostered the cult of type III they have recently added it as an
option for phreg, but I am not able to find any hints in the phreg documentation of what
exactly they are doing when you invoke it. If you can unearth this information, then I
will be happy to tell you whether
2009 Jun 20
1
Plotting Cumulative Hazard Functions with Strata
Hello:
So i've fit a hazard function to a set of data using
kmfit<-survfit(Surv(int, event)~factor(cohort))
this factor variable, "cohort" has four levels so naturally the strata
variable has 4 values.
I can use this data to estimate the hazard rate
haz<-n.event/n.risk
and calculate the cumulative hazard function by
H<--log(haz)
Now, I would like to plot this
2008 Mar 02
1
Problem plotting curve on survival curve (something silly?)
OK this is bound to be something silly as I'm completely new to R -
having started using it yesterday. However I am already warming to its
lack of 'proper' GUI... I like being able to rerun a command by editing
one parameter easily... try and do that in a Excel Chart Wizzard!
I eventually want to use it to analyse some chemotherapy response /
survival data. That data will not be
2002 Feb 28
1
pweibull.c (PR#1334)
Full_Name: M Welinder
Version: 1.4
OS: (src)
Submission from: (NULL) (192.5.35.38)
It seems to me that pweibull can be improved in the lower_tail=TRUE and
log_p=FALSE
case by using expm1. Something like
-expm1(-pow(x / scale, shape)),
I think.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
2007 Feb 21
2
Coxph and ordered factors
Dear useRs,
I am trying to fit a Cox PH model on survival data from a lung cancer
dataset. I would like to include the patient staging (I-IV) as a
covariate. For this I use the following function:
coxph(Surv(time,status) ~ stage)
The staging information is a categorical variable, and it is important
to take the ordering into account (I<II<III<IV). Does the coxph function
handle
2010 Mar 01
1
Fitting chi-squared distribution
Dear all,
I have a question regarding performing test if the data fits chi-squared
distribution.
For example, using ks.test()
I found in the examples how to fit it to gamma or weibull
x<-rnorm(100)
ks.test(x, "pweibull", shape=2,scale=1)
for the gamma, pgamma can be used
But I cannot find the value of this second parameter for the chi-squared
distribution.
Maybe someone
2012 Jan 04
1
KS and AD test for Generalized PAreto and Generalized Extreme value
Dear R helpers,
I need to use KS and AD test for Generalized Pareto and Generalized extreme value.
E.g. if I need to use KS for Weibull, I have teh syntax
ks.test(x.wei,"pweibull", shape=2,scale=1)
Similarly, for AD I use
ad.test(x, distr.fun, ...)
My problem is fir given data, I have estimated the parameters of GPD and GEV using lmom. But I am not able to find out the distribution
2007 Dec 18
2
"gam()" in "gam" package
R-users
E-mail: r-help@r-project.org
I have a quenstion on "gam()" in "gam" package.
The help of gam() says:
'gam' uses the _backfitting
algorithm_ to combine different smoothing or fitting methods.
On the other hand, lm.wfit(), which is a routine of gam.fit() contains:
z <- .Fortran("dqrls", qr = x * wts, n = n, p = p, y = y *
2004 Oct 28
2
Weighted regresion using lm
Hi:
Could anyone help me to clarify this: are the weights normalized inside lm
function (package:stats) before applied to the error term? For example:
>lm (cost ~ material, weights=quatity, data=receipt)
will lm normalize quatity such that sum(quatity) = 1? I traced to lm.wfit and
then the weights get transferred into a precompiled FORTRAN module so I can't
figure out. Thanks!
2006 Aug 04
0
Question regarding extrapolation
Hi,
I am facing a problem in extrapolation of data series. It is a series of
Bond yields, I am having the yield for 1 year to 30 years. I want to find
the yield for 0.5 year and 30.5 years. I used the Langrange's Extrapolation
but the extrapolation deviates from the normal trend ( as we can see in
theoritical yield curves) very sharply, as go on increasing my years from 30
years to 35 years