BookmarkSubscribeRSS Feed
firatyilmaz
Calcite | Level 5

Hi everyone,

 

I have a panel data with missing values. When I try to estimate a fixed or random effects regression, the proc panel procedure returns with an error like this: "there are missing values in the TS variable". So I can't make an estimation. Can you help me how to solve this problem? I'm using SAS OnDemand for Academics by the way. 

2 REPLIES 2
arthurcavila
Obsidian | Level 7

Can you remove the missing observations? Maybe something like:

 

PROC PANEL data=your.data(where=(TS~=.));

*...(your model code);

RUN;

firatyilmaz
Calcite | Level 5

Hi,

 

Thank you for your answer. I added the code you suggested to the end of the proc panel statement, but this time it returned with two errors: "Variable TS is not on file WORK.GAS" and "No data set open to look up variables". My data  actually an open access stata file(.dta) so I used the following code to import it to SAS:

 

%web_drop_table(work.gas);

filename gas "/home/u37951485/gasoline4.dta";
run;

proc import datafile=gas
dbms=dta
out=work.gas;
run;

%web_open_table(work.gas);

My panel procedure is:

proc panel data=work.gas (here your suggested extension);
id country year;
model lgasconspc=lgasp co2int annual_temp /fixone;
run;

 The interesting thing is that I can estimate the model with proc reg without any errors. İn Stata, I also can estimate the model even though it is an unbalanced panel without any problems. I have read on SAS support that proc panel procedure would simply ignore the misssing values and estimate the model. But it does not. What is the problem or what am I doing wrong?

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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