Hi,
I am trying to plot the adjusted means (in the form of a bar graph as both predictors are categorical) from a linear regression model.
Say I run the following:
regress y i.a##i.b c.covariable c.covariable i.covariable
The interaction is significant, so therefore I want to plot the adjusted means for each level of a (2-levels) and b (2 levels).
To see the adjusted means, I do:
margins a#b
And to get the individual predicted values I do:
predict predicted_y
I figured the best way to plot bar graphs was using the following code:
cibar predicted_y, over1(a) over2(b)
However, the means on the bar graphs do not match up to the values obtained from margins a#b
Any ideas on why this might be? Or perhaps another way I can directly plot the outcome from the interaction in a bar graph?
Many thanks,
Lucy
Related Posts with Plotting adjusted means as a bar graph
For fractional regression, it is appropriate to rank the dependent variable for the concern that the measure is noisy?Hi, I am using fractional regression, fracreg in Stata, to analyze how city's high school student gr…
Regression rich text file issueHello, I am attempting to transfer the regression to a rich text file. For some reason my regression…
xtpdyn marginsDear all, I've encountered a problem when implementing xtpdyn postestimation. Using this example: xt…
Marginsplot only some categoriesDear all, I am struggling with a probably easy procedure. I estimate the following command: logit…
Gini coefficient in a LoopDear all, I need to compute the Gini coefficient over country and over waves. Therefore, I realized …
Subscribe to:
Post Comments (Atom)
0 Response to Plotting adjusted means as a bar graph
Post a Comment