Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: mkspline and reg

From   "stata_user stata_user" <>
Subject   st: mkspline and reg
Date   Tue, 31 Oct 2006 22:28:16 +0000

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

I fit a regression model

xi: regress y*age1a*age2

Could you please comment on this approach?

Thanks a lot


Be the first to hear what's new at MSN - sign up to our free newsletters!

* For searches and help try:

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