I have a model that I fit on two different samples (each representing a region in a country, with different sample sizes):

region 1: P = a1 + a2*H

region 2: P = b1 + b2*H

which is simply:

region 1: R1 <- lm(P ~ H)

region 2: R2 <- lm(P ~ H)

To test for equality of coefficient estimates, a Wald test would be appropriate. However, the standard Wald test, waldtest(), can only be carried out for models applied to the same data set.

How can I get around this and test for equality of coefficients when I have 2 different samples?

thanks, Diana


1 Answer 1


You can do it by creating one combined dataset with variables P, H, and a new variable "region" that is a factor with levels "R1" and "R2", say. Then consider two models

mod1 <- lm(P ~ H * region, data = combineddata)

mod2 <- lm(P ~ H, data = combineddata)

The first model has 4 parameters, comprising separate slopes and intercepts, and the second fits the same slope and intercept to both regions. Then


will do a test comparing the two models.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.