[R] HELP - Hausman Test + systemfit
jdnewmil at dcn.davis.ca.us
Wed Jan 6 18:44:43 CET 2016
To post appropriately, use less apologizing and more reading of the Posting Guide that is mentioned in the footer of all messages on this list (including this one). Note that HTML does not work well on the list, so be sure to turn it off in your email program (at least when sending emails here).
I have never used this function, but the error message is pretty clear. If you read the help for the systemfit function it states "list of formulas", not "list of model objects". The objects returned from lrm are not formulas. Perhaps look at some examples of using that function, such as the ones in the help (type ?systemfit after you have loaded the systemfit package into R).
Sent from my phone. Please excuse my brevity.
On January 6, 2016 5:02:52 AM PST, Kateryna Riabchenko <riabchenko.kateryna at gmail.com> wrote:
>Hello, I am not advanced in R (that is why my questions can sound
>I apologize for that in advance. But that is how my brain works - I
>ask questions to understand. I was searching the answer everywhere -
>without result. So I am asking You.
>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 =
>Model4<- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION +
>data = ACU)
>Model5 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION +
>+ CPI, data = ACU)
>Model6 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION +
>+ CPI + INTERATE, data = ACU)
>Model7<- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION +
>+ CPI + INTERATE + UNEMPL, data = ACU)
>Model8 <- lrm(ACINTENSITY ~ GDPGROWTH + POPULATION + FEDUNION +
>+ 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
>*I started with this*:
>inst <- ~ POPULATION - *this is Question1:* I don't know what I need
>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
>all variables, which were used in 2 models. if You can explain - thank
>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
>Please, help me to understand What I do wrong!
> [[alternative HTML version deleted]]
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help