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

Re: st: Re: Trend


From   Chau Tak Wai <[email protected]>
To   [email protected]
Subject   Re: st: Re: Trend
Date   Thu, 09 Jan 2003 21:30:39 +0800

Thanks! But a further question:

why this is not valid?

for num 1/10: replace z[X]=3 if x[X]==y[X]
response:
->  replace z[1]=3 if x[1]==y[1]
weights not allowed
r(101);

Though I understand that we don't need such statement to do this task,
but why this statement can't work?


Scott Merryman wrote:
> 
> ----- Original Message -----
> From: "Chau Tak Wai" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, January 09, 2003 4:57 AM
> Subject: st: Trend
> 
> > Could anyone tell me how can we create linear time trend in STATA
> > directly?
> >
> > Also, how can I refer to a particular cell in the dataset? Say variable
> > x, 5th observation?
> >
> > Thank you very much!
> 
> For a linear trend:
> gen trend = _n
> 
> To refer to the 5th observation use explicit subscripting:
> x[5]
> 
> See [U] 16.7
> 
> I hope this helps,
> Scott
> 
> *
> *   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/
*
*   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