Hi everyone!

I'm getting stuck with something probably silly.

I have a number of variables that share a common prefix which I would like to regress individually using reghdfe.
What I have come up with is not working. I'm getting an 'unexpected end of file'.

Code:
foreach var of spei_* {
    quietly reghdfe ln_agprod var, absorb(country_id continent_id#year) vce(cluster country_id)
    estimates store est_`var'
}
My variables are of the form spei_n20 to spei_n0 and spei_1 to spei_20.

Many thanks for your help!