Announcement

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

  • Sankey visual analysis

    Hi,

    I am trying to use Sankey to visually describe longitudinal patterns/flow in Stata 17. (I have Python 3.9 installed.) I tried to test with the example dataset and codes provided in help, but returned with an error message as below. Could you please provide some guidance? Thanks!


    . use https://www.mjcrowther.co.uk/data/sankey_eg1

    . sankey start stop freq
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'numpy'
    (30 lines skipped)
    (error occurred while loading sankey.ado)
    r(7102);



    Best,

    Vivien Chen

  • #2
    Hi Vivien,
    make sure to first install sankey as the author instructs:
    Code:
    net install sankey, from(https://www.mjcrowther.co.uk/code/sankey)
    and then run adoupdate.

    Comment


    • #3
      Maria -
      Thanks! I did as you suggested, but still got the same error messages....

      Comment


      • #4
        It seems to be some kind of dependency missing in the python install. numpy is an essential library that absolutely must be there. Perhaps a more advanced python user may suggest something or email the developer directly.

        Comment


        • #5
          read the Stata Blog on Stata/Python integration, especially: Stata/Python integration part 3: How to install Python packages

          Comment


          • #6
            Thank you! I tried the Stata/Python integration process, and installed the python package - plotly. It seems to work now!!! Thank you very much!!!

            Comment


            • #7
              Originally posted by Vivien Chen View Post
              Thank you! I tried the Stata/Python integration process, and installed the python package - plotly. It seems to work now!!! Thank you very much!!!
              helloļ¼
              I met the same problem with you but then a new problem comes that the website fail to link. I don't know why. Did you meet this before?
              Thanks a lot!

              Comment


              • #8
                I have Python 3.9 and Stata16 installed. I put the command
                Code:
                sankey start end trade, colors(3 "green" 6 "red") linkcolor(lightgreen)
                and there is a website opened but it faild to link.
                I have trade flow data between 200 cities. Is that too much for this program?
                Last edited by iris lee; 03 Feb 2022, 06:51.

                Comment


                • #9
                  deleted.

                  Comment


                  • #10
                    Originally posted by iris lee View Post
                    I have Python 3.9 and Stata16 installed. I put the command
                    Code:
                    sankey start end trade, colors(3 "green" 6 "red") linkcolor(lightgreen)
                    and there is a website opened but it faild to link.
                    I have trade flow data between 200 cities. Is that too much for this program?
                    Hello again,
                    It's strange that the code works sometimes but it still has a blank website in some cases. Maybe there can't be so much cities.

                    Comment

                    Working...
                    X