Announcement

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

  • egen function xtile() not found even with egenmore installed

    Hello everyone,

    I am not a pro on Stata but need to use it for a research paper in Finance for my degree.
    I am trying to use the xtile() fonction :

    * quartiles

    egen xquartile = xtile(x), n(4)
    gen xq1=0 if xquartile!=.


    But when I use it, the error message appears:

    . egen xquartile = xtile(x), n(4)
    unknown egen function xtile()
    r(133);


    I have been searching on the forum for two hours, and found nothing that really works for me. I saw that I was supposed to use

    ssc inst egenmore

    Which seems to be a package containing the function, but when I wrote that line in my code, it returned an error message telling me I already had egenmore.
    I also tried to use gen instead of egen but I did not work either (not surprisingly, as gen is used for simpler calculations)...

    I am a bit lost, and coding isn't my cup of tea... I would be very grateful for any help I can get !!

    Thank you very much

  • #2
    Code:
    ssc install egenmore
    is indeed what you are expected to type to install egenmore. Much of the point about ssc is that it should automatically put the package files in a place where Stata can see them.

    If you type

    Code:
    adopath
    then ssc should install the files in a folder of what adopath calls PLUS

    You can look for the files concerned by (in Stata) looking for _gxtile.ado (note the underscore) and egenmore.sthlp and then if that fails using your unstated operating system to look for those files.

    If you can't find them, then all is not lost, necessarily, as your example should yield to Stata's official command

    Code:
    xtile xquartile=x, nq(4)

    I confirm that trying to call any egen function with generate is not a solution. egen is essential to do that, as is the file with the code.

    Comment


    • #3
      It worked ! Thank you for your help Nick, much appreciated

      Comment


      • #4
        You might also be interested in astile, that can be used with groups and can be helpful in larger datasets.
        Code:
        ssc install astile
        help astile
        Regards
        --------------------------------------------------
        Attaullah Shah, PhD.
        Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
        FinTechProfessor.com
        https://asdocx.com
        Check out my asdoc program, which sends outputs to MS Word.
        For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

        Comment

        Working...
        X