| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: mkspline and reg
Dear All,
I 've a variable age which takes values from 20 to 60,
I have an outcome y and a dummy variable represnting gender
I would like to fit a regresion model using linear splines, including an
interraction effect
I want to test if there are two different slopes before 40 and after 40, and
I am also interested on the intercept , I consider the following approach
1/ First create linear splines
mkspline age1 40 age2 = age
2/Second in order to have intercept at age=40
generate age1a = age1 -40
3/
I fit a regression model
xi: regress y i.sex*age1a i.sex*age2
Could you please comment on this approach?
Thanks a lot
Sami
_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters!
http://www.msn.co.uk/newsletters
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/