Programming the statistical procedures from SAS

Panel data with lag variables

Reply
Occasional Learner iim
Occasional Learner
Posts: 1

Panel data with lag variables

Hi,

 

My name is Iim and I’m working with this panel data:

id

country

year

polity

cpi

rai

1

A

1990

-2.578974401

5.7930311

8.777732421

1

A

1991

-2.40449657

6.212200564

8.365564012

1

A

1992

-2.128748631

5.717264415

9.229337602

1

A

1993

-2.455762467

6.658118174

8.904648292

1

A

1994

-1.451890958

3.085509381

8.888477839

1

A

1995

-1.715907804

4.11337505

9.238764822

2

B

1990

1

1.339005883

11.13373208

2

B

1991

1

0.855291626

11.36276496

2

B

1992

1

0.760889622

11.52020088

2

B

1993

1

0.685850942

14.90448963

2

B

1994

1

-0.081732098

10.97370938

2

B

1995

1

-1.223106578

3.083279133

 

I want to run panel data (random effect) with lag variables as I will use 1991-1995 for DV (polity) and use 1990-1994 for IV (cpi, rai). I have generated lag variables using this:

proc expand data=pol out=pol_lag method = none;

by country;

id year;

convert polity= polity_lag1/ transformout= (lag 1);

convert cpi= cpi_lead1 / transformout=(lead 1)

convert rai= rai_lead1 / transformout=(lead 1);

run;

I also have tried to run proc panel with this syntax:

proc panel data=pol_lag;

     id id year;

model polity_lag1= cpi_lead1 rai_lead1 /RANONE;

run;

 

But it did not run and sas log showed this: “ERROR: Each observation for time point year=1990 has a missing value for at least one variable in MODEL statement."

 

I also tried to add instrument depvar to include lag variable in dependent variable using this syntax:

 

proc panel data=pol_lag;

inst depvar (level)

model polity= cpi_lead1 rai_lead1 /RANONE;

id id year;

run;

 

However, it still did not run.

Is there anyone in this group can help me to solve this problem?

 

Thank you,

Iim

Ask a Question
Discussion stats
  • 0 replies
  • 163 views
  • 0 likes
  • 1 in conversation