On Thu, 11 Sep 2008, Giulia Barbati wrote:
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).
What did the maintainer say when you asked (see the posting guide)?
You didn't give a reproducible example: here is my attempt to make
yours reproducible in a legible way):
library(relsurv)
data(rdata); data(slopop)
fit <-rsmul(Surv(time,cens) ~ sex + as.factor(agegr) +
ratetable(age=age*365.24,sex=sex,year=year),
ratetable = slopop, data = rdata)
And that works in
sessionInfo()
R version 2.7.2 (2008-08-25)
x86_64-unknown-linux-gnu
locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] relsurv_1.4 survival_2.34-1
loaded via a namespace (and not attached):
[1] tools_2.7.2
So, please do follow the posting guide: it looks like the problem is local
to you.
There are perhaps others packages to fit relative survival models ?
Giulia
----- Original Message ----
From: Prof Brian Ripley <[EMAIL PROTECTED]>
To: Yihui Xie <[EMAIL PROTECTED]>
Cc: Giulia Barbati <[EMAIL PROTECTED]>; 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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
> 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, [EMAIL PROTECTED]
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
--
Brian D. Ripley, [EMAIL PROTECTED]
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
______________________________________________
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.