Thank you.

But the problem with the "relsurv" package remains: when I try to use the function "rsmul" following the package example, it give me an error (Error in nrow(x) : object "x" not found).
There are perhaps others packages to fit relative survival models ?

Giulia



----- Original Message ----
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
To: Yihui Xie <xieyihui@gmail.com>
Cc: Giulia Barbati <g.barbati@yahoo.com>; r-help@r-project.org
Sent: Wednesday, September 10, 2008 11:44:43 AM
Subject: Re: [R] relsurv package

On Wed, 10 Sep 2008, Yihui Xie wrote:

> For the second question, try something like:
>
>> strptime('12/4/1996','%M/%d/%Y')
> [1] "1996-09-04 00:12:00"
> # only date?
>> as.Date(strptime('12/4/1996','%M/%d/%Y'))
> [1] "1996-09-04"

Why not

> as.Date('12/4/1996', format = '%m/%d/%Y')
[1] "1996-12-04"

? (And note the typo in your solution and hence incorrect answer.)

>
> Yihui
>
> On Wed, Sep 10, 2008 at 4:22 PM, Giulia Barbati <g.barbati@yahoo.com> wrote:
>>
>> Dear R-users,
>>
>> I have a couple of questions about the relsurv package:
>>
>> 1) when I try to run the example:
>>
>> fit <- rsmul(Surv(time,cens)~sex+as.factor(agegr)+ratetable(age=age*365.24,sex=sex,year=year),ratetable=slopop,data=rdata)
>>
>> with the datasets in the package (rdata and slopop) it gives me an error:
>>
>> Error in nrow(x) : object "x" not found
>>
>> 2)
>> If I have a date format like:"6/17/1997 " "9/10/1990 " "12/4/1996 " how
>> to convert it in the Rdate format required by ratetable?
>>
>> Thank you very much for help,
>>
>> Giulia
>>
>>
>>
>
> -- 
> Yihui Xie <xieyihui@gmail.com>
> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
> Mobile: +86-15810805877
> Homepage: http://www.yihui.name
> School of Statistics, Room 1037, Mingde Main Building,
> Renmin University of China, Beijing, 100872, China
>
> ______________________________________________
> R-help@r-project.org 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.
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



      
	[[alternative HTML version deleted]]

