Dear statalist users,
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"
Oleksandr
*
* 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/