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

Please help with pred values plotting

$
0
0
Hello Brainstrust.
Sorry this is a repost. I've just read I have to use my real name.
Also I have read the manual and searched google for the answer but no joy.

Please bear with me. I'm a real beginner with stata.
I'm trying to plot predicted values after regression including their 95CI.
It works out fine when comparing two variables.
The syntax I am using is:

regress X Y
predict mean, xb
predict stdp, stdp
generate lowCI= mean - 1.96*stdp
generate highCI= mean + 1.96*stdp
line mean highCI lowCI Y, pstyle (p2 p3 p3 p4) sort


With this the graph comes out just fine.

I then try do the same with three variables using pretty much the same;

regress x y z
predict mean2, xb
predict stdp2, stdp
generate lowCI2= mean - 1.96*stdp2
generate highCI2= mean + 1.96*stdp2
line mean highCI2 lowCI2 Y, pstyle (p2 p3 p3 p4) sort


This time the graph comes out horribly wrong: Comme ca:
Array
Please help!

Thanks so much in advance!

Viewing all articles
Browse latest Browse all 65561

Trending Articles



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