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:n.j.cox@durham.ac.uk]
Sent: Thursday, 4 July 2002 9:30 PM
To: statalist@hsphsun2.harvard.edu
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
n.j.cox@durham.ac.uk
*
* 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/