# what test to use tell significant difference of two quadratic regression curves

I have two curves of quadratic regression models in a x-y plot

1. $y=a_1\text{x}^2+b_1\text{x}+c_1$ $Y= -0.51\text{x}^2-0.88\text{x}+3.21$, $R^2: 0.12$, coefficient of the quadratic term: p-value = 0.001

2. $y=a_2\text{x}^2+b_2\text{x}+c_2$ $Y= -0.17\text{x}^2-0.13\text{x}+3.41$, $R^2: 0.99$, coefficient of the quadratic term: p-value = 0.001

I want to know if curve 1 and 2 are significantly different. The null hypothesis is $a1=a2$ and $b1=b2$ and $c1=c2$

One way to do this is to estimate both curves in one model by including the appropriate interaction terms. After that it is just a matter of a Wald test. In Stata I would do this like so:

. sysuse nlsw88, clear
(NLSW, 1988 extract)

. gen byte black = race == 2 if !missing(race)
. label define black 1 "black" 0 "white"
. label value black black
.
. reg wage i.black##c.ttl_exp##c.ttl_exp i.union grade, vce(robust)
[output ommitted]

.
. test 1.black#c.ttl_exp = 1.black#c.ttl_exp#c.ttl_exp = 0

( 1)  1.black#c.ttl_exp - 1.black#c.ttl_exp#c.ttl_exp = 0
( 2)  1.black#c.ttl_exp = 0

F(  2,  1868) =    4.38
Prob > F =    0.0127


In this case we can reject at the 5% level (but not at the 1% level) the hypothesis that the two quadratic curves are equal.

• Please kindly advise if a Bonfferoni procedure is needed here. Commented Apr 28, 2013 at 21:46
• Please kindly advise if it is possible to use R. Commented Apr 28, 2013 at 21:50
• Of course you can fit the combined model in R and test interactions. Whether you need to take account of multiple testing would depend on whether you did other tests and your overall tolerance for type I error; if you could tolerate getting say 5% of type I errors when the null was true, you needn't make any adjustment. If for some reason you need strict control of your overall type I error rate, you might want to worry if you do more than one test. Note that here, that F test is a single test; if that's what you're testing, it already has the overall type I error rate that you have specified. Commented Apr 29, 2013 at 0:31
• Therefore, please kindly suggest if F test is suitable for the test. Further, I want to confirm whether Bonferroni procedure is unnecessary when using F test, as Glen_b mentioned. Commented Apr 29, 2013 at 4:45