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.
Need to change order of boxes in box plot commandDear statalist, I have a command to graph a box plot for multiple variables and year as follow Cod…
Gravity model regressionI want to estimate a gravity model 5 countries in East Africa Community (EAC), Burundi, Kenya, Rwand…
Analysing different models within the same panel dataI'm currently analysing the effect of the borrowers gender on the performance on financial service p…
Partial adjustment model explanationHi all, I'm trying to replicate the following paper: https://onlinelibrary.wiley.com/doi/...1.2008.…
Mixed model postestimationI have a longitudinal data set of children from birth to 5 years. During the first year, %body fat i…
Subscribe to:
Post Comments (Atom)
0 Response to Content of local macro does not works in loop.
Post a Comment