SHAZAM Community
Ask Your Question

Revision history [back]

That command looks fine, so perhaps there is a mistake elsewhere in your script. Here is a complete example:

* Create a simple sequence of 1 to 10
sample 1 10
genr x=time(0)
print x
* Generate logs but reuse the same variable
genr x=log(x)
print x

creates the following output:

 |_* Create a simple sequence of 1 to 10
 |_sample 1 10
 |_genr x=time(0)
 |_print x
 X
    1.000000       2.000000       3.000000       4.000000       5.000000
    6.000000       7.000000       8.000000       9.000000       10.00000
 |_* Generate logs but reuse the same variable
 |_genr x=log(x)
 |_print x
 X
   0.0000000E+00  0.6931472       1.098612       1.386294       1.609438
    1.791759       1.945910       2.079442       2.197225       2.302585

Note that if you are using OLS there is are options such as LINLOG or LOGLOG etc you may add to the statement and SHAZAM will do the transformation for you.