0

I have obtained a copy of Stata ado file written by another researcher. The first few lines are as follows:

   program define threshold, eclass
   set more off
   gen m=`1'
   sort mvar
   gen lagm=L.m
   gen deltam=D.m
   ...

What does the line gen m=`1' do? I could not find convincing answer. So any clarification is appreciated!

Prasanna S
  • 353
  • 1
  • 10
  • 2
    It is the first argument supplied to the program. `threshold frog` would mean that the variable name `frog` is the first argument. If you received a program without a help file, expect to do most of the work. All this is documented prominently. e.g. http://www.stata.com/manuals14/u18.pdf 18.4 – Nick Cox May 14 '17 at 08:12

1 Answers1

0

See the official documentation, e.g. Section 18.4 in http://www.stata.com/manuals13/u18.pdf. Or just play around:

capture program drop mytest
program define mytest
display `"`0'"'
display `"`1'"'
display `"`2'"'
end

mytest some arbitrary syntax here
Andrei
  • 2,585
  • 1
  • 14
  • 17
  • It can be useful to actually write the description here. Links can break, etc. The way this answer is currently written doesn't answer the question. – knod Jul 26 '18 at 13:55