Dear Statalist,

I am trying to estimate the RESET and the Park test with the ppml_panel_sg command. I have already managed to get the same coefficient parameters using both the 'ppml' and 'ppml_panel_sg' commands, Once, however, I include in the model both exporter/importer-time FE and country pair FE the simple 'ppml' command,does not produce the standard errors or the RESET test. So I had to go to the faster ppml_panel_sg command. A similar code to the one I am presenting below works fine with the simple 'ppml' command. The following code that employs ppml_panel_sg includes exporter/importer-time-FE and country pair FE.

/// code starts here
set more off
ppml_panel_sg xftaif exporter!=importer, ex(exporter) im(importer) y(year) pred(predicten4) robust
estimates store R7, title(PPML with Exporter/ Importer Time FE and CP FE)
predict fit1,xb
*predict ehat1, res
gen fit2=fit1^2

quietly ppml_panel_sg x fta fit2 if exporter!=importer, ex(exporter) im(importer) y(year)robust
test fit2=0
* next lines are wrong
gen ehat1=x-fit1
gen ehat2=ehat1^2
glm ehat2fit1if exporter!=importer, cluster(pair) family(poisson) diff iter(30)
test fit1=1
test fit1=2

drop fit1 fit2 ehat1 ehat2

/// code ends here

I am not sure that the RESET test (and the predict command) is estimating what it is supposed to. I cannot get a value for the RESET as the fitted values are now 0 (for all those observations that have FTA=0) and a constant (0.944 - for all those observations that have FTA=1). Is this an issue with the link function. Should the pred() command? Can I get the residual values somehow for the park test (because getting them as 'gen ehat1=x-fit1' is wrong since predicted and fitted values are different)?

Thanks in advance for any input