Hi everyone.
I am a novice of Stata and English is not my mother language. So I will try my best to explain as clear as possible the problem that I have run into.
I am currently using Stata 15.0 and my data having 20 variables. i created every possible combination out of them by using -tuples (SSC install). After that, I regress my dependent variable to every single combination by using -forvalues
in order to capture the estimation result, coefficients, bayesian information criterion. Unfortunately, something went wrong with my loop and i constantly got the same result for every regression. Stata somehow forgot the "combination" part that i would have wanted to added in the regression equation to be exact.
Here is my coding.
*Create variable to capture coefficients estimated.
foreach var of varlist `r(varlist)'{
gen b_`var'= .
}
ds, has(type double)
tuples `r(varlist)', varlist //SSC install tuples//
*looping
forval i = 1/`ntuples' {
probit GFC `tuple`i'' i.year
est sto model`i'
foreach var in `tuple`i'' {
scalar b_`var' = _b[`var']
replace b_`var' = `=scalar(b_`var')' in `i'
}
}
Stata somehow constantly returns the result of this regression: probit GFC i.year. I have tried many ways but it did not work at all.
Could you please explain what happened and show me how to fix it.
Many thanks and best regards
Related Posts with Content of local macro does not works in loop.
Predicted Probabilities with Logit and Fixed EffectHello, I am trying to compare 4 different groups (black women, white women, black men, and white wom…
Multiple observations per year in the dependent variable and annual observations for the dependent variablesHello Statalisters, I am trying to explore the impact of CSR expenses on the credit ratings of firm…
Direct, indirect and total marginal effect in the mvprobitPlease how to calculate the direct, indirect and total marginal effect in the mvprobit ? …
Measuring environmental innovation patentsDear Stata experts, For my master thesis, I'm figuring out how to analyse in order to measure envir…
Help needed: Export F-stats and P-values to an excel fileHi, I am using Stata 17 and need help in exporting results from Stata to excel. Here is an example …
Subscribe to:
Post Comments (Atom)
0 Response to Content of local macro does not works in loop.
Post a Comment