Assignment 8 : Panel Data
Analysis
Problem I: Do Panel Data Analysis of "Produc" data analyzing
on three types of model :
- Pooled affect model
- Fixed affect model
- Random affect model
Problem II: Determine which model is the
best by using functions:
- pFtest : Fixed vs Pooled
- plmtest : Pooled vs Random
- phtest: Random vs Fixed
Solution:
To load the dataCommands:
> data("Produc" , package ="plm")
> head(Produc)
> data("Produc" , package ="plm")
> head(Produc)
Pooled Affects Model
Commands:
> 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)
Commands:
> 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)
Fixed Affects ModelCommands:
> 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)
> 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)
Random Affects ModelCommands:
> 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)
> 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)
Tests:
Pooled vs Fixed:
H0: Pooled Affects Model
H1: Fixed Affects Model
Pooled vs Fixed:
H0: Pooled Affects Model
H1: Fixed Affects Model
As the p-value is very small, we reject the null hypothesis and accept the
alternate hypothesis.
=> Fixed affects model is accepted.
Pooled vs Random:
H0: Pooled Affects Model
H1: Random Affects Model
=> Fixed affects model is accepted.
Pooled vs Random:
H0: Pooled Affects Model
H1: Random Affects Model
As the p-value is very small, we reject the null hypothesis and accept the
alternate hypothesis.
=> Random affects model is accepted.
Random vs Fixed:
H0: Random Affects Model
H1: Fixed Affects Model
=> Random affects model is accepted.
Random vs Fixed:
H0: Random Affects Model
H1: Fixed Affects Model
As the p-value is very small, we reject the null hypothesis and accept the
alternate hypothesis.
=> Fixed affects model is accepted.
Conclusion:
By conducting all the above tests, we come to a conclusion that Fixed Affects Model is the best to do the panel data analysis for "Produc".
=> Fixed affects model is accepted.
Conclusion:
By conducting all the above tests, we come to a conclusion that Fixed Affects Model is the best to do the panel data analysis for "Produc".







No comments:
Post a Comment