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:how to transfer a value to another dataset


From   Nina YIN <[email protected]>
To   [email protected]
Subject   st:how to transfer a value to another dataset
Date   Thu, 14 Jun 2012 10:21:14 +0200

Dear all,

I want to define a constant variable in one data-set from a value
generated from another data file. How could I transfer the value
across files?
For example, I -sum ppid cs,
 sum ppid cs

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        ppid |    223566    2294.551    1314.803          1       4544
          cs |    223566      5323.5    3073.242          1      10646

now I got the maximum value of ppid and cs(mppid and mcs).

Then I open another data, and need to generate variables which is
id=_n+mppid, cs=_n+mcs. How could I realize it?

Local can only define the strings. I try to tostring mppid, and local
it , but it failed.

If you have any idea, please help me!

Thank you very much!





-- 
Best Regards,
Nina YIN


Toulouse School of Economics
Manufacture des Tabacs
21 Allee de Brienne
Toulouse, 31000, France
Tel: 0033-(0)5 6123 8348
*
*   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