For exploratory purposes, I intend to run an OLS regression for a pool of countries drawn from PIAAC. My ultimate goal is to graphically explore cross-national differences in the effect of father's education on attainment of a master level diploma.
My dependent variable ('master') is dichotomous but I apply a linear probability model to my data; that is, for now, I treat it as continuous. My key independent variable (father's educational attainment, 'edufath'), it is split up into three categories: (a) ISCED 1/2/3(short) (b) ISCED 3/4 (c) ISCED 5/6
Following the great Chuck Huber's video on 'Profile plots and interaction plots in Stata: Interactions of categorical variables', I generate the interaction plots by running the following commands:
HTML Code:
reg master female i.AGEG10LFS i.imgen2 edufath##cntryid margins edufath#cntryid marginsplot, xdimension(cntryid) recast(line) plotopts(connect(none)) xlabel(, labels)
As a result of the last line in the codes above, I get a graph that is comes next:
Here comes my question. The graph is satisfactory, but I am not able to make the country labels appear in the X axis (Austria, Belgium... ) so as to easily identify the marginal effect of father's education for each country, which was my initial intention. There only appear the numerical codes of my country variable. I have tried with all the possible options in the command marginsplot, to no avail.
I have also imagined that it was a matter of changing the format of cntryid, but I suspect that this is wrong. In case it helps, I provide the information on 'cntryid' that is provided by Stata about this variable
Code:
. codebook cntryid
------------------------------------------------------------------------------------------------------------------------
cntryid Country ID (ISO 3166, numeric)
------------------------------------------------------------------------------------------------------------------------
type: numeric (double)
label: CNTRYID
range: [40,840] units: 1
unique values: 31 missing .: 0/200,588
examples: 152 Chile
250 France
440 Lithuania
703 Slovak Republic
. des cntryid
storage display value
variable name type format label variable label
------------------------------------------------------------------------------------------------------------------------
cntryid double %23.0g CNTRYID Country ID (ISO 3166, numeric)
At any rate, thanks for your attention
Best wishes
Luis Ortiz
Leave a comment: