1

I have two dependent variables, DV1 and DV2, and one independent variable IV. I want to ascertain if the fitted model between DV1 and IV explains the relationship between DV2 and IV well or not.

First I am fitting two separate models thus:

ModelA<-lm(DV1~IV)
ModelB<-lm(DV2~IV)

I then want to extract the fitted slope from Model A, and fit it to the relationship of DV2~IV. I'm then going to extract the residuals from this new fitted relationship, and compare them with the residuals from Model B.

In order to do this, I need to be able to specify the slope that is fitted to the relationship between DV2 and IV, but I don't know how to do so. I realise this is probably very simple! Does anyone have any suggestions?

Many thanks!

Sarah
  • 1,137
  • 4
  • 12
  • 27

1 Answers1

2

I think what you mean is exactly what Cox test does -- compare two non nested models. Take a look at this manual entry for the coxtest function from the R package lmtest.

See also this question.

As for a linear fit with a pre-specified offset. Say, x is your predictor, y is your response, and a is a predefined coefficient (slope). Fit the model as follows:

lm( y - a*x ~ 1 )

That way, you will only be estimating the intercept term. Another way that will yield the same results:

lm( y ~ 1 + offset( a * x ) )
January
  • 6,999
  • 1
  • 32
  • 55
  • 1
    I have updated the answer accordingly. – January Jun 26 '13 at 10:12
  • I'm not sure, but I think a cox test requires that the dependent variable in both cases is the same, so I don't know if this is what I want here? – Sarah Jul 01 '13 at 10:13