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

st: recursive concept


From   Tony YANG <[email protected]>
To   [email protected]
Subject   st: recursive concept
Date   Mon, 31 Jan 2005 16:42:11 -0500

Dear Listers;

I am trying to do something by using the recursive concepts, and I am
not sure if there is some build-in command in Stata to realize it,
since in R, the build-in command Recall can work for it.

e.g.
fact<-function(x) {
   if (x<=1) x else x*Recall(x-1)
}
fact(6)

Any suggestions would be greatly appreciated. Thanks in advance.

Best,
Tony
*
*   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