Is there a method to look for significant difference between two linear regression lines I have two data sets, Fladen A and Fladen B. These are two locations in the North Sea. For each dataset, I have both Age and Height data for a marine mollusk. I have plotted and produced a linear regression line for Age vs height for both datasets.
However, I am not sure what statistical test/R code to use to see if the age height relationship in Fladen A is significantly different to the Age Height relationship in Fladen B.
I have tried anova tests but I do not think this is correct
 A: Do a binary factor for the datasets 0 being for Fladen A and 1 being for Fladen B. From there combine the datasets. You can then run a regression using the binary as an independent variable. If the binary coefficient is significant then the lines are significantly different.
Look at this example pulled from Dr. Garrett Saunders' Statistics Noteboook
lm.2lines <- lm(mpg ~ qsec + am + qsec:am, data=mtcars)

#get the "Estimates" automatically:
b <- coef(lm.2lines)
# Then b will have 4 estimates:
# b[1] is the estimate of beta_0: -9.0099
# b[2] is the estimate of beta_1:  1.4385
# b[3] is the estimate of beta_2: -14.5107
# b[4] is the estimate of beta_3: 1.3214

ggplot(mtcars, aes(y=mpg, x=qsec, color=factor(am))) +
  geom_point(pch=21, bg="gray83") +
  #geom_smooth(method="lm", se=F) + #easy way, but only draws the full interaction model. The manual way using stat_function (see below) is more involved, but more dynamic.
  stat_function(fun = function(x) b[1] + b[2]*x, color="skyblue") + #am==0 line
  stat_function(fun = function(x) (b[1]+b[3]) + (b[2]+b[4])*x,color="orange") + #am==1 line 
  scale_color_manual(name="Transmission (am)", values=c("skyblue","orange")) +
  labs(title="Two-lines Model using mtcars data set") 




