## Taking log of non-positive number as “0”

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Namploy
Posts: 4
Joined: Tue Feb 27, 2018 4:48 am

### Taking log of non-positive number as “0”

I know that taking log can’t apply with “0” (zero); however the raw data has some of “0”.
So my question is how can I take log with such data (include some “0”? Or if you have any suggestion please let me know. My friend told me that I might classify data in group, but I have no idea how to do it. Please help.

The data is “panel data”

Thank you.

[example data]
https://imageshack.com/i/pnO3QDLQj
Last edited by Namploy on Mon Mar 05, 2018 11:49 pm, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11942
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Taking log of non-positive number as “0”

What do you want the log of zero to be?

Namploy
Posts: 4
Joined: Tue Feb 27, 2018 4:48 am

### Re: Taking log of non-positive number as “0”

EViews Gareth wrote:What do you want the log of zero to be?

Thank you for you response.
For your question, I still have no idea what could "log of zero" be? Actually, I don't understand EView Program very well.

Let me explain it
I do "Simultaneous Equations" between demand and supply by running data in 3 steps as follows:

1. run all data by regression
2. adjust result/equation by take log, which is the problem because "0" in data
3. estimate data by 2SLS (two-state least square)

I already test data in Stata which the program exclude "0" automaticly and has some summary. Anyway I would like to run data agian by EViews program to compare the results, but I stuck in 2nd step.

Thank you

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11942
Joined: Tue Sep 16, 2008 5:38 pm

### Re: Taking log of non-positive number as “0”

Not sure what you mean. EViews will drop the zero observations if you're taking logs.

Namploy
Posts: 4
Joined: Tue Feb 27, 2018 4:48 am

### Re: Taking log of non-positive number as “0”

EViews Gareth wrote:Not sure what you mean. EViews will drop the zero observations if you're taking logs.

I'll check data now. thank you