LOG Instruction |
LOG series start end newseries newstart
Takes the natural log of a series. This can also be done easily using SET.
Wizard
You can use the Data/Graphics>Transformations wizard to take logs.
Parameters
|
series |
source series |
|
start, end |
range to transform, by default range of series |
|
newseries |
result series, by default, same as series |
|
newstart |
start for newseries, by default start |
Examples
The first instruction takes the natural log of GNP and puts it into the series LOGGNP. The second replaces the series FORECAST by its log.
log gnp / loggnp
log forecast
Here is how you would do these same operations using SET:
set loggnp = log(gnp)
set forecast = log(forecast)
You can use a DOFOR loop to take logs of multiple series. Here, we use the %S and %L functions to save the logs into new series by appending the prefix LOG to the existing series names, producing LOGUSGDP, LOGJPNGDP, LOGCANGDP, and LOGGBRGDP.
dofor ser = usgdp jpngdp cangdp gbrgdp
log ser / %s("log"+%l(ser))
end
Copyright © 2026 Thomas A. Doan