Hi,
I read posts related to the esttab carefully, but I did not find the exact answer to my question.
I am running a simple loop on many countries with a logit model that uses the categorical variables country of birth, age group, education, and their interactions. I am interested in the odds ratios for birth-related variables across different countries. Therefore, I use esttab to obtain these odds ratios
The categorical variable country of birth is not balanced across countries, resulting in varying numbers of categories. Consequently, esttab returns a table that uses only the labels for the categorical variable birth from the last model/country. Is there a simple way to prevent this and use the correct labels for the variable?
Loop:
I read posts related to the esttab carefully, but I did not find the exact answer to my question.
I am running a simple loop on many countries with a logit model that uses the categorical variables country of birth, age group, education, and their interactions. I am interested in the odds ratios for birth-related variables across different countries. Therefore, I use esttab to obtain these odds ratios
The categorical variable country of birth is not balanced across countries, resulting in varying numbers of categories. Consequently, esttab returns a table that uses only the labels for the categorical variable birth from the last model/country. Is there a simple way to prevent this and use the correct labels for the variable?
Loop:
Code:
cd "....." local files: dir . files "*dta" foreach file of local files { use "`file'", clear quietly: logit employ i.birth i.edu i.age i.birth##i.edu, or noconstant baselevels nolog eststo } esttab, label eform nostar keep (*birth *birth#*edu)
Comment