Panel data regression

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Panel data regression

[ Edited ]

Hi there,

I am new to SAS, have a panel data of 36 cross sections (i.e., country) and 18 period/year.

I would like to check the results on different panel estimations by dropping 1-2 cross sections or year.

How can I do that, please?

 

proc panel data = mydata;
id country year;
model my model / pooled HAC fixone fixonetime fixtwo ranone rantwo vcomp=fb bp bfn;
run;

 

Many thanks

 


Accepted Solutions
Solution
‎03-08-2018 04:54 AM
Trusted Advisor
Posts: 1,345

Re: Panel data regression

Do I understand correctly that you want to run PROC PANEL on a subset of your data, by excluding user-selected COUNTRY and/or YEAR?  If it is really that simple a request, you could use a WHERE statement in the proc, as in

 

proc panel data=mydata;

   where not(2004<=year<=2005);

   ID ...;
   MODEL .... ;

run;

 

 or

  where not (country='US');

 

I also am aware that proc panel has a suite of tests for cross-sectional effects, which I suppose could also be of value to you.  I am totally ignorant of their usage - you'd need more experienced advice on that subject.

View solution in original post


All Replies
Solution
‎03-08-2018 04:54 AM
Trusted Advisor
Posts: 1,345

Re: Panel data regression

Do I understand correctly that you want to run PROC PANEL on a subset of your data, by excluding user-selected COUNTRY and/or YEAR?  If it is really that simple a request, you could use a WHERE statement in the proc, as in

 

proc panel data=mydata;

   where not(2004<=year<=2005);

   ID ...;
   MODEL .... ;

run;

 

 or

  where not (country='US');

 

I also am aware that proc panel has a suite of tests for cross-sectional effects, which I suppose could also be of value to you.  I am totally ignorant of their usage - you'd need more experienced advice on that subject.

Occasional Contributor
Posts: 5

Re: Panel data regression

[ Edited ]

Hi there,

Thanks for your prompt reply.

It worked "where not year" and I can see differences in results, but not  for "where not country". While time series length is reduced for "where not year", cross section numbers remain the same (I put: where not(country = "arg"). arg for Argentina. Random effect works better for my model. (diagnostics done to check for multicolliniarity).

Related to year, what if I want to restrict the model to a particular period, say GFC period 2007-08 and check the results for a series of periods: 2000-07; 2007-08 and 2008-17 etc.

Many thanks,

Sohel

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 173 views
  • 0 likes
  • 2 in conversation