survival anaylsis with tabulated data

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

survival anaylsis with tabulated data

Ergin Artun
  Dear R Friends,

I'm a medical doctor with some knowledge about statistic and programming.
I want to analysis and compare data of different countries with survival or
popEpi tools in R.
I couldn't able to make tables with one row for every people of countries
without illness. I can made a data table look like as:

time
country at.risk from0to1 sk zf from0to0
1 AFG 40363639 1 K F 0

I try to prepare for analysis with survtab_ag function of Epi package. When
I run
st <- survtab_ag(time ~ cuntry, data = xxxx, surv.type =
"surv.obs",surv.breaks=list(xxxx$time),
+                  surv.method = "lifetable",
+                  d = "from0to1")
I see just the error message:
Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
  'x' must be atomic

Can any body help me for preparing this kind tabulated data without surv()
to other survival functions?
Best regards from Turkey

Tanju Aktug

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: survival anaylsis with tabulated data

PIKAL Petr
Hi

I am not an expert and cannot give you canned solution, but here are few
comments:

Without knowing data structure it is hard to decipher where is the problem.
So posting result of
str(yourata) or at least part of it hardly anybody could help.
Cuntry is typo?
The error could by result of typo or not properly structured data.

This is plain text mail list, please do not use HTML formating.

Cheers
Petr

> -----Original Message-----
> From: R-help <[hidden email]> On Behalf Of Ergin Artun
> Sent: Wednesday, May 20, 2020 2:01 PM
> To: [hidden email]
> Subject: [R] survival anaylsis with tabulated data
>
>   Dear R Friends,
>
> I'm a medical doctor with some knowledge about statistic and programming.
> I want to analysis and compare data of different countries with survival
or
> popEpi tools in R.
> I couldn't able to make tables with one row for every people of countries
> without illness. I can made a data table look like as:
>
> time
> country at.risk from0to1 sk zf from0to0
> 1 AFG 40363639 1 K F 0
>
> I try to prepare for analysis with survtab_ag function of Epi package.
When

> I run
> st <- survtab_ag(time ~ cuntry, data = xxxx, surv.type =
> "surv.obs",surv.breaks=list(xxxx$time),
> +                  surv.method = "lifetable",
> +                  d = "from0to1")
> I see just the error message:
> Error in sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
>   'x' must be atomic
>
> Can any body help me for preparing this kind tabulated data without surv()
> to other survival functions?
> Best regards from Turkey
>
> Tanju Aktug
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: survival anaylsis with tabulated data

PIKAL Petr
Hallo

I am not private consultant so please keep your messages on help list.

From help page I understand that the function survtab_ag needs to have **specially prepared** data as input. We could only guess if your data are in correct format and most probably they are not.

Without knowing details I wonder if anybody is able to help you.

Cheers
Petr

From: Ergin Artun <[hidden email]>
Sent: Thursday, May 21, 2020 3:08 PM
To: PIKAL Petr <[hidden email]>
Subject: Re: [R] survival anaylsis with tabulated data

Dear Pical,
I'm also not  an expert and had a typo error while translating colum names at code.

At my data set time(as day), at.risk(people), from0to1(as people with event), from0to0(censored values for the function) are integers, Country, and the other two columns are charecter strings.

Best regards...
Tanju  

PIKAL Petr <mailto:[hidden email]>, 21 May 2020 Per, 12:53 tarihinde şunu yazdı:
Hi

I am not an expert and cannot give you canned solution, but here are few
comments:

Without knowing data structure it is hard to decipher where is the problem.
So posting result of
str(yourata) or at least part of it hardly anybody could help.
Cuntry is typo?
The error could by result of typo or not properly structured data.

This is plain text mail list, please do not use HTML formating.

Cheers
Petr

> -----Original Message-----
> From: R-help <mailto:[hidden email]> On Behalf Of Ergin Artun
> Sent: Wednesday, May 20, 2020 2:01 PM
> To: mailto:[hidden email]
> Subject: [R] survival anaylsis with tabulated data
>
>   Dear R Friends,
>
> I'm a medical doctor with some knowledge about statistic and programming.
> I want to analysis and compare data of different countries with survival
or
> popEpi tools in R.
> I couldn't able to make tables with one row for every people of countries
> without illness. I can made a data table look like as:
>
> time
> country at.risk from0to1 sk zf from0to0
> 1 AFG 40363639 1 K F 0
>
> I try to prepare for analysis with survtab_ag function of Epi package.
When

> I run
> st <- survtab_ag(time ~ cuntry, data = xxxx, surv.type =
> "surv.obs",surv.breaks=list(xxxx$time),
> +                  surv.method = "lifetable",
> +                  d = "from0to1")
> I see just the error message:
> Error in http://sort.int(x, na.last = na.last, decreasing = decreasing, ...) :
>   'x' must be atomic
>
> Can any body help me for preparing this kind tabulated data without surv()
> to other survival functions?
> Best regards from Turkey
>
> Tanju Aktug
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> mailto:[hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: survival anaylsis with tabulated data

John Kane-3
 http://adv-r.had.co.nz/Reproducibility.html

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example



On Thu, 21 May 2020 at 09:16, PIKAL Petr <[hidden email]> wrote:

> Hallo
>
> I am not private consultant so please keep your messages on help list.
>
> From help page I understand that the function survtab_ag needs to have
> **specially prepared** data as input. We could only guess if your data are
> in correct format and most probably they are not.
>
> Without knowing details I wonder if anybody is able to help you.
>
> Cheers
> Petr
>
> From: Ergin Artun <[hidden email]>
> Sent: Thursday, May 21, 2020 3:08 PM
> To: PIKAL Petr <[hidden email]>
> Subject: Re: [R] survival anaylsis with tabulated data
>
> Dear Pical,
> I'm also not  an expert and had a typo error while translating colum names
> at code.
>
> At my data set time(as day), at.risk(people), from0to1(as people with
> event), from0to0(censored values for the function) are integers, Country,
> and the other two columns are charecter strings.
>
> Best regards...
> Tanju
>
> PIKAL Petr <mailto:[hidden email]>, 21 May 2020 Per, 12:53
> tarihinde şunu yazdı:
> Hi
>
> I am not an expert and cannot give you canned solution, but here are few
> comments:
>
> Without knowing data structure it is hard to decipher where is the problem.
> So posting result of
> str(yourata) or at least part of it hardly anybody could help.
> Cuntry is typo?
> The error could by result of typo or not properly structured data.
>
> This is plain text mail list, please do not use HTML formating.
>
> Cheers
> Petr
>
> > -----Original Message-----
> > From: R-help <mailto:[hidden email]> On Behalf Of Ergin
> Artun
> > Sent: Wednesday, May 20, 2020 2:01 PM
> > To: mailto:[hidden email]
> > Subject: [R] survival anaylsis with tabulated data
> >
> >   Dear R Friends,
> >
> > I'm a medical doctor with some knowledge about statistic and programming.
> > I want to analysis and compare data of different countries with survival
> or
> > popEpi tools in R.
> > I couldn't able to make tables with one row for every people of countries
> > without illness. I can made a data table look like as:
> >
> > time
> > country at.risk from0to1 sk zf from0to0
> > 1 AFG 40363639 1 K F 0
> >
> > I try to prepare for analysis with survtab_ag function of Epi package.
> When
> > I run
> > st <- survtab_ag(time ~ cuntry, data = xxxx, surv.type =
> > "surv.obs",surv.breaks=list(xxxx$time),
> > +                  surv.method = "lifetable",
> > +                  d = "from0to1")
> > I see just the error message:
> > Error in http://sort.int(x, na.last = na.last, decreasing = decreasing,
> ...) :
> >   'x' must be atomic
> >
> > Can any body help me for preparing this kind tabulated data without
> surv()
> > to other survival functions?
> > Best regards from Turkey
> >
> > Tanju Aktug
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > mailto:[hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > 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.
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>


--
John Kane
Kingston ON Canada

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.