Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Generate Estimates for Dependent Variable using OLS Regression


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Generate Estimates for Dependent Variable using OLS Regression
Date   Fri, 27 Jan 2012 17:00:16 +0100

I would use the factor variable notation (-help fvvarlist-) and than
use -margins- and -marginsplot (-help margins- and -help
marginsplot-). Also see:
<http://www.maartenbuis.nl/publications/inter_quadr.html>.

*-------------- begin example -------------------
sysuse nlsw88, clear
reg wage c.grade##c.ttl_exp i.race

sum ttl_exp
forvalues i = -2/2 {
	local val "`val' `=`r(mean)'+`i'*`r(sd)''"
}

qui margins , at(race=1 ttl_exp=(`val') ) over(grade)

marginsplot,                                 ///
    noci plotopts( msymbol(none) )           ///
    ytitle("expected hourly wage")           ///
    xdim(grade)                              ///
    plot1opts(lcolor(gs13))                  ///
    plot2opts(lcolor(gs10))                  ///
    plot3opts(lcolor( gs7))                  ///
    plot4opts(lcolor( gs4))                  ///
    plot5opts(lcolor( gs1))                  ///
    legend( order( - "total work experience" ///
                   1 "mean - 2*sd"           ///
                   2 "mean - 1*sd"           ///
                   3 "mean"                  ///
                   4 "mean + 1*sd"           ///
                   5 "mean + 2*sd" ))
*--------------- end example --------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

On Fri, Jan 27, 2012 at 4:36 PM, Christopher Salas-Wright wrote:
> I am trying to use the "pick a point method to create a visual figure
> – in Excel – of the interaction between risk propensity (zriskprop)
> and religious salience (zrelpriv) as they relate to my dependent
> variable: problem behavior (problem).
>
> This is my syntax for the regression equation:
>
> svy: reg problem age2 sex black hispanic otherrace inc1 inc2 inc3
> nofather droppedout depression anxiety zriskprop zservice zrelpriv
> zriskprop_zservice zriskprop_zrelpriv
>
> My dependent variable is problem behavior (problem) and the
> significant interaction term is “zriskprop_zrelpriv”.  If I wanted to
> graph the interaction for low, moderate, and high risk propensity as
> related to religious salience, I believe I would need to generate
> estimated values of my dependent variable (problem) when my IV (risk
> propensity) is at values of -1SD, 0, and +1SD (or some equivalent),
> right?
>
> The problem is this: I can't figure out how to generate these
> estimates of values of my DV when stipulating the my IV is at
> particular values.
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/



-- 
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index