Bookmark and Share

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]

st: more graphing


From   "Averett, Susan L" <averetts@lafayette.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: more graphing
Date   Tue, 5 Apr 2011 13:35:41 -0400 (EDT)

Thank Nick for helping with the graphing. I have implemented it successfully. Now, I have two follow up questions related to this course.
 
First, I would like to have three regression lines on the same graph (graphing fitted lahe against age holding female and bachelor constant)

My regressions are:
regress lahe age female bachelor
regress lahe lage female bachelor
gen age2=age*age
regress lahe age2 female bachelor


And, I think the following syntax is giving me the graph I want but I am not sure. Is it taking into account the interaction
between female and age and bachelor and age? If not, do I redefine my groups or how would I do that?

gen bach_fem=bachelor*female
gen fem_age=female*age

regress lahe age age2 female bachelor bach_age bach_age2 fem_age fem_age2
predict mypredict_2e
separate mypredict_2e, by(group) veryshortlabel
scatter lahe age if lahe>=225 & lahe<=3.1, xsc(r(24 37)) || line mypredict_2e? age, sort c(L ..)


Many thanks!

Susan Averett
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index