gen T = floor(time/2)
was the answer to a similar question on Friday.
In your case
ceil(_n/2)
would be another way to do it.
Nick
[email protected]
Raphael Fraser
> Thank you! Just one question. Why couldn't I think of that?
> (rhetorical)
>
> On 2/17/06, Richard Williams <[email protected]> wrote:
> >I have two variables as listed below type and adjct.
> However, I would
> > >like to create the variable
> > >x. Can anyone assist?
> > >
> > >type adjct x
> > > 0 50 1
> > > 1 650 1
> > > 0 80 2
> > > 1 600 2
> > > 0 100 3
> > > 1 500 3
> > >
> > gen x = round(_n/2)
*
* 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/