Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Please, help with my program


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Please, help with my program
Date   Thu, 4 Sep 2003 18:59:05 +0100

I guess that your program should start 

program define nlshares 

This looks like trailing garbage:

{slincs|?} indinc age i9gender

Also, why are you specifying a varlist to the 
model: it doesn't need or use it. 

On a different note, this is a logit model. Have
you considered using -glm, link(logit)- with some 
appropriate continuous family? That's perhaps non-standard, 
but also non-crazy, I guess. 

Nick 
[email protected] 

> -----Original Message-----
> Oleksandr Shepotylo
> 
> I am writing my first program in Stata and can not find 
> what is wrong with
> the code.
> 
> I have 4 variables in the dataset: slincs indinc age i9gender.
> Here is my program:
> 
> program define nlshares {slincs|?} indinc age i9gender
>  if "`1'"=="?" {
>   global S_1 "B0 B1 B2"
>   global B0=1000
>   global B1=30
>   global B2=0
>   exit
>  }
> 
>  replace
> `1'=exp($B0*indinc+$B1*age+$B2*i9gender)/(1+exp($B0*indinc+$
> B1*age+$B2*i9gen
> der))
>  end
> 
> I tried to be as close to the example in help file as 
> possible, but I get an
> error message after
> 
> nl slincs indinc age i9gender
> 
> " variable ? not found
> nlshares refused query,  rc=111"
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index