pharmaverse / ggsurvfit

http://www.danieldsjoberg.com/ggsurvfit/
Other
67 stars 19 forks source link

At risk numbers from start of Interval #198

Closed chprogr closed 2 months ago

chprogr commented 2 months ago

Is your feature request related to a problem? Please describe. when i get the atrsik numbers from ggsurvfit package i see that the numbers reported are from end of interval. is there a way to get from start of interval. For ex: day 0, day 30(1-30), day 180(31 to 180 ),day 365(181 to 365) .

Describe the solution you'd like I would like to see the atrisk numbers from start of intervals like o, day 1,day 31,day 181 for the intervals described above.

ddsjoberg commented 2 months ago

Thanks for your post.

That sounds like "n.censor", which is already available. If that is not what you're looking for, can you please update your post the a reproducible example (code and data I can run on my machine) illustrating your request, and please compare your request to "n.censor". https://www.danieldsjoberg.com/ggsurvfit/reference/add_risktable.html

chprogr commented 2 months ago

Interval Post Procedure Days.docx not the censored subjects in the interval. I am looking for n.risk numbers from begining of interval. I a attaching the template.

this is my sas code.

data master2;****for atrisk accuracy*****; set master; time=&var.d; event=&var; if time ne . and event eq . then event=0; if time in (1,31,181) then time=time+1; run; proc sort; by grp time; run;

/atrisk accuracy/ ods output ProductLimitEstimates=atrsk ; proc lifetest method=km data=master2 conftype=loglog timelist=(&timela); strata grp; time time*event(0); id pt; run;

data atrsk; set atrsk; format timelist 8.0; if timelist in (1) then timelist=30; if timelist in (31) then timelist=180; if timelist in (181) then timelist=365;

run;at risk completed;

ddsjoberg commented 2 months ago

Dear @chprogr ,

Hope that helps.

chprogr commented 2 months ago

image

i just provided the table as an example I have attached sas output with annotation.

ddsjoberg commented 2 months ago

Thank you for the additional context. I saw the document and SAS code. If you needed assistance calculating the quantity you're after, I could help you if you provided example raw data.

But it looks like you're seeking to put these numbers on a ggsurvfit figure: that is unfortunately not supported.

chprogr commented 2 months ago

sure. Thank you Daniel.

ddsjoberg commented 2 months ago

anytime, happy programming!