Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: time_split and polyfrac


From   Kim Oren Gradel / Region Nordjylland <kog@rn.dk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: time_split and polyfrac
Date   Thu, 27 Nov 2008 14:15:51 +0100

Dear Stata-listers,

I have encountered a problem when using -time_split- in connection with -polyfrac-

I wanted to calculate 0-7, 8-30, and 31-365 day mortality and use -polyfrac-
within each of these three periods to find the best model for a continuous
exposure variable.

As an example I'll give details on the middle (8-30 day) period.

Initially, I -stset- the data to 365-day mortality and made -time_split-
(session 1, below). For this model I calculated -fracpoly-, and this was
not correct (output has been omitted below, but there were 4659 persons and
408 of these died in the 8-30 day period, which the Cox model showed, whilst
-polyfrac- gave  "Number of obs   = 480").

Then I did -stset- to 30-day mortality and reiterated the procedures (Session 2).
That gave the correct result in -polyfrac- ("Number of obs   = 4659" and other
considerations not mentioned here have also convinced me that this was correct).

The output from -xi: stcox- was - as expected - exactly the same in Session 1 and 2.

Intuitively I would also expect the outcome to be the same for -polyfrac- as
this is based on the preceding Cox model, but it seems as if it also "gathers"
information from beyond day 30 in Session 1.

Can anybody explain why different -stset- have to be used in connection with
-time_split- for -fracpoly-, but not for -stcox-??

Best regards,

Kim O. Gradel
DVM, PhD, research assistant
Forskningens Hus
Department of Clinical Epidemiology
Sdr. Skovvej 15
Aalborg Hospital, Århus University Hospital
DK-9000 Aalborg, Denmark
Phone, direct: +45 99 32 69 02
Fax: +45 99 32 69 14
E-mail: kog@rn.dk


********************************************************************************
* Session 1, begin:

. stset stat365, origin(time proeve_taget_dato) fail(doed365) id(cpr)
. stsplit time_split , at(7,30)
. xi: stcox i.fokgrp_bak i.sex_bak alder i.comorb_grp i.speciale_grp /*
  */ i.bak_opr_grp result4 if time_split==7 , nohr nolog
[output omitted]
. fracpoly cox _t result4 fokgrp_bak sex_bak alder comorb_grp /*
  */ speciale_grp bak_opr_grp if time_split==7 , dead(doed365) compare
[output omitted]

* Session 1, end
********************************************************************************


**********************************************************************************
* Session 2, begin:

. stset stat30, origin(time proeve_taget_dato) fail(doed30) id(cpr)
. stsplit time_split , at(7,30)
. xi: stcox i.fokgrp_bak i.sex_bak alder i.comorb_grp i.speciale_grp /*
  */ i.bak_opr_grp result4 if time_split==7 , nohr nolog
[output omitted]
. xi: fracpoly cox _t result4 i.fokgrp_bak i.sex_bak alder i.comorb_grp /*
  */ i.speciale_grp i.bak_opr_grp if time_split==7 , dead(doed30) compare
[output omitted]

* Session 2, end
********************************************************************************



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index