Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: on-the-fly indicator at cutpoints of continuous variable
From
"Hoffman, George" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: on-the-fly indicator at cutpoints of continuous variable
Date
Tue, 20 Nov 2012 16:50:33 +0000
Ah yes, nl. I have done that. I need to write a wrapper to make it easier. And that linear regression was just an example; a more generic approach would maybe go on the Stata 13 wish list!
Thanks again,
George
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Tuesday, November 20, 2012 9:57 AM
To: [email protected]
Subject: Re: st: on-the-fly indicator at cutpoints of continuous variable
You can do something close to this in -nl-, but you would need to do it differently.
Nick
On Tue, Nov 20, 2012 at 3:44 PM, Hoffman, George <[email protected]> wrote:
> 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?
*
* 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/
*
* 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/