Good afternoon

I am estimating a dynamic model with pmg, mg and dfe. the study has to do with the application of the kuznets curve to CO2, co2 = co2 (primary energy, gdp, gdp ^ 2, trade openess).
I discovered the optimal lags (1,1,0,0,0) in the order of variables described above. however I don't know if I'm using the right commands to do the hausman test and estimate the model.
xtpmg d.lco2pc d.lceppc d.lpibpc d.lpib2pc d.labr, lr( l.lco2pc l.lceppc lpib2pc labr) ec(ECT) replace mg
xtpmg d.lco2pc d.lceppc d.lpibpc d.lpib2pc d.labr, lr( l.lco2pc l.lceppc lpib2pc labr) ec(ECT) replace pmg
hausman mg pmg

best regards

PS: co2=co2
primary energy=ceppc
GDP=pib
GDP^2=pib^2
trade openess=abr
l(var)=ln(var)