Hi! I'm trying to construct the variables for exporter-time and importer-time fixed effects for our gravity model but I only get the error 'invalid syntax' r(198). I simply copied the Stata commands from the book by Yotov et al. (2016) but there seems to be a problem that I can't resolve. Thank you all for your help in advance. Your feedback will be a big help to our research. Here are the codes I used:
describe IMPORTER_TIME_FE*
global N = r(r)
global N_1 = $N - 1
forvalues i = 1 (1) $N_1 {
replace EXPORTER_TIME_FE`i' = EXPORTER_TIME_FE`i' * exp(_b[EXPORTER_TIME_FE`i'])
replace IMPORTER_TIME_FE`i' = IMPORTER_TIME_FE`i' * exp(_b[IMPORTER_TIME_FE`i'])
}
replace EXPORTER_TIME_FE$N = EXPORTER_TIME_FE$N * exp(_b[EXPORTER_TIME_FE$N ])
replace IMPORTER_TIME_FE$N = IMPORTER_TIME_FE$N * exp(0)
egen exp_pi_BLN = rowtotal(EXPORTER_TIME_FE1-EXPORTER_TIME_FE$N)
egen exp_chi_BLN = rowtotal(IMPORTER_TIME_FE1-IMPORTER_TIME_FE$N)
The error appears when I run the forvalues command:
. forvalues i = 1 (1) $N_1 {
2. replace EXPORTER_TIME_FE`i' = EXPORTER_TIME_FE`i' * exp(_b[EXPORTER_TIME_FE`i'])
3. replace IMPORTER_TIME_FE`i' = IMPORTER_TIME_FE`i' * exp(_b[IMPORTER_TIME_FE`i'])
4. }
invalid syntax
r(198);
Related Posts with Problem with macro in forvalues
How to deal with Likert Scale Variables as 101 StatalistHello guys, I have done some Google research regarding my topic and he brought me here. I actually f…
The estimate significant level of XTSURDo you think it is normal to have ALL variables extremely significant like p < 0.000? After I ran…
placebo analysis: time falsification and location falsificationHi , My variable of interest is an indicator variable (LAW) that equals 1 if a firm is in a state h…
Hansen test for xtdpdsysHi. I am fairly new to stata but can anyone tell me how I can get the Hansen j statistics after usin…
command _qregtrace is unrecognizedWhen I used command "grqreg" to graph quantile regressions, I got error saying "command _qregtrace i…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with macro in forvalues
Post a Comment