[R] survival function with a Weibull dist

2006-09-21 Thread Anaid Diaz
Hi
I am using R to fit a survival function to my data
(with a weibull distribution).

Data: Survival of individuals in relation to 4
treatments ('a','b','c','g') 

syntax:
   survreg(Surv(date2)~males2, dist='weibull')

But I have some problems interpreting the outcome and
getting the parameters for each curve.

-  Value Std. Error  z   
p
-  (Intercept)  2.788  0.147 19.022
1.13e-80
- males2b -0.107  0.207 -0.519
6.04e-01
- males2c -0.486  0.586 -0.831
4.06e-01
- males2g  0.580  0.207  2.798
5.15e-03
- Log(scale)  -1.116  0.139 -8.007
1.18e-15
- 
- Scale= 0.328 


I know from Venables  Ripley (2002) that the
parameters of this function should be two:

lambda = z (presumably Value in R for each
treatment)
alpha = k (scale in R)

Survival function (S):

S(t)= exp-(zt)^k

I don't quite understand how to use the intercept.
First I thought adding it to each other treatment
value, for example:

Survival Males2a (t) = exp – ((intercept + 0) * t) ^ k
Survival Males2b (t) = exp – ((intercept + zb)* t) ^ k

But the curves I get using this interpretation are not
similar to my data


Does anyone use this function and could help me to
interpret the results?

many thanks


Anaid

__
R-help@stat.math.ethz.ch 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 function with a Weibull dist

2006-09-21 Thread Thomas Lumley
On Thu, 21 Sep 2006, Anaid Diaz wrote:

 Hi
 I am using R to fit a survival function to my data
 (with a weibull distribution).

 Data: Survival of individuals in relation to 4
 treatments ('a','b','c','g')

 syntax:
    survreg(Surv(date2)~males2, dist='weibull')

 But I have some problems interpreting the outcome and
 getting the parameters for each curve.

 -  Value Std. Error  z
 p
 -  (Intercept)  2.788  0.147 19.022
 1.13e-80
 - males2b -0.107  0.207 -0.519
 6.04e-01
 - males2c -0.486  0.586 -0.831
 4.06e-01
 - males2g  0.580  0.207  2.798
 5.15e-03
 - Log(scale)  -1.116  0.139 -8.007
 1.18e-15
 -
 - Scale= 0.328


 I know from Venables  Ripley (2002) that the
 parameters of this function should be two:

this function being which function? As help(survreg.distributions) says
  The Weibull distribution is not parameterised the
  same way as in 'rweibull'.

In your model the survival time is a variable whose logarithm has 
distribution

2.788-0.107males2b-0.486males2c+0.580males2g+epsilon*0.328

where epsilon has cdf F=1-e^{-e^t}.

As in the example on help(survreg.distributions) shows, a survreg Weibull 
model with linear predictor M and scale S corresponds to R's weibull 
distribution with scale exp(M) and shape 1/S.

-thomas

__
R-help@stat.math.ethz.ch 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.