Statalist The Stata Listserver


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

st: linear spline and interaction


From   "stata_user stata_user" <[email protected]>
To   [email protected]
Subject   st: linear spline and interaction
Date   Fri, 22 Sep 2006 17:42:47 +0100

Hi,
I have used the follwoing code to test the associaton between z and y

mkspline z1 a z2 = z,marginal
reg y z1 z2

predict p
label variable p "L_Spline_a"

The first line creates a linear spline at the value 'a' of the variable z and then I use the result in the regression ( line 2)

My question , how I can include an interaction term with a dummy variable d? the code

xi: reg y i.d*z1 i.d*z2

does not give me the expected result

Thanks a lot for any comments

Sami

_________________________________________________________________
Windows Live� Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb

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




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