Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65082

Using marginsplot for predictive probabilities of select interaction group levels

$
0
0
Hi. We are using a restricted national data set (so can't provide results), only code. We are using Stata 14.1

Below are our variables


issyn- dichotomous iss yes or iss no (0)
sturace- black=3, white=8
x2sesq5- categorical variable of a continuous SES variable into quintiles
stusexmale- male=1, female =0
sped- special ed=1, no special ed=0
x2locale- 1=city, 2=suburb, 3=town 4=rural
a1blackstu- percentage black student enrollment
a2freelunch- percentage of students on free and reduced lunch

We would like to plot a subset of the margins so that White students in the 3rd quintile and black students in quintiles 1 through 5 are plotted. Every time we try to plot just these margins, all of the quintiles of White students are plotted. Thus the graph shows 10 lines, versus the 6 lines we have indicated (black quintile 1, black quintile 2, black quintile 3, black quintile 4, black quintile 5, white quintile 3).

We have consulted Stata Manual 13 , 11.4.3.4 Selecting levels and used the following codes:


Code:
svy, subpop(incl3): logistic issyn ib8.sturace#ib3.x2sesq5 stusexmale sped ib2.x2locale a1blackstu a2freelunch

margins 3.sturace#1.x2sesq5 3.sturace#2.x2sesq5 3.sturace#3.x2sesq5 3.sturace#4.x2sesq5 3.sturace#5.x2sesq5 8.sturace#3.x2sesq5, at (a1blackstu=(10(10)90))

marginsplot, xlabel (10(10)90)
We also tried

Code:
margins 8.sturace#i3.x2sesq5 o8.sturace#o4.x2sesq5 o8.sturace#o5.x2sesq5  o8.sturace#o1.x2sesq5 o8.sturace#o2.x2sesq5 3.sturace#1.x2sesq5 3.sturace#2.x2sesq5 3.sturace#3.x2sesq5 3.sturace#4.x2sesq5 3.sturace#5.x2sesq5, , at (a1blackstu=(10(10)90))
marginsplot, xlabel (10(10)90)
and

Code:
margins 8.sturace#i3.x2sesq5 8.sturace#o4.x2sesq5 8.sturace#o5.x2sesq5  8.sturace#o1.x2sesq5 8.sturace#o2.x2sesq5 3.sturace#1.x2sesq5 3.sturace#2.x2sesq5 3.sturace#3.x2sesq5 3.sturace#4.x2sesq5 3.sturace#5.x2sesq5, , at (a1blackstu=(10(10)90))
marginsplot, xlabel (10(10)90)
Is there something else we can try or something that we have missed?

Please excuse any unintentional breach in Statalist protocol.

Thank you.


Viewing all articles
Browse latest Browse all 65082

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>