Announcement

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

  • "Shapley2" affects your data !

    Hi
    I think there is an error in the user written command (shapley2).
    To see this error;

    1- Run a regression and save the coefficients

    2- Use the commands;
    shapley2 , stat(r2_w)
    matrix list e(shapley)

    3- Run the same regression again and you will find that the coefficients will change !


    I am not sure why this is the case, but I have tried with different regression and different data sets.

    If any one has a comment, please let me know ! having said that I don't think I am doing something wrong and you can see this yourself. Try on your data set !

    Thanks

  • #2
    I didn't had that problem, and a quick glance of the code suggests this problem shouldn't happen (as he saves the data and then restores it). Are you sure your results don't vary even without the shapley2 in-between? (e.g. a logit mode that finds a different optimum due to random seeds)

    Comment


    • #3
      When I review net describe shapley2 I see that the software has a release date of 20150124, sugesting that it is in active development, and it provides the author's name and an email address for support. Have you addressed your question to the author?

      Without knowing anything about the package, I attempted to use it, as you suggested, after running a trivial regression, and received an error message. I'm not willing to invest more effort in learning the package. If you can provide a reproducible example (using one of the sample datasets that ships with Stata, see sysuse dir) I'd take another look and see if anything jumps off the page at me.

      One thought: when you ran the same regression a second time, did you issue the full regress command with all the same arguments and options, or did you use the shortcut of just issuing the command?

      Comment


      • #4
        Hi
        When I run the regression many many times , of course I get the same results. The only exception is when using Shapley2 .

        Did you try it ?

        Comment


        • #5
          Same results here:

          Code:
          sysuse auto, clear
          reg price weight length
          shapley2, stat(r2)
          reg price weight length
          shapley2, stat(r2)
          If you have more details (what command did you run? what results change, the betas or the results of shapley2?), perhaps someone may chime in with a more helpful answer

          Comment


          • #6
            Works fine for me too. Whenever I see complaints about results being different, I wonder if some sort of sorting and sampling has been done. Again, a reproducible example, or at least showing us all of your code and output, could help greatly.

            Also make sure you have the latest version:

            Code:
            . which shapley2
            c:\ado\plus\s\shapley2.ado
            *!version 1.4 21Jan2015 -  F. Wendelspiess Chavez Juarez
            *!
            *!--------------------- VERSION HISTORY -------------------
            *! Version 1.4: Small bugfix: sometimes the program did not execute in protected working directories. Change does no
            > t affect result.
            *! Version 1.3: Small bugfix: shapley2 did not work with oprobit. The fix does not affect the results. 
            *! Version 1.2: Change in the computation, now closer to similar routines. Bugfix: now accepts very long group-state
            > ments
            *! Version 1.1: Bugfix to ensure no changes are made to the current database. 
            *! Version 1.0: First release on 06nov2012
            Notice the bug fix made in version 1.1 -- if you are using it, maybe that accounts for the problems.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

            EMAIL: [email protected]
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              Incidentally, whenever I think there is a bug in a program I always run -update all- and -adoupdate-. If I am lucky the problem has already been fixed. With my own publicly available programs, I sometimes get bug reports for things I fixed back in 2007.
              -------------------------------------------
              Richard Williams, Notre Dame Dept of Sociology
              StataNow Version: 19.5 MP (2 processor)

              EMAIL: [email protected]
              WWW: https://www3.nd.edu/~rwilliam

              Comment


              • #8
                Thanks Richard
                It seems to a problem with the old version. I updated it and re-run the analysis again by the same way I described and there is no change in data now...
                I asked a friend to do the same and we had the same issue. After updating, it does not seem to be any problems now.
                I will keep on investigating though.

                Regards

                Comment


                • #9
                  Dear Mike,

                  I am the author of 'shapley2' and I saw this discussion by pure chance. First at all, thank you for your interest in shapley2. Indeed, your problem was already fixed in version 1.1, which has been released in 2013.

                  If you encounter another problem in the software, I would be very grateful if you could directly contact me, because this allows me to take care of the problem and to solve it if possible. Thanks a lot.

                  Of course, a parallel posting on Stata List is also very welcome, as it can help other users having the same problem.

                  Kind regards,
                  Florian

                  Comment


                  • #10
                    Dear Florian,

                    Thank you for developing the program 'shapley2'. I am going to use it for binary logit models. Please write me if it is possible to decompose only for McFadden pseudo-R-square or if I can use Count R-square or McKelvey and Zavoina pseudo R-square.

                    Best regards,
                    Hanna

                    Comment

                    Working...
                    X