Dear members of the list,
I am using gender and family type for explaining expectations of university graduation among teenagers of 30 countries, using data from PISA 2015. I am particularly interested in the interaction between gender and family type. In the example below, I label the gender variable gender as “gndr”, and the family typology as “univ_parent2”. This latter typology (variable) has just three categories.
As a preliminary step before multilevel modelling, I want to assess cross-national variation in the heterogeneous effect of gender across the categories of the family-type variable that I am using. I want to see to what extent the effect of gender on educational expectations, which I find generally diverse across types of family, is more so in some countries than in others.
For each country in the analysis, I intend to generate the average marginal effect of gender for each one of the three family types that I consider. My ultimate goal is to save all these country-specific average marginal effects of gender and generate a single graph with them.
For generating the marginal effects of gender after each country-specific logistic regression, I use the following loop. There are 32 countries, and the name of the country variable is “cntry3”
Then, I am aware that I can save the result as a single Excel file…
…But I want to save the results in a single Stata dta file so that I can generate a graph showing the cross-national variation in the marginal effect of gender across family types that I am interested.
Do you know if it is possible to save the results as a Stata dta file, instead of Excel.
Thanks for your attention
Luis
I am using gender and family type for explaining expectations of university graduation among teenagers of 30 countries, using data from PISA 2015. I am particularly interested in the interaction between gender and family type. In the example below, I label the gender variable gender as “gndr”, and the family typology as “univ_parent2”. This latter typology (variable) has just three categories.
As a preliminary step before multilevel modelling, I want to assess cross-national variation in the heterogeneous effect of gender across the categories of the family-type variable that I am using. I want to see to what extent the effect of gender on educational expectations, which I find generally diverse across types of family, is more so in some countries than in others.
For each country in the analysis, I intend to generate the average marginal effect of gender for each one of the three family types that I consider. My ultimate goal is to save all these country-specific average marginal effects of gender and generate a single graph with them.
For generating the marginal effects of gender after each country-specific logistic regression, I use the following loop. There are 32 countries, and the name of the country variable is “cntry3”
Code:
forval i = 1/32 { capture noisily logit [educational expectation] i.univ_parent2 i.gndr univ_parent2#gndr if cntry3==`i' margins, dydx(gndr) at(univ_parent2==(1 2 3)) estimates store Model`i' }
Code:
esttab mode* using "[name of the file.xls] ", replace
Do you know if it is possible to save the results as a Stata dta file, instead of Excel.
Thanks for your attention
Luis
Comment