Dear Stata users,

I estimate TFP using prodest command (ssc install prodest) and have one question regarding the estimation. I estimate TFP by industry in a loop and include year and industry controls. Because I estimate it by industry, all other industries except the one being estimated are dropped, hence controls for industries should be omitted due to lack of variation. However, prodest still reports coefficients on industry controls. When I estimate TFP just using fixed effects xtreg command by industry including year and industry dummies, industry coefficients are omitted in the output table as expected. My question is whether something is wrong with my syntax or why the command reports coefficients that should be omitted?

For the convenience I attach the minimum example and below is the code I am using.

xtset id year

//generate industry controls
tab industry, gen(di)
//generate year controls
tab year, gen(dy)

//Estimate TFP by industry including industry and year controls
gen pr = .
levelsof industry, local(levels)
foreach i of local levels {
preserve
keep if industry==`i'
prodest va, free(l) proxy(m) state(k) level(95) acf va poly(3) control(dy* di*)
restore
predict prod_`i', resid
replace pr = prod_`i' if industry==`i'
}

//using xtreg
gen pr_fe = .
levelsof industry, local(levels)
foreach i of local levels {
preserve
keep if industry==`i'
xtreg va l k dy* di*, fe
restore
predict prodfe_`i', resid
replace pr_fe = prodfe_`i' if industry==`i'
}


I would very much appreciate your help. Thank you in advance.

Best,
Alina