Analysis using 3 models:
1. Pool Effect model
2. Fixed Effect model.
3. Random Effect model.
There are two types of index of panel data:
1> ID index
2> Time index.
Step 1:
Read the data.
Commands:
> data("Produc",package = "plm")
> head(Produc)
Step 2:
Pooled 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)
Step 3:
Fixed effect model
commands:
>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)
Step 4:
Random effect model:
commands:
>random1<-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(random1)
Step 6: Test for pooled data vs random data
Null hypothesis: Pool effect model
Alternate hypothesis: Random effect model
Command:
p value is very less. Reject null hypothesis and accept alternate hypothesis i.e.Random effect model.
Step 7: Test for random effect model vs pool effect model.
Null hypothesis: Random effect model
Alternate hypothesis: Fixed effect model.
command:
phtest(random1,fixed)
P value is too less . So reject Null hypothesis and accept alternate hypothesis i.e.Fixed effect model.
Aritro Ghosh
12BM60087
1. Pool Effect model
2. Fixed Effect model.
3. Random Effect model.
There are two types of index of panel data:
1> ID index
2> Time index.
Step 1:
Read the data.
Commands:
> data("Produc",package = "plm")
> head(Produc)
Step 2:
Pooled 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)
Step 3:
Fixed effect model
commands:
>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)
Step 4:
Random effect model:
commands:
>random1<-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(random1)
Step 5: Test for fixed vs OLS
pFtest(fixed,pool)
Null hypothesis: Pooled effect model
Alternate hypothesis: Fixed effect model
Commands:
> pFtest(fixed,pool)
Null hypothesis: Pool effect model
Alternate hypothesis: Random effect model
Command:
> plmtest(pool)
p value is very less. Reject null hypothesis and accept alternate hypothesis i.e.Random effect model.
Step 7: Test for random effect model vs pool effect model.
Null hypothesis: Random effect model
Alternate hypothesis: Fixed effect model.
command:
phtest(random1,fixed)
P value is too less . So reject Null hypothesis and accept alternate hypothesis i.e.Fixed effect model.
Aritro Ghosh
12BM60087








No comments:
Post a Comment