Converting research performed in STATA using SUR

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

rontwfs
Posts: 3
Joined: Wed Aug 22, 2012 3:14 pm

Converting research performed in STATA using SUR

Postby rontwfs » Wed Aug 22, 2012 4:18 pm

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.
Attachments
nba_gambling_diss_chap3_v2.zip
(207.45 KiB) Downloaded 310 times

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

Re: Converting research performed in STATA using SUR

Postby EViews Gareth » Thu Aug 23, 2012 8:04 am

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.

rontwfs
Posts: 3
Joined: Wed Aug 22, 2012 3:14 pm

Re: Converting research performed in STATA using SUR

Postby rontwfs » Thu Aug 23, 2012 8:55 am

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?

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

Re: Converting research performed in STATA using SUR

Postby EViews Gareth » Thu Aug 23, 2012 9:06 am

Worked for me:
Attachments
gamb.png
gamb.png (110.08 KiB) Viewed 5548 times

rontwfs
Posts: 3
Joined: Wed Aug 22, 2012 3:14 pm

Re: Converting research performed in STATA using SUR

Postby rontwfs » Thu Aug 23, 2012 8:42 pm

Wow it was that simple ... Thank you so very much Gareth.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests