use https://www3.nd.edu/~rwilliam/statafiles/nonlin1.dta, clear nestreg, quietly: reg y x1 (x2 x3 x4) quietly reg y x1 x2 x3 x4 test x2 x3 x4 reg y x1 c.x1#c.x1 c.x1#c.x1#c.x1 c.x1#c.x1#c.x1#c.x1 test c.x1#c.x1 c.x1#c.x1#c.x1 c.x1#c.x1#c.x1#c.x1 quietly reg y x1 ovtest curvefit y x1, f(1 h) curvefit y x1, f(1 4) use "https://www3.nd.edu/~rwilliam/statafiles/nonlinln.dta", clear gen lninc = ln(inc2) reg lninc year glm inc2 year, link(log) curvefit inc2 year, f(1 0) use https://www3.nd.edu/~rwilliam/statafiles/blwh.dta, clear mkspline educ1 12 educ2 = educ, marginal reg income educ1 educ2 mkspline educ3 12 educ4 = educ reg income educ3 educ4 test educ3=educ4 use "https://www3.nd.edu/~rwilliam/statafiles/blwh.dta", clear mkspline educ1 12 educ2 = educ, marginal quietly reg income educ1 educ2 predict spline scatter income educ || line spline educ, sort scheme(sj) use "https://www3.nd.edu/~rwilliam/statafiles/blwh.dta", clear mkspline educ1 12 educ2 = educ, marginal gen int2 = educ > 12 reg income educ1 educ2 int2 predict spline scatter income educ || line spline educ, sort scheme(sj) * Appendix A use "https://www3.nd.edu/~rwilliam/statafiles/nonlin1.dta", clear twoway scatter ypp0 x1 || lfit ypp0 x1 || qfit ypp0 x1, scheme(sj) curvefit ypp0 x1, f(1 4) curvefit yppn x1, f(1 4 h) c(3) use "https://www3.nd.edu/~rwilliam/statafiles/nonlin1.dta", clear quietly reg yppn x1 predict linear quietly reg yppn x1 c.x1#c.x1 predict quadratic quietly reg yppn x1 c.x1#c.x1 c.x1#c.x1#c.x1 predict cubic twoway scatter yppn x1 || line linear x1 || line quadratic x1 || line cubic x1, scheme(sj) use "https://www3.nd.edu/~rwilliam/statafiles/blwh.dta", clear mkspline educ1 12 educ2 = educ, marginal reg income educ1 educ2 predict spline scatter income educ || line spline educ, sort scheme(sj) * Appendix B list educ educ1 educ2 educ3 educ4 in 1/20