SHAZAM Community
Ask Your Question

Trying to transform x to log(x) - Shazam 11

asked 2013-11-05 14:16:45 +0000

KalleKanon gravatar image

updated 2013-11-05 14:18:34 +0000

Hi there.

Trying to transform x to log from a linlin model. Whats wrong with this command:

GENR x=log(x) ?

Have tried to specify the sample first, without any further luck. When just entering GENR x, the corresponding x-values are produced in Output, so I know the dataset is "connected" to the command window.

Using Shazam 11 btw.

Thank you for helping in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-05 15:18:00 +0000

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
    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
   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.

edit flag offensive delete link more


Briliant. Thank you!

How do I check my script for errors? Im a novice, so please keep it simple :)

KalleKanon gravatar imageKalleKanon ( 2013-11-05 15:36:25 +0000 )edit

Well reading the output for errors or warnings when you run it is best.

Post it here and we can take a look at it for you.

SHAZAMHelp gravatar imageSHAZAMHelp ( 2013-11-05 15:37:48 +0000 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-11-05 14:16:45 +0000

Seen: 564 times

Last updated: Nov 05 '13