[R] comparing linear models

JesperHybel jesperhybel at hotmail.com
Wed Apr 18 21:49:00 CEST 2012


I wanted to do an F-test to compare model L2 with L3 assuming
heteroskedasticity.  The variable KONK2 only has three levels and are for
that reason replaced by dummyvariables KONKD1 and KONKD2 in L3. Hence making
L4 equivalent to L2.

L2<-lm(PRMRES ~  factor(NYPR) + KONK2 + OMS + factor(NYPR)*OMS )
L3<-lm(PRMRES ~  factor(NYPR)+ KONKD1+ KONKD2 + OMS + factor(NYPR)*OMS)
L4<-lm(PRMRES ~  factor(NYPR)+ I(2*KONKD2+KONKD1) + OMS + factor(NYPR)*OMS)

I tried Waldtest in lmtest, but no result due to non-nested models.
I don't know whether linearHypothesis for car can be of any use restricting
coefficients of KONKD1 and KONKD2 to be equal.

So Im a little low on ideas
Also being a novice I'm not quite sure of the setup.


--
View this message in context: http://r.789695.n4.nabble.com/comparing-linear-models-tp4568825p4568825.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list