-search sign- points to
[D] functions -- Functions
sign() mathematical function
sign(x) returns -1 if x<0, 0 if x==0, 1 if x>0, and missing (.) if x is
missing.
Scott
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Danielle H. Ferry
> Sent: Thursday, March 23, 2006 4:57 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Can you get sign of value only?
>
> Hi there,
> 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. Can I do this?
> Danielle H Ferry
>
*
* 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/