[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Christopher Baum <baum@bc.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: re: double if-sentences in Stata |

Date |
Thu, 27 Nov 2008 14:00:32 -0500 |

<> Linn said Here is what I write. ...

---------------- clear set obs 10 set seed 20081127 g t = _n g cap = log(t+1) g add = _pi + runiform() tsset t g byte shift = cond(runiform() > 0.5, 1, -1) g flow = 5 in 1 replace flow = /// (shift == -1 ) * cond(L.flow + cap < add, -cap, L.flow - add) /// + (shift == 1) * cond(L.flow - cap > add, cap, L.flow + add) in 2/l list -----------------

Kit Baum, Boston College Economics and DIW Berlin http://ideas.repec.org/e/pba1.html An Introduction to Modern Econometrics Using Stata: http://www.stata-press.com/books/imeus.html * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: hprescott for panel w/ gaps** - Next by Date:
**st: RE: RE: using if sentences in Stata** - Previous by thread:
**st: hprescott for panel w/ gaps** - Next by thread:
**st: re: if-sentences in Stata** - Index(es):

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