[R] HELP - Hausman Test + systemfit

Kateryna Riabchenko riabchenko.kateryna at gmail.com
Wed Jan 6 14:02:52 CET 2016


Hello, I am not advanced in R (that is why my questions can sound stupid).
I apologize for that in advance. But that is how my brain works - I need to
ask questions to understand. I was searching the answer everywhere  -
without result. So I am asking You.

*Given:*

I have 8 regression Models:
Model1 <- lrm(ACINTENSITY ~ GDPGROWTH, data = ACU)
Model2<- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION, data = ACU)
Model3 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION, data = ACU)
Model4<- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION + CENTRALBANK,
data = ACU)
Model5 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION + CENTRALBANK
+ CPI, data = ACU)
Model6 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION + CENTRALBANK
+ CPI + INTERATE, data = ACU)
Model7<- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION + CENTRALBANK
+ CPI + INTERATE + UNEMPL, data = ACU)
Model8 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION + CENTRALBANK
+ CPI + INTERATE + UNEMPL + INTERNET, data = ACU)
As you can see, each time a new explanatory variable is added.
I want to perform the Hausman Test
for that I installed systemfit package
My idea was to compare Model1 with Model2, Model2 with model3, ... and so on

*I started with this*:
inst <- ~ POPULATION  - *this is Question1:* I don't know what I need to
mention in *"inst"*. I put additional variable in Model2 which does not
exist in Model1, but I ma not sure that is correct! Or maybe I need to put
all variables, which were used in 2 models. if You can explain - thank you!
system <- list(Model1, Model2)

# perform the estimations
fit2sls <- systemfit(system, "2SLS", inst = inst, data = ACU)

but R responded:

Error in systemfit(system, "2SLS", inst = inst, data = ACU) :
  the list of argument 'formula' must contain only objects of class 'formula'



Please, help me to understand What I do wrong!
Best,
Kateryna

	[[alternative HTML version deleted]]



More information about the R-help mailing list