Friday, March 15, 2013

Session 8

PANEL DATA ANALYSIS .

Perform Panel Data Analysis of "Produc" data
 Answer:There are three types of models:
       (i)  Pooled affect model
       (ii) Fixed affect model
       (iii)Random affect model

We will be determining which model is the best by using functions:
       pFtest : for determining between fixed and pooled
       plmtest : for determining between pooled and random
       phtest: for determining between random and fixed

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

Loading Data
> data("Produc", package= "plm")
> head(Produc)


(i)  Pooled affect model

> pool< -plm(log(pcap)~log(hwy)+log(water)+log(util)+log(pc)+log(gsp)+log(emp)+log(unemp), data=Produc,model=("pooling"),index=c("state","year"))
> summary(pool)

(ii) Fixed affect model
> fixed<-plm(log(pcap)~log(hwy)+log(water)+log(util)+log(pc)+log(gsp)+log(emp)+log(unemp), data=Produc,model=("within"),index=c("state","year"))
> summary(fixed)

(iii)Random affect model 


> random<-plm(log(pcap)~log(hwy)+log(water)+log(util)+log(pc)+log(gsp)+log(emp)+log(unemp),
data=Produc,model=("random"),index=c("state","year"))
> summary(random)



Testing of Model

This can be done through Hypothesis testing between the models as follows:

H0: Null Hypothesis: the individual index and time based params are all zero
             H1: Alternate Hypothesis: atleast one of the index and time based params is non zero


Pooled vs Fixed

Null Hypothesis: Pooled Affect Model
Alternate Hypothesis : Fixed Affect Model 


> pFtest(fixed,pool)


Pooled vs Random

Null Hypothesis: Pooled Affect Model
Alternate Hypothesis: Random Affect Model

> plmtest(pool)


Random vs Fixed

Null Hypothesis: No Correlation . Random Affect Model
Alternate Hypothesis: Fixed Affect Model

> phtest(random,fixed)


Conclusion: 
Fixed Affect Model is best suited to do the panel data analysis for "Produc" data set.


Hence, we conclude that within the same id i.e. within same "state" there is no variation. 


No comments:

Post a Comment