Chow Structural Test in R [duplicate]

This question already has an answer here:

I am sitting on a pile of data concerning wages at a local company and other information, such as the gender, whether the person in question belongs to a minority group etc. What I would like to investigate is whether an additional year of education gives the same relative increase in wages for lower and higher education. For this purpose, I have divided the original data into two subcategories; one group with at most 12 years of education and the other with 13 or more years of education. What I would like to perform is a Chow test of structural change of the form

\begin{equation} F=\frac{\frac{(RSS-(RSS_{\text{lower}}+RSS_{\text{higher}}))}{2}}{\frac{RSS_{\text{lower}}+RSS_{\text{higher}}}{n-2k}}=\frac{(n-2k)((RSS-(RSS_{\text{lower}}+RSS_{\text{higher}}))}{2(RSS_{\text{lower}}+RSS_{\text{higher}})} \sim F(k,n-2k) \end{equation} where $n$ is the total number of observations and $k$ is the number of explanatory variables.

Clearly, I could simply calculate the $RSS:$s directly and then construct $F$ explicitly.

total<-lm(SALARY~EDUC+GENDER+MINORITY)
lower<-lm(SALARY1~EDUC1+GENDER1+MINORITY1)
higher<-lm(SALARY2~EDUC2+GENDER2+MINORITY2)