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
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.
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.
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.