Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Weights vs subscripts


From   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: RE: Weights vs subscripts
Date   Wed, 04 Oct 2006 10:07:28 -0400

Nick Cox wrote in response to Alex Ogan's question, via a few other responses:

[...]

As the varlist contains a single variable, the
loop is redundant here, so this boils down to

replace y = y[x - 1] + z[x]

The implication is that x contains
observation numbers, in effect pointers. Is that right?
It is a way of getting some subtle effects, or you
might be confused.
[...]
Maybe this was meant to be implicit in Nick's reply, but if your intent was really to refer to the y-value of the prior observation and the z of the current observation, then you should code...

replace y = y[_n - 1] + z

More can be said about how this works, and some interesting things you can do with this idea, but this may not be the place for it. Perhaps there are some FAQs on the matter.

--David

*
* 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