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

st: identifying even & odd numbers

From   "Danielle H. Ferry" <>
Subject   st: identifying even & odd numbers
Date   Tue, 30 Mar 2004 13:10:19 -0500

I apologize if this has been addressed previously. I haven't found anything in the archives, though I feel as though it surely must be there somewhere. I am wondering if there is a way to create a new variable that takes on a value if another variable is an even or an odd number. For example, can you do something like this:
ge newvar = 1 if oldvar is even
If this has made its way thru the list before, perhaps someone can suggest better search keywords for the archives? Thanks.
Danielle Ferry
* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index