hausman: Hausman test

Description Usage Arguments Value Examples

View source: R/spanel.R

Description

Hausman test

Usage

1
hausman(fixed, random)

Arguments

fixed

is the fixed effect object function

random

is the random effect object function

Value

Chisq the hausman statistic

P-value the probability value

df the degree of freedom

Examples

1
2
3
4
5
6
7
8
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)

Example output

Hausman Test
Chisq: 28.51944 
P-value: 2.880384e-05 
df: 5

spanel documentation built on May 1, 2019, 9:14 p.m.