Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: finding the max of a variable and then using it


From   "Data Analytics Corp." <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: finding the max of a variable and then using it
Date   Tue, 10 Aug 2010 10:43:24 -0400

Hi,

I have a data set with a variable called opp_price. I'd like to find the maximum value for opp_price (I would imagine I'd use

egen opp = max(opp_price)

or something like this, but then use this single value in subsequent graphing statements like the following:

xline(opp, lwidth(thin))
text(0.0 238 "OPP: $opp", place(w))

Of course this doesn't work since opp is a new variable with as many observations as opp_price. I need a scalar that I can then use in subsequent statements. Can anyone help?

Thanks,

Walt

________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
[email protected]
www.dataanalyticscorp.com

_____________________________________________________


--
________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
[email protected]
www.dataanalyticscorp.com

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index