Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: on-the-fly indicator at cutpoints of continuous variable


From   "Hoffman, George" <ghoffman@mcw.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: on-the-fly indicator at cutpoints of continuous variable
Date   Tue, 20 Nov 2012 15:44:23 +0000

Dear Statalisters:

I'd like to model the following:
		reg Y  c.x1 c.x2 i.x3
where i.x3 takes on a value of 1 if x3<k, otherwise 0

this does not work:
		reg Y c.x1 c.x2 i.(x3<k)

it is simple to create an indicator variable and include that in the regression, but is there a way to include an on-the-fly indicator in commands?

Apparently this is 'easy' in R. is there an equivalent in Stata?
 
Thank you,
George Hoffman

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index