Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: GAMFIT failure despite updated gam


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: GAMFIT failure despite updated gam
Date   Fri, 30 Sep 2011 12:52:24 +0100

Back to Matthew's question after my digressions, although some points
in the digressions are highly pertinent.

The documentation for -gam- on SSC does not mention Windows 7. No idea
whether that's the crucial detail.

More positively, what Matthew wants here is a highly standard model
supported by -glm-.

The only twist is wanting to model dependence on the x variable as a
smooth function of x using splines.

I guess Matthew is likely to get good results with one or all of the
following approaches.

1. Creating a bundle of spline variables with -mkspline- and then using those.

Here is a simple example:

sysuse auto, clear

mkspline w = weight, cubic nknots(3)

ds w?

glm foreign w? , f(binomial) link(logit)

predict foreign_p

gen weight_show = round(weight, 50)

bysort weight_show foreign : gen foreign_show = ///
cond(foreign, foreign - (_n-1)/50, foreign + (_n-1)/50)

scatter foreign_show  weight_show, ms(Oh)  sort ///
|| mspline foreign_p weight, bands(200) legend(off) ///
ytitle("`: var label foreign'") xtitle("`: var label weight'")

(Some of the code here is binning and stacking for a nicer plot.)

2. Using -mvrs- to similar effect (SJ 7-1).

Nick

On Thu, Sep 29, 2011 at 10:18 PM, Matthew Baldwin, MD
<[email protected]> wrote:

>   Despite having downloaded the most uptodate gam program that includes gam,
> gamfit, gambig, gamhuge, gamhug2, unzipping it, and indicating to Stata
> where the program is, I still get the following error message below.
>
>   Of note, I run Windows 7, and initally received an r(603) message after
> running the code below, and after doing what was recommended: 'update all,
> update swap', and now running Stata 11 as an administrator, I still cant get
> the gam program to work.
>
> It worked previously on this computer with this code before it was
> rebuilt/reinstalled.  Any help is greatly appreciated.
>
> ssc desc gam
> ssc install gam
> !unzip gam.zip
>
> global GAMDIR C:\ado\plus\g\
> gam yvar xvar if dcyear > 2005, f(binomial) link(logit) df(xvar:3) big
> GAMFIT failure, $.out not found
> stats not found
> r(111);

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index