[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.


[R] nls error in formula

2005-04-18 Thread Anaid Diaz
Hi,
I'm a new R user, with a lot of questions. At the
moment I'm stoped on an error traying to fit a model:

 x - sandeel ## numeric data (2500-6)
 y - Noss   ## numeric data  (0-1.2)
 A - 0.8
 B - 0.6
 C - 1/4
 nls( y ~ A-B*exp(-C*x))
Error in match.call(definition, call, expand.dots) : 
.Primitive... is not a function

I'm not sure if the error is due to the formula sytax
or something else.
I'll appreciate any help

Sylvia


_
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx

__
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


Re: [R] nls error in formula

2005-04-18 Thread Anaid Diaz
thank you, it worked.

Sylvia
--- Douglas Bates [EMAIL PROTECTED] wrote:
 Anaid Diaz wrote:
  Hi,
  I'm a new R user, with a lot of questions. At the
  moment I'm stoped on an error traying to fit a
 model:
  
  
 x - sandeel ## numeric data (2500-6)
 y - Noss   ## numeric data  (0-1.2)
 A - 0.8
 B - 0.6
 C - 1/4
 nls( y ~ A-B*exp(-C*x))
  
  Error in match.call(definition, call, expand.dots)
 : 
  .Primitive... is not a function
  
  I'm not sure if the error is due to the formula
 sytax
  or something else.
  I'll appreciate any help
  
  Sylvia
 
 Use
 
 nls(y ~ A -B*exp(-C*x), start = c(A = 0.8, B = 0.6,
 C = 1/4))
 
 instead or, preferably,
 
 nls(y ~ SSasymp(x, Asym, R0, lrc))
 
 and read
 
 ?SSasymp
 
 for an interpretation of the estimated parameters.
 

_
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx

__
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