[R] relsurv package
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Sep 11 10:52:14 CEST 2008
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):
fit <-rsmul(Surv(time,cens) ~ sex + as.factor(agegr) +
ratetable = slopop, data = rdata)
And that works in
R version 2.7.2 (2008-08-25)
attached base packages:
 splines stats graphics grDevices utils datasets methods
other attached packages:
 relsurv_1.4 survival_2.34-1
loaded via a namespace (and not attached):
So, please do follow the posting guide: it looks like the problem is local
> There are perhaps others packages to fit relative survival models ?
> ----- Original Message ----
> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> To: Yihui Xie <xieyihui at gmail.com>
> Cc: Giulia Barbati <g.barbati at yahoo.com>; r-help at 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')
> >  "1996-09-04 00:12:00"
> > # only date?
> >> as.Date(strptime('12/4/1996','%M/%d/%Y'))
> >  "1996-09-04"
> Why not
> > as.Date('12/4/1996', format = '%m/%d/%Y')
>  "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 at yahoo.com>
> >> 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
> >> with the datasets in the package (rdata and slopop) it gives me an
> >> 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 "
> >> to convert it in the Rdate format required by ratetable?
> >> Thank you very much for help,
> >> Giulia
> > --
> > Yihui Xie <xieyihui at 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 at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > and provide commented, minimal, self-contained, reproducible code.
> Brian D. Ripley, ripley at 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
Brian D. Ripley, ripley at 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
More information about the R-help