Hello,
I want to show over the years how the percentage of two subgroups of a catvar are changing (in relation to the total subgroup).
So: Over the years how many men are married relative to the overall number of men and accordingly for women.
tab marriagestatus year, col
by year, sort: egen married= mean(100*marriagestatus)
label variable married"married"
Graph
twoway line married year if sex==1 ///
|| line married year if sex==2 ///
xtitle(Year) xlabel(#14) ///
ytitle(Marriage(%)) ylabel (0(10)100)
I want to show over the years how the percentage of two subgroups of a catvar are changing (in relation to the total subgroup).
So: Over the years how many men are married relative to the overall number of men and accordingly for women.
tab marriagestatus year, col
by year, sort: egen married= mean(100*marriagestatus)
label variable married"married"
Graph
twoway line married year if sex==1 ///
|| line married year if sex==2 ///
xtitle(Year) xlabel(#14) ///
ytitle(Marriage(%)) ylabel (0(10)100)

Comment