Announcement

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

  • sgmediation installation failed - "connection timed out" and "r(199)" error

    Dear Statalist members,

    I am trying to run mediation analysis for my dissertation research using Stata 15/IC on Windows 7. I need to install `sgmediation` to perform Sobel-Goodman mediation tests.

    I tried:

    ssc install sgmediation

    But I got the following error:

    "connection timed out" / "package not found"

    I also tried:

    net from http://fmwww.bc.edu/RePEc/bocode/s/
    net install sgmediation

    Still the same issue.

    My internet connection is working fine. I can browse websites without problems.

    What I need:
    - I want to test whether Tax Reform (TREF) mediates the relationship between Leverage, Profitability, and Liquidity on Corporate Tax Planning (CETR).
    - I have 120 observations (12 firms × 10 years).

    When I tried SEM as an alternative:

    sem (CETR <- Leverage TREF) (TREF <- Leverage)

    Stata gave this error:

    "model not identified; no paths from latent variable CETR to observed variables" r(503)

    I typed "estat teftects" (which was a typo) and got "r(321)" error. I now know it should be "estat teffects".

    My questions:
    1. How can I successfully install sgmediation?
    2. If sgmediation cannot be installed, how do I correctly specify the SEM model for mediation?
    3. Is there an alternative way to test mediation without sgmediation?

    What I have tried:
    - ssc install sgmediation
    - ssc install sgmediation, replace
    - net from http://fmwww.bc.edu/RePEc/bocode/s/
    - net install sgmediation
    - Checking Stata's ado path

    Any advice would be greatly appreciated.

    Thank you,
    Hudu Zayyanu Ahmed
    Stata 15/IC, Windows 7
    Last edited by Ahmed Zayyanu Hudu; 07 Aug 2026, 04:58.

  • #2
    Part of this I can address.

    There is no package sgmediation on SSC. There are no files with names sgmediation.ado, sgmediation.sthlp or sgmediation.hlp on SSC either. So whatever information led you to suppose that there is can only be called misleading. So the report from SSC that the package is not found is correct, and there is no work-around to install from SSC what isn't there.

    I can find traces of sgmediation as a program written by Phil Ender, now retired from UCLA. A group at UCLA was for several years very active in supporting Stata locally -- and globally, but they have variously retired or moved away so far as I know.

    https://stats.oarc.ucla.edu/stata/ado/analysis/

    indicates commands that are now downloadable, but I can't see that they include sgmediation.

    Sorry, but your other questions are beyond what I know about.

    Comment


    • #3
      I cannot find such a program still in existence; however, there is a program called sgmediation2 - note that this is NOT at SSC; however if you type
      Code:
      search sgmedation2
      you will find it with a link

      Comment


      • #4
        https://www.statalist.org/forums/for...-s-sgmediation

        Comment


        • #5
          #4 points to a more detailed journey with the same conclusion: sgmediation has disappeared from the UCLA website.

          Comment


          • #6
            re: #3, I meant to add that using
            Code:
            search sgmediation
            also works to find sgmediation2

            Comment


            • #7
              I find it in my computer. I can't remember when I installed it. mypkg provides no clue, I must have download it somewhere and copy it in PLUS.
              Attached Files

              Comment

              Working...
              X