Announcement

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

  • General Additive Models (GAM) in STATA

    Hello,
    I am trying to run "gam" in STATA. I am using Windows 10, STATA 15. I tried to download the relevant files using -search-. When I run the "gam" command, I get the following error:
    "GAMFIT failure, U:\Stata15gamfit.exe not found
    GAMFIT failure, $.out not found
    file $.out not found"
    Note that after I unzipped the main "gam.zip" file, gamfit.exe is located in the following: "U:\Stata15\gamfit.exe". I cannot run the gamfit.exe manually (it prompts me to click run after a double-click, but then I get a frozen blue tab).
    Can anyone please help me?

  • #2
    I don't have much insight other than to follow the instructions in the gam help file for installation:
    Important: Installation notes

    When installing a user-written program such as gam, it seems difficult to tell Stata to
    place files other than .ado, .hlp and .sthlp in the usual "stbplus" subfolder, typically
    c:\ado\stbplus/ on a Windows computer.

    You can achieve a "clean" installation of the latest version of gam as follows:

    0. If Stata is open, save your work and close Stata.

    1. Delete files gam*.ado and gam*.hlp (or gam*.sthlp, depending on which version of gam
    you have currently) from wherever you have them.

    2. Restart Stata and install the current gam from Royston's UCL webpage using the
    command net from http://www.homepages.ucl.ac.uk/~ucakjpr/stata/.

    3. Click on gam and follow the links to install gam. Make sure you then also press
    "click here to get" on gam.exe.

    4. Step 2 installs the ado and sthlp files in c:\stbplus\g\. The file gam.exe is copied
    to your Stata current working directory. In Windows, now copy gam.exe from your
    Stata current working directory to c:\stbplus\g\.

    5. You should now have all the gam files in the right place and are ready to continue
    your work.
    Failing that, I would personally move over to R, which has the fantastic mgcv package. That might not be what you want to hear, but sometimes you need to move to a different tool when one fails.

    Comment


    • #3
      Stata 15 has npregress. We can have no idea of precisely what you want to do, but my impression is that is the nearest command in official Stata to what you are seeking.

      Comment


      • #4
        It worked thanks! Now, for graphing, when I use "gamplot xvariable" I get a function with the desired x axis, but my y axis is the "Component & partial residuals for yvariable". How can I dsiplay on the yaxis actual values of the yvariable instead? My emphasis on using gamplot command is that is displays the confidence intervals quite well.

        Comment

        Working...
        X