Hello everyone,
Really looking for some help year, doing my final year Economics dissertation. Sadly no face-to-face contact.
I am plotting the chance that individuals say "yes" or no" to a binary question about racism, and how the probability of them saying yes varies over time.
Here is my code:
regress lack_education i.year realinc age sex race educ interaction_black
margins, over(year) saving(file1, replace)
marginsplot, x(year) recast(line)
graph save 1.gph, replace
regress lack_motivation i.year realinc age sex race educ interaction_black
margins, over(year) saving(file2, replace)
marginsplot, x(year) recast(line)
graph save 2.gph, replace
regress lack_ability i.year realinc age sex race educ interaction_black
margins, over(year) saving(file3, replace)
marginsplot, x(year) recast(line)
graph save 3.gph, replace
graph combine 1.gph 2.gph 3.gph, ycommon xcommon commonscheme cols(1)
graph save 1234.gph, replace
Problem:
My margin plot combinations do not integrate the graphs on one axis. I would look all 3 of the answers over time to be plotted on the same graph.
I have tried:
graph twoway (line discrimination year) || ///
(line lack_education year) || ///
(line lack_motivation year)|| ///
(line lack_ability year) || ///
However, this looks very ugly as it just presents 0/1 data in each year, with thick lines every year. I want the probability of somebody saying yes each year, not a plot of all the data.
Shall I continue with the marginsplotting, do I need to save my marginsplots results and combine them onto one graph?
Thank you, Charlie.
Really looking for some help year, doing my final year Economics dissertation. Sadly no face-to-face contact.
I am plotting the chance that individuals say "yes" or no" to a binary question about racism, and how the probability of them saying yes varies over time.
Here is my code:
regress lack_education i.year realinc age sex race educ interaction_black
margins, over(year) saving(file1, replace)
marginsplot, x(year) recast(line)
graph save 1.gph, replace
regress lack_motivation i.year realinc age sex race educ interaction_black
margins, over(year) saving(file2, replace)
marginsplot, x(year) recast(line)
graph save 2.gph, replace
regress lack_ability i.year realinc age sex race educ interaction_black
margins, over(year) saving(file3, replace)
marginsplot, x(year) recast(line)
graph save 3.gph, replace
graph combine 1.gph 2.gph 3.gph, ycommon xcommon commonscheme cols(1)
graph save 1234.gph, replace
Problem:
My margin plot combinations do not integrate the graphs on one axis. I would look all 3 of the answers over time to be plotted on the same graph.
I have tried:
graph twoway (line discrimination year) || ///
(line lack_education year) || ///
(line lack_motivation year)|| ///
(line lack_ability year) || ///
However, this looks very ugly as it just presents 0/1 data in each year, with thick lines every year. I want the probability of somebody saying yes each year, not a plot of all the data.
Shall I continue with the marginsplotting, do I need to save my marginsplots results and combine them onto one graph?
Thank you, Charlie.