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

st: Please, help with my program


From   "Oleksandr Shepotylo" <[email protected]>
To   <[email protected]>
Subject   st: Please, help with my program
Date   Thu, 4 Sep 2003 11:48:45 -0400

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/



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