Page 1 of 1

Converting research performed in STATA using SUR

Posted: Wed Aug 22, 2012 4:18 pm
by rontwfs
Hello, I am hoping someone can help me with a study I have to recreate for school. The data was converted from STATA form .DTA to Eviews. I use Eviews 7 and I a very new user.

The study includes 7339 observations of NBA games and their point spreads and point differences of home and away teams for all 31-32 teams (depending on the year) from 2003 to 2008. Seemingly Unrelated Regression was used in the paper.

According to the author, to recreate the analysis for the 2004 season, using STATA, the code looks something similar to this:

xi: sureg (latestspread i.awayteam i.hometeam hclinch aclinch helim aelim)
(pointdiff i.awayteam i.hometeam hclinch aclinch helim aelim) if season==2004

The study has the following variables:
- hclinch aclinch helim aelim are mapped as indicator variables (0 or 1).
- awayteam and hometeam are alphaseries and have each team listed for all games played between 2003 to 2008 season. The author put "i." in front of each alphaseries to create a categorical variable for each team (I believe).
- latestspread and pointdiff are the dependent variables

Is there anyway to convert this into Eviews terms?

I tried using instructions per http://forums.eviews.com/viewtopic.php?f=3&t=2004 to assign indicator variables mapped to hometeam and awayteam, and tried to do a simple ls regresssion, however I keep getting a near singular matrix error. So I'm not sure I'm replicating the "i." correctly by doing that.

Attached is the workfile zipped. If you need the data in STATA form, let me know where to email to and I'll do so. Thanks in advance.

Re: Converting research performed in STATA using SUR

Posted: Thu Aug 23, 2012 8:04 am
by EViews Gareth
I'm not a STATA expert, but if you use @expand on your categorical variables, with @dropfirst, you'll be able to estimate without hitting singular matrix problems.

Re: Converting research performed in STATA using SUR

Posted: Thu Aug 23, 2012 8:55 am
by rontwfs
Before running SUR, I tried running each equation seperately with @expand and @dropfirst commands for both categorical variables (hometeam & awayteam), they both give me singular matrix errors. This is how I wrote out each equation:

ls latestspread @expand(hometeam, @dropfirst) @expand(awayteam, @dropfirst) hclinch aclinch helim aelim
ls pointdiff @expand(hometeam, @dropfirst) @expand(awayteam, @dropfirst) hclinch aclinch helim aelim

Do you know what might be causing this problem?

Re: Converting research performed in STATA using SUR

Posted: Thu Aug 23, 2012 9:06 am
by EViews Gareth
Worked for me:

Re: Converting research performed in STATA using SUR

Posted: Thu Aug 23, 2012 8:42 pm
by rontwfs
Wow it was that simple ... Thank you so very much Gareth.