Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Can you get sign of value only?

From   "Nick Cox" <>
To   <>
Subject   st: RE: Can you get sign of value only?
Date   Thu, 23 Mar 2006 23:23:18 -0000

replace x = x * sign(y) 

Stata's documentation of functions is ultra-dry. At 
some point one just has to scan the list and see 
what there is. 

At the Stata Journal we are open to publishing tutorial-type 
articles on the more exciting functions, but with 
-sign()- I would be pushed to do more than restate the 


Danielle H. Ferry

> Is it possible to get the sign of a value? I.e., I would like 
> to multiply the
> var x by either -1 or +1 depending on the sign of var y. 

*   For searches and help try:

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