How do you compare regression slopes of two groups that are distinct in terms of the indepdent (x) variable? I have two sets of biometric data: one from fetuses and one from new born infants and am comparing the biometric measure (eg. head size) against the age of the baby. However, the two groups are clearly distinct in terms of age with the fetal data spanning 22-39 weeks and the newborn data spanning 39-42 weeks. My hypothesis is that the newborn infant measures should lie along the same regression line as those of the fetuses (ie. just represent a continuation along the same trajectory) however I am unclear how to test for this. Essentially this is comparing two regression slopes however there is no overlap in the x axis variable.
Many thanks for any advice!

 A: One standard way to approach this problem is to do a regression that includes fetus vs newborn as a predictor interacting with age in weeks. For example, if Newborn  is coded 0 for fetus and 1 for newborn, you could write the model as follows:
headSize ~ (age-39) + Newborn + (age-39)*Newborn

Expressing age as the difference from 39 weeks might make the output a little easier to understand. With standard treatment coding of predictors (the default in R), this would give you estimates of:

*

*an intercept, the estimated headSize at 39 weeks for a fetus


*a coefficient for age, representing the growth in headSize per week for a fetus


*a coefficient for Newborn, the difference in headSize at age 39 weeks from that of a fetus


*a coefficient for the multiplicative interaction term representing the estimated difference in growth of headSize between a Newborn and a fetus per week.
If there is no difference, then the values of the latter two coefficients should not show statistically significant differences from zero. As another answer notes, however, you will have to decide whether any statistically significant difference is large enough to matter in practice.
It looks like you might not have a strictly linear relationship between headSize and age, however. So when you go to do this, you might need to consider some transformation of headSize or age to meet the assumptions of a linear regression.
A: I believe a pretty straightforward approach would be to fit a particular regression to each group, so you would end up with two models and two slopes.
Probably you'll have something like this:

If your hypothesis is right the two regressions will have similar slopes - You'll just have to define what "similar slopes" mean in your context.
Just in case, the code I made to mimic your data is this:
N = 400

data1 = NULL
data1$x = rnorm(N, 0, 1)
data1$y = data1$x + runif(N, -2, 2)

data2 = NULL
data2$x = data1$x + runif(N, max(data1$x), max(data1$x)+5)
data2$y = data1$y + runif(N, -2, 2) + 5

reg1 = lm(data1$y ~ data1$x)
reg2 = lm(data2$y ~ data2$x)

pdf(file = "My Plot.pdf", width = 4, height = 4)

plot(data1$x, 
     data1$y, 
     pch = 19,
     lwd = 0.2,
     xlim=c(min(data1$x,data2$x),max(data1$x,data2$x)),
     ylim=c(min(data1$y,data2$y),max(data1$y,data2$y)),
     col="blue")
lines(data2$x, 
      data2$y, 
      type="p", 
      pch = 19, 
      lwd = 0.2,
      col="red")
abline(reg1)
abline(reg2)

dev.off()

