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
Individual Cross sectional regressions by firm and obtaining residuals... Please help me...Hello Everyone! I am totally new to STATA, and I have a brief question about running individual cros…
How to convert from Quarterly to Annual data set?Hi. I am facing problem in converting my quarterly bank level data to annual data. My data set is li…
Very strange Macbook pro behavior - Stata won't close, caught in endless save loopVery strange Macbook pro behavior - Stata won't close, caught in endless save loop https://drive.g…
HELP! confidence intervals for meta-analysis STATA v16I am trying to do a meta-analysis and calculated odds ratios and Upper and Lower 95% CI. On STATA v1…
Comparing Means without Standard DeviationHello, My colleague and I are working on a latent class analysis of roughly 30 different behaviors.…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with macro in forvalues
Post a Comment