Log transformation

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

mranpara03
Posts: 1
Joined: Wed Apr 08, 2015 4:27 am

Log transformation

Postby mranpara03 » Wed Apr 08, 2015 4:33 am

I want to transform a series of total medical costs totmed by taking the natural log. However some values are zero so when I try to do this using generate it gives me an error saying some values are non positive. Is there a way that I can do this log(totmed); = 0 if totmed < 1 so that the non positives are zero in the new series and the rest are transformed?

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Log transformation

Postby startz » Wed Apr 08, 2015 6:13 am

Code: Select all

series newSeries = @recode(totmed<1,0,log(totmed))


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests