Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

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

# RE: st: Plotting the impact of a variable with confidence interval

 From "Md. Alauddin Majumder" To "statalist@hsphsun2.harvard.edu" Subject RE: st: Plotting the impact of a variable with confidence interval Date Mon, 4 Mar 2013 11:35:44 +0000

```Maarten, thank you so much!!!

Md. Majumder
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Maarten Buis [maartenlbuis@gmail.com]
Sent: Monday, March 04, 2013 5:13 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Plotting the impact of a variable with confidence interval

On Mon, Mar 4, 2013 at 11:23 AM, Md. Alauddin Majumder wrote:
> I have estimated this regression: y = ax + bx^2+......................................... Now, how can I show the impact of x (considering 20<x<40) on y with a confidence interval in a diagram?

See -help margins- and -help marginsplot-. To use that you need to
include your polynomial terms in factor variable notation, i.e.
-c.x##c.x-, see -help fvvarlist-. Below is an example:

*------------------ begin example ------------------
sysuse nlsw88, clear

gen byte marst = !never_married + married  ///
if !missing(never_married, married)
label variable marst "marital status"
label define marst 0 "never married"       ///
1 "divorced or widowed" ///
2 "married"
label value marst marst

gen byte black = race == 2 if race < 3
label variable black "race"
label define black 0 "white" ///
1 "black"
label value black black

glm wage c.ttl_exp##c.ttl_exp union grade black i.marst, ///
link(log) vce(robust) eform

margins , at(ttl_exp=(.12 .5 1/28))
marginsplot, recastci(rarea) ciopts(astyle(ci)) ///
plotopt(msymbol(i))
*------------------- end example -------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Also see: <http://www.maartenbuis.nl/wp/inter_quadr/inter_quadr.html>

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index