I have cross-sectional data and am running 100 OLS regressions using a system out of PROC> MAKE SYSTEM in my pool data object. Two questions:
QUESTION 1: I'm having a singular error due to one or two variables in a couple of different equations. This means that the entire system won't estimate. However, I'd like to be able to estimate the regressions by dropping whichever variables are causing the singular error. Any help?
QUESTION 2: I'd like to run a factor variable (categorical dummy) in my regressions (by cross section of course). Do you know how to run @expand in a system?
Pool Data and System Estimation
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Pool Data and System Estimation
First off, if the regressions are independent, I think you're probably better off running them individually (and, say, putting the results into a Spool if you want to collate them) than running them simultaneously in a system.
There is no easy way to identify which variables are causing your singularity.
From your system you could try clicking on Proc->Define System. The coefficient boxes there let you enter an @expand. However it may be that the rest of your specification cannot be easily entered using that dialog.
There is no easy way to identify which variables are causing your singularity.
From your system you could try clicking on Proc->Define System. The coefficient boxes there let you enter an @expand. However it may be that the rest of your specification cannot be easily entered using that dialog.
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
I would like to be able to run all these regressions at once, as to speed up this process. Based on the data, I can tell you the variables causing the singularity issue probably have the same number for each observation (perfectly collinear with the constant term). Any ideas?
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
Also, when I try to use @expand(period,@dropfirst) in the system, it says that "period is undefined" I've also tried @expand(period?,@dropfirst) which I think may be incorrect notation, but more precise logic.
Ultimately, I'd like to run at least 100 regressions quickly using cross-sectional data... so if there are any easier ways of doing this, I'd appreciate the help. I though about just writing a program, but I'm not too familiar with that. Each cross section is an alpha variable, so I could run one regression and just use an if statement to define which cross section to run the regression on, and work my way through the regressions 1 by 1.
Ultimately, I'd like to run at least 100 regressions quickly using cross-sectional data... so if there are any easier ways of doing this, I'd appreciate the help. I though about just writing a program, but I'm not too familiar with that. Each cross section is an alpha variable, so I could run one regression and just use an if statement to define which cross section to run the regression on, and work my way through the regressions 1 by 1.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Pool Data and System Estimation
The only solution is to remove the offending variable.I would like to be able to run all these regressions at once, as to speed up this process. Based on the data, I can tell you the variables causing the singularity issue probably have the same number for each observation (perfectly collinear with the constant term). Any ideas?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Pool Data and System Estimation
What is PERIOD? The first thing you tried makes me believe it is a series in your workfile, in which case it should work.Also, when I try to use @expand(period,@dropfirst) in the system, it says that "period is undefined" I've also tried @expand(period?,@dropfirst) which I think may be incorrect notation, but more precise logic.
If you have 100 cross-sections (not clear to me if that is the case or not) then you are probably better off working with Panels rather than Pools. Then you could write a very simple for loop in a program that would do the estimations for you. Something like:Ultimately, I'd like to run at least 100 regressions quickly using cross-sectional data... so if there are any easier ways of doing this, I'd appreciate the help. I though about just writing a program, but I'm not too familiar with that. Each cross section is an alpha variable, so I could run one regression and just use an if statement to define which cross section to run the regression on, and work my way through the regressions 1 by 1.
Code: Select all
spool myspool
equation e1
for !i=1 to 100
smpl if @crossid = !i
e1.ls y c x1 x2 x3
myspool.append e1.stats
next
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
You're the man. Or woman? But either way, this is awesome.
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
One more question. If I want to actually create regression objects for each of my cross sections... say, have them named e1, e2, e3, etc... how would I do that in my program?
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
Nevermind... figured it out.
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
spool myspool
for !i=1 to 59
equation e{!i}
smpl if @crossid = !i
e{!i}.ls ssu c price acv items promoacv promounits trend @expand(period,@dropfirst) easter
myspool.append e{!i}.stats
next
this is my equation right now. do you know if there's a way to say "if there's an error in my equation (maybe coming from singular errors or not enough observations, skip it and move on to the next regression..." also, is it possible to see all my coefficients somewhere so that I can export them all to excel?
for !i=1 to 59
equation e{!i}
smpl if @crossid = !i
e{!i}.ls ssu c price acv items promoacv promounits trend @expand(period,@dropfirst) easter
myspool.append e{!i}.stats
next
this is my equation right now. do you know if there's a way to say "if there's an error in my equation (maybe coming from singular errors or not enough observations, skip it and move on to the next regression..." also, is it possible to see all my coefficients somewhere so that I can export them all to excel?
-
cmgconsulting
- Posts: 38
- Joined: Mon Nov 17, 2008 8:25 am
Re: Pool Data and System Estimation
Also, instead of having my equations named e1, e2, ... I have an alpha variable where each cross-section has a unique name. Is it possible to have the equation named whatever is in the first observation of each cross section for that particular variable? call that variable BPT.
Who is online
Users browsing this forum: No registered users and 2 guests
