Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: GAMFIT failure despite updated gam


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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
<mrb45@columbia.edu> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index