Friday, 15 March 2013

Session 8 - R Lab

Assignment 8 : Panel Data Analysis

Do Panel Data Analysis of "Produc" data analyzing  on three types of model :

  •       Pooled affect model
  •       Fixed affect model
  •       Random affect model


Determine which model is the best by using functions:

  •        pFtest : Fixed vs Pooled
  •        plmtest : Pooled vs Random
  •        phtest: Random vs Fixed



 Pooled Model

Command:
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"))




 Fixed Model

Command:
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"))





Random Model

Command:
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"))


Pooled vs Fixed 

Null Hypothesis: Pooled Model
Alternate Hypothesis : Fixed Model



Pooled vs Random 

Null Hypothesis: Pooled Model
Alternate Hypothesis: Random Model

Since the p value is negligible so we reject the Null Hypothesis and hence Alternate hypothesis is accepted which is to accept Random Model is better than Pooled Model


Conclusion: 

So after making all the comparisons we come to the conclusion that Fixed 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