Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Yuval Arbel <yuval.arbel@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: How to generate a vector of the lagged reduction rate the tenant faces, which is different from the current reduction rate? |

Date |
Tue, 14 Aug 2012 22:08:55 +0300 |

Many thanks Nick. I ran the following commands: by appt: gen ref2=reduct_per[_n-1] if reduct_per!=reduct_per[_n-1] by appt: replace ref2=ref2[_n-1] if ref2==. by appt: replace ref2=reduct_per if ref2==. by appt: replace ref2=0 if time_index==0 and it worked wonderfully!!! On Tue, Aug 14, 2012 at 5:00 PM, Nick Cox <njcoxstata@gmail.com> wrote: > See for precisely this problem: > > Cox, N.J. 2011. Stata tip 101: Previous but different. Stata Journal > 11(3): 472-473. > > The heart of the matter is covered in > > http://www.stata.com/statalist/archive/2011-01/msg00999.html > > Nick > > On Tue, Aug 14, 2012 at 1:46 PM, Yuval Arbel <yuval.arbel@gmail.com> wrote: > >> I appreciate very much your assistance in the following question >> (which might save me a lot of time in my research). >> >> I have an unbalanced panel of public-housing tenants. They are offered >> the option to purchase their rental units and face different reduction >> rates from the full apartment price. >> >> Below I provide an example of three tenants (appt ==2851 | appt==2862 >> | appt==2906), >> >> My question refers to the reduction rate column. I would like to >> generate a new variable, which reflects the last reduction rate the >> tenant faces, which is different from the current one (or equal to the >> current one in the case that this is the first reduction rate the >> tenant faces). >> >> For tenant 2906 (for example) the numerical value of this variable >> should be 58.98 for periods 0-4, 59.38 for periods 5-7, 57.89 for >> periods 8-10 etc. >> >> I would like to thank you in advance for your assistance >> >> Yuval >> >> list appt time_index reduct_per fail if appt ==2851 | appt==2862 | appt==2906 >> >> +-----------------------------------+ >> | appt time_i~x reduct~r fail | >> |-----------------------------------| >> 1. | 2851 0 75 0 | >> 2. | 2851 1 75 0 | >> 3. | 2851 2 75 0 | >> 4. | 2851 3 75 0 | >> 5. | 2851 4 75 0 | >> |-----------------------------------| > > <snip> > * > * 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/ -- Dr. Yuval Arbel School of Business Carmel Academic Center 4 Shaar Palmer Street, Haifa 33031, Israel e-mail1: yuval.arbel@carmel.ac.il e-mail2: yuval.arbel@gmail.com * * 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/

**References**:**st: How to generate a vector of the lagged reduction rate the tenant faces, which is different from the current reduction rate?***From:*Yuval Arbel <yuval.arbel@gmail.com>

**Re: st: How to generate a vector of the lagged reduction rate the tenant faces, which is different from the current reduction rate?***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**Re: st: Panel Regression with missing x for one entity** - Next by Date:
**st: shell on Mac** - Previous by thread:
**Re: st: How to generate a vector of the lagged reduction rate the tenant faces, which is different from the current reduction rate?** - Next by thread:
**st: About Data transfermation** - Index(es):