Announcement

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

  • -dater- command: how does it work?

    Dear Listers,

    I am using some old code written by a colleague who has now left.

    I believe the code was written in 2010, presumably using Stata 10 or 11. He uses a command called -dater- in his code. I am assuming the code can transform string dates into numerical but I am not 100% sure and I have no way of asking him.

    I was hoping someone may shed some light on this command and whether I can get it to run in Stata 15.

    Thanks,
    Laura

  • #2
    It's possible that -dater- could be a custom made function. At least, I could not find a package or function called -dater- using the search feature in Stata. Therefore, it may be impossible to tell you what that exact function did.

    If you need to parse strings as dates, you may find it useful to read -help dates-. Here is a trivial example of reading in a string as a Stata-recognized date and formatted the displayed output.

    Code:
    . display %tdCCYY-Mon-DD date("28jul2018", "DMY")
    2018-Jul-28

    Comment


    • #3
      I should have also asked, does your colleagues code using -dater- still run? What is the output of -viewsource dater.ado- ?

      Comment


      • #4
        To expand on Leonardo's posts, it is possible that dater is a general-purpose command that your former colleague wrote and kept in the Stata PERSONAL ado directory for his account on his system. By creating it in a file named dater.ado, it would be loaded the first time in a Stata session that dater is needed. From within Stata, adopath tells me where to find my PERSONAL directory.
        Code:
        . adopath
          [1]  (BASE)      "/Applications/Stata/ado/base/"
          [2]  (SITE)      "/Applications/Stata/ado/site/"
          [3]              "."
          [4]  (PERSONAL)  "/Users/lisowskiw/Library/Application Support/Stata/ado/personal/"
          [5]  (PLUS)      "/Users/lisowskiw/Library/Application Support/Stata/ado/plus/"
          [6]  (OLDPLACE)  "~/ado/"
        I'm guessing that you have tried running the code that uses dater on your system and it has failed because the command is not found on your system. If you have access to the system and account on which the colleage ran his code, you might find it in his PERSONAL ado directory.

        Comment


        • #5
          Thanks for all your replies. It seems -dater- must have been written by my colleague. Unfortunately, I can;t access his drive so I will just replace it in the do file with the appropriate code.


          Comment

          Working...
          X