How to check whether or not two regression curves from different datasets are different in R Here is an example code:
set.seed(3)

data1 = iris[sample(c(1:dim(iris)[1]), 30), ]
data2 = iris[sample(c(1:dim(iris)[1]), 50), ]

model1 = lm(Petal.Length ~ log(Petal.Width),
            data = data1)
model2 = lm(data2$Petal.Length ~ log(data2$Petal.Width))

par(mfrow = c(1, 4))
plot(data1$Petal.Width, 
     data1$Petal.Length)
points(sort(data1$Petal.Width),
       predict(model1, newdata = data1[order(data1$Petal.Width), ]),
       col = "red", 
       type = "l")

plot(data2$Petal.Width, 
     data2$Petal.Length)
points(sort(data2$Petal.Width),
       predict(model1, newdata = data2[order(data2$Petal.Width), ]),
       col = "red", 
       type = "l")


summary(model1)
summary(model2)

As in the code, I fitted two different curves from two different datasets using the simple regression method in which the explanatory variable is in logarithm form. Like in the code, the datasets have the same variables with different size.
I want to check that the two curves (model1 and model2) are statistically different or not.
How can I do it in R?
---- edited ----
I know that there are many questions about comparing regression lines, but my case is a different one from previous ones because I want to compare different models built from different data sets while other cases are to compare different models built from the same data set.
Let me state more about the context of my purpose to elaborate on the term "compare."
I made a model (the curve) for an experimental site and want to apply this model to many other sites (over the country). I acknowledge that it would not proper to apply the model to other sites where the model is not based on (the resulted curve of another site may be different from the previous one). So, I made one more curve for another study site and trying to compare the two models built from different sites.
This is why the two data sets have the same variable list. And the common points of the two data sets in the example can be ignored in term of my purpose.
Thank you!
 A: Your case is that of comparing two models with same variables but different set of data points. You can use chow.test from library gap. However, as mentioned in my comment above, you need to remove common data points from one of the data frames. Following is the code for this (and also the result I obtained):
set.seed(3) 
data1 = iris[sample(c(1:dim(iris)[1]), 30), ]
data2 = iris[sample(c(1:dim(iris)[1]), 50), ]

data1_sno=as.numeric(rownames(data1))
data2_sno=as.numeric(rownames(data2))

# next line tells you which of the data points in data2 are also in data1.
new_index=data2_sno %in% data1_sno 
data2_new=data2[!new_index,]
gap::chow.test(y1=data1$Petal.Length,x1=log(data1$Petal.Width),
           y2=data2_new$Petal.Length,x2=log(data2_new$Petal.Width))


   F value      d.f.1      d.f.2    P value 
 0.8257495  2.0000000 64.0000000  0.4425175

So the null could not be rejected, i.e. it cannot be said that the curves are indeed different.
A: Why do a statistical test of this? Any test will have the usual problems of p values - that is, the result will depend partly on sample size. 
When you have two data sets, you know that the same line doesn't fit both equally well (except perhaps for some constructed data sets and some very small data sets). So, graph both and look at them. 
Are they different?
Then look at the predictions that each makes from the same IVs. Are they different?
And, by "different" I mean "different enough to matter to anyone". 
