Statalist


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

st: RE: Graphing quadratic relationship


From   Hugh Robinson <hugh.robinson@cfc.umt.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Graphing quadratic relationship
Date   Fri, 18 Sep 2009 15:35:20 -0600

Stephanie,

The cancer.dta data doesn't fit a quadratic very well, but do you mean something like this?  Coding is stata 9.2.

sysuse cancer
gen age2= age* age
logit died  age age2
predict yhatdied
twoway (histogram age if (died == 1), percent yaxis(2) fcolor(sand) lcolor(none) legend(label(1 "Died")))(histogram age if (died==0), percent yaxis(2) fcolor(none) lcolor(black) legend(label(2 "Alive")))(connected yhatdied age, sort), xtitle(age) ytitle(probability death) legend(on) scheme(s2color) name(test)

HR


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Stephanie L Kent
Sent: Friday, September 18, 2009 11:36 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: Graphing quadratic relationship

Dear users,

I would like to graph a relationship between a quadratic independent
variable and my dependent variable to see how y varies acccording to x and
x^2.  It's a logistic regression so my DV is 0-1 and I need to show how
both the 0's and 1's vary according to x and x^2.  Any advice on how to get
started is much appreciated!

Sincerely,
Stephanie

*
*   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/


*
*   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   |   What's new   |   Site index