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

st: Calling a scalar within a command.


From   "Doogar, Rajib" <[email protected]>
To   <[email protected]>
Subject   st: Calling a scalar within a command.
Date   Thu, 24 Feb 2005 21:11:34 -0600

I want to call a scalar as an argument in a command e.g. scatter.  I have tried to run the following program:
===
foreach x in x1 x2 .. xn {
summ `x', d
sca `x'1  = r(p1)
sca `x'99 = r(p99)
sca list
scatter ta `x', xline(scalar(`x1') scalar(`x99')) saving(`x', replace) 
scatter ta `x' if `x'>=scalar(`x1') & `x'<=scalar(`x99'), xline(scalar(`x1') scalar(`x99')) saving(`x't, replace)
===
where "scalar()" indicates the places I want to call scalars.  Needless to say, this does not work.  
 
Basically, I would like to be able to store a bunch of parameters from the summarize command that I can call freely in subsequent `if' statements or in situations like the scatter command.  I cannot find the anything in the manual on calling scalars that fits this context.  Any pointers, corrections or suggestions will be a great help.
 
Many thanks in advance.
 
r.
 
Rajib Doogar
[email protected] 
 

*
*   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/



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