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

st: RE: RE: Fixed value - time series


From   Graeme Inglis <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: Fixed value - time series
Date   Fri, 5 Jul 2002 09:28:23 +1000

Thanks Nick
I need to be more specific.
x is a categorical variable and can take the values 1,2,3,4.
x is taken at periods 0(baseline),1 ,2 ,3,.. and varies over time.
Values of x at these periods is x0, x1, x2, x3,....
I want to generate a newvar y = x0, value at baseline, such that
y0=y1=y2=y3=...

If I do 'gen y = x if period==0' I only get values for y in period '0'.

I hope this clarifies my question.
Thanks for your response.
Graeme

-----Original Message-----
From: Nick Cox [mailto:[email protected]]
Sent: Thursday, 4 July 2002 9:30 PM
To: [email protected]
Subject: st: RE: Fixed value - time series


Graeme Inglis
> 
> I would appreciate some advice on how to do the following please.
> I want to generate a new variable which takes the baseline value 
> of another
> variable and it has this baseline value in each time period - it 
> is constant
> over time.

There is nothing to stop you going 

gen newvar = <constant> 

If that doesn't help, please give an example of what you 
mean by "baseline value". 

Nick 
[email protected] 
*
*   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