Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Plotting graph for a quadratic regression model

From   [email protected]
To   [email protected]
Subject   Re: st: Plotting graph for a quadratic regression model
Date   Wed, 23 Mar 2005 06:25:53 -0600

How about something like this:

. sysuse auto
(1978 Automobile Data)

. gen mpg2 = mpg^2

. qui reg price mpg mpg2 weight

. qui adjust weight, gen(predicted)

. twoway line predicted mpg, sort || scatter price mpg


----- Original Message -----
From: Luigi Curini <[email protected]>
Date: Wednesday, March 23, 2005 5:35 am
Subject: st: Plotting graph for a quadratic regression model

> Dear all,
> I have a question about the graph options of Stata. I have a quadratic
> regression model, and I want to graphs the estimated regression 
> functionsrelating the DV and the IV of my interest for the 
> quadratic specification,
> along with a scatterplot of the data. In other words, my graph 
> should show
> the predicted value of the DV as a funcion of the IV of interest, 
> holdingfixed other values of the IV in the regression at their 
> sample averages.
> Using a normal mathematical software (I'm using MAPLE) I'm able to 
> plot my
> quadratic curve, but I'm not able to superimpose into the graph 
> the points
> of all my observations. Is it possible to get this graph using STATA8?
> I'd be really greatful for any help,
> Best regards,
> Luigi Curini

*   For searches and help try:

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