BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sazad
Calcite | Level 5

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

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.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

2 REPLIES 2
mkeintz
PROC Star

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.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
sazad
Calcite | Level 5

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

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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