Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to generate weeks?


    . tab date_patologi

    Date of PA |
    examination | Freq. Percent Cum.
    ------------+-----------------------------------
    01apr2015 | 1 2.50 2.50
    15may2015 | 1 2.50 5.00
    29may2015 | 1 2.50 7.50
    07jul2015 | 1 2.50 10.00
    07aug2015 | 1 2.50 12.50
    19oct2015 | 1 2.50 15.00
    14dec2015 | 1 2.50 17.50
    18dec2015 | 1 2.50 20.00
    28dec2015 | 1 2.50 22.50
    18jan2016 | 1 2.50 25.00
    29jan2016 | 1 2.50 27.50
    11feb2016 | 1 2.50 30.00
    19feb2016 | 1 2.50 32.50
    23feb2016 | 1 2.50 35.00
    02mar2016 | 1 2.50 37.50
    15mar2016 | 1 2.50 40.00
    31mar2016 | 1 2.50 42.50
    12apr2016 | 1 2.50 45.00
    13apr2016 | 1 2.50 47.50
    19may2016 | 1 2.50 50.00
    04jun2016 | 1 2.50 52.50
    08jun2016 | 1 2.50 55.00
    09jun2016 | 1 2.50 57.50
    02sep2016 | 1 2.50 60.00
    05sep2016 | 1 2.50 62.50
    10oct2016 | 1 2.50 65.00
    14oct2016 | 1 2.50 67.50
    23oct2016 | 1 2.50 70.00
    28oct2016 | 1 2.50 72.50
    13dec2016 | 1 2.50 75.00
    02jan2017 | 1 2.50 77.50
    18jan2017 | 1 2.50 80.00
    22feb2017 | 1 2.50 82.50
    07mar2017 | 1 2.50 85.00
    23mar2017 | 1 2.50 87.50
    11apr2017 | 1 2.50 90.00
    02may2017 | 1 2.50 92.50
    03may2017 | 1 2.50 95.00
    05jun2017 | 1 2.50 97.50
    08jun2017 | 1 2.50 100.00
    ------------+-----------------------------------
    Total | 40 100.00

    . tab fu

    Date at the |
    last of |
    follow-up | Freq. Percent Cum.
    ------------+-----------------------------------
    09sep2015 | 1 2.50 2.50
    15nov2015 | 1 2.50 5.00
    17may2016 | 1 2.50 7.50
    11jul2016 | 1 2.50 10.00
    15jul2016 | 1 2.50 12.50
    19jul2016 | 1 2.50 15.00
    08sep2016 | 1 2.50 17.50
    10sep2016 | 1 2.50 20.00
    07oct2016 | 1 2.50 22.50
    24oct2016 | 1 2.50 25.00
    22nov2016 | 1 2.50 27.50
    25nov2016 | 1 2.50 30.00
    14dec2016 | 1 2.50 32.50
    15dec2016 | 1 2.50 35.00
    13mar2017 | 2 5.00 40.00
    24mar2017 | 1 2.50 42.50
    14jun2017 | 1 2.50 45.00
    18jun2017 | 1 2.50 47.50
    03jul2017 | 1 2.50 50.00
    07jul2017 | 1 2.50 52.50
    10jul2017 | 1 2.50 55.00
    11jul2017 | 9 22.50 77.50
    12jul2017 | 7 17.50 95.00
    13jul2017 | 2 5.00 100.00
    ------------+-----------------------------------
    Total | 40 100.00

    . gen weeks= date_patologi - event

    . tab weeks

    weeks | Freq. Percent Cum.
    ------------+-----------------------------------
    20178 | 1 2.50 2.50
    20221 | 1 2.50 5.00
    20236 | 1 2.50 7.50
    20275 | 1 2.50 10.00
    20306 | 1 2.50 12.50
    20379 | 1 2.50 15.00
    20434 | 1 2.50 17.50
    20439 | 1 2.50 20.00
    20449 | 1 2.50 22.50
    20469 | 1 2.50 25.00
    20480 | 1 2.50 27.50
    20495 | 1 2.50 30.00
    20503 | 1 2.50 32.50
    20506 | 1 2.50 35.00
    20514 | 1 2.50 37.50
    20526 | 1 2.50 40.00
    20543 | 1 2.50 42.50
    20554 | 1 2.50 45.00
    20556 | 1 2.50 47.50
    20592 | 1 2.50 50.00
    20609 | 1 2.50 52.50
    20612 | 2 5.00 57.50
    20699 | 1 2.50 60.00
    20701 | 1 2.50 62.50
    20735 | 1 2.50 65.00
    20739 | 1 2.50 67.50
    20750 | 1 2.50 70.00
    20754 | 1 2.50 72.50
    20801 | 1 2.50 75.00
    20821 | 1 2.50 77.50
    20837 | 1 2.50 80.00
    20871 | 1 2.50 82.50
    20885 | 1 2.50 85.00
    20901 | 1 2.50 87.50
    20919 | 1 2.50 90.00
    20941 | 1 2.50 92.50
    20942 | 1 2.50 95.00
    20975 | 1 2.50 97.50
    20977 | 1 2.50 100.00
    ------------+-----------------------------------
    Total | 40 100.00

    and the result come out like that, how can i make it 1 week etc?

  • #2
    sorry wrong syntax i tried
    Code:
    . generate weeks= date_patologi - fu / 7
    
    . tab weeks
    
          weeks |      Freq.     Percent        Cum.
    ------------+-----------------------------------
       17221.29 |          1        2.50        2.50
          17229 |          1        2.50        5.00
       17321.71 |          1        2.50        7.50
       17349.14 |          1        2.50       10.00
       17370.29 |          1        2.50       12.50
          17418 |          1        2.50       15.00
       17434.29 |          1        2.50       17.50
       17465.57 |          1        2.50       20.00
       17468.14 |          1        2.50       22.50
       17469.43 |          1        2.50       25.00
       17493.43 |          1        2.50       27.50
       17501.43 |          1        2.50       30.00
       17532.57 |          1        2.50       32.50
          17538 |          1        2.50       35.00
       17546.43 |          1        2.50       37.50
       17554.43 |          1        2.50       40.00
       17563.57 |          1        2.50       42.50
       17602.43 |          1        2.50       45.00
       17606.43 |          1        2.50       47.50
          17608 |          1        2.50       50.00
       17612.43 |          1        2.50       52.50
       17628.57 |          1        2.50       55.00
       17634.86 |          1        2.50       57.50
       17697.14 |          1        2.50       60.00
       17730.29 |          1        2.50       62.50
       17735.43 |          1        2.50       65.00
       17739.29 |          1        2.50       67.50
       17748.43 |          1        2.50       70.00
          17769 |          1        2.50       72.50
       17799.43 |          1        2.50       75.00
       17819.43 |          1        2.50       77.50
       17835.29 |          1        2.50       80.00
       17871.57 |          1        2.50       82.50
       17883.29 |          1        2.50       85.00
       17899.14 |          1        2.50       87.50
       17921.71 |          1        2.50       90.00
       17939.29 |          1        2.50       92.50
       17940.29 |          1        2.50       95.00
       17973.57 |          1        2.50       97.50
       17980.29 |          1        2.50      100.00
    ------------+-----------------------------------
          Total |         40      100.00
    the result come out like this

    Comment


    • #3
      At a guess you want something

      date of follow-up MINUS date of diagnosis

      measured in weeks -- which could be

      Code:
      Code:
      (fu -  date_patologi) / 7
      and if so so your expression needs some surgery.

      Comment


      • #4
        thanks!! i did it and it works

        Code:
        . tab event
        
          Status at |
         the end of |
          follow-up |      Freq.     Percent        Cum.
        ------------+-----------------------------------
            survive |         13       32.50       32.50
               dead |         18       45.00       77.50
           censored |          9       22.50      100.00
        ------------+-----------------------------------
              Total |         40      100.00
        is it correct to recode
        survive and dead as 0 not relapsing
        and 1 censored as relapsing?? (right censoring)
        which one is relapse
        please help me with this one too
        Last edited by garnet mont; 22 Jan 2021, 01:34.

        Comment


        • #5
          Sorry, but I don't work in medical statistics or epidemiology and have no idea what makes sense for your data in your project.

          Comment


          • #6
            okay thank you for help, really helpful!!

            Comment

            Working...
            X