[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: graphing results

From   "Isabelle Deltour" <[email protected]>
To   <[email protected]>
Subject   st: RE: graphing results
Date   Wed, 9 Sep 2009 13:15:42 +0200

Hi Matthijs:

Have you tried 
  graph export name_of_your_graph.wmf 
and then copy and paste into a word document?

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Matthijs De
Sent: Wednesday, September 09, 2009 12:34 PM
To: [email protected]
Subject: st: graphing results

Dear Stata-listers,
I am trying to graph the results of my regression. I have estimated a
model with quadratic terms and an interaction, as in y=x1 + x1^2 + x2
+ x1*x2. I am trying to plot my results in a graph of y versus x1.
Using -adjust- to keep covariates doesn't do what I need, since it
also sets x1*x2 to the mean of the interaction, rather than x1*(mean

I can get what I want by plotting it using the -graph twoway function-
command. My current code looks like:
graph twoway scatter y x1 ///
|| function y = _b[_cons] + _b[x1]*x = _b[x1^2]*x^2 + _b[x2]*x2_bar +
_b[x1*x2]*x1*x2_bar ,

where x2_bar is the mean of x2 (in the estimation sample).

 However, when imported in a document, the final graph looks coarse:
more like a like a step-function than a smooth line, even when using
2500 points to graph the function instead of the default 300. Is there
a way to get a graph that produces the effect of x1 on y controlling
for covariates, but that looks better than what I have now?

Thanks for helping!
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index