Learn R Programming

spanel (version 0.1)

hausman: Hausman test

Description

Hausman test

Usage

hausman(fixed, random)

Arguments

fixed
is the fixed effect object function
random
is the random effect object function

Value

Chisq the hausman statisticP-value the probability valuedf the degree of freedom

Examples

Run this code
data(Produc)
data("usaww")
#fit the fixed function
fx<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="fe")
# fit the random function
 ran<-span(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,Produc,usaww,n=48,t=17,model="re")
# the Hausman test
hausman(fx,ran)

Run the code above in your browser using DataLab