Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st:how to transfer a value to another dataset

From   Nina YIN <>
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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index