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
Table of same responsesHiii Statalists, I have data with some background variable like name, state and 100 variables v1 v2 …
How not to do xtdpdgmmThe title of this post is deliberately provocative: it echoes slides and tweets by Sebastian Kripfga…
Merging DataHello all, I have two datasets: one has a column of geographic identifiers and one has a column of …
inquire about ORDERED LOGISTIC REGRESSIONI am studying people's financial stress. I have a set of 10 items to measure financial stress (1-4 L…
Looping over many valuesDear Statalist, I've came across a problem I couldn't solve. I have a dataset indicting informatio…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting adjusted means as a bar graph
Post a Comment