Announcement

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

  • #16
    Yes, use the commands in #10 before using the keep command to inspect your data (you can add in 1/100 to the end of list command to look at the first 100 observations) and see which observations will be kept and dropped.
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #17
      Thank you Nick for the article!! It IS very helpful to be "politically correct" while speaking in Stata language

      Comment


      • #18
        Many thanks Carole!

        Comment


        • #19
          On pedantry, see e.g. http://blogs.warwick.ac.uk/jmiles/im...trand_russell/

          Comment


          • #20
            Nick and Carole, just one more thing to clarify. As you see in the result Flag==1 worked well for the observations with non-missing data re-approval date. However, if there was a missing data, this record with missing was kept (As Nick you pointed out before).
            I wonder, if this code somehow could be modified to ensure that among two observations where one is with missing and the other observation without missing data, the last one without the missing data is kept in the subset?
            that is imperative for my analysis
            Thank you once again

            Comment


            • #21
              Originally posted by Nick Cox View Post
              I love this image!!!

              Comment


              • #22

                Code:
                gsort patient_id -Approval_date
                by patient: keep if _n==1
                Minus missing is just missing, so -latest date becomes earliest date

                Comment


                • #23
                  Before using the keep command to inspect what happened with my data, which command could be used between those two codes:
                  gsort patient_id -Approval_date by patient: keep if _n==1

                  Comment


                  • #24
                    Code:
                    list
                    
                    edit

                    Comment

                    Working...
                    X