Hello guys! I would like help to use a command in stata for the following formula that I use in excel ln (x_ current / x_ previous)? Can someone help me please?
-
Login or Register
- Log in with
. display 2 + 2 4 . di 2 + 2 4 . di ln(2.45 / 3.08) -.22884157
. list +----+ | x | |----| 1. | 1 | 2. | 2 | 3. | 4 | 4. | 12 | +----+ . generate ratio = ln(x/x[_n-1]) (1 missing value generated) . list +---------------+ | x ratio | |---------------| 1. | 1 . | 2. | 2 .6931472 | 3. | 4 .6931472 | 4. | 12 1.098612 | +---------------+
. list +----+ | x | |----| 1. | 1 | 2. | 2 | 3. | 4 | 4. | 12 | +----+ . generate ratio = ln(x/x[_n-1]) (1 missing value generated) . list +---------------+ | x ratio | |---------------| 1. | 1 . | 2. | 2 .6931472 | 3. | 4 .6931472 | 4. | 12 1.098612 | +---------------+
. display 2 + 2 4 . di 2 + 2 4 . di ln(2.45 / 3.08) -.22884157
Comment