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

st: RE: Graphing quadratic relationship

From   Hugh Robinson <>
To   "" <>
Subject   st: RE: Graphing quadratic relationship
Date   Fri, 18 Sep 2009 15:35:20 -0600


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)


-----Original Message-----
From: [] On Behalf Of Stephanie L Kent
Sent: Friday, September 18, 2009 11:36 AM
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!


*   For searches and help try:

*   For searches and help try:

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