Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Dummies representing combinations of dummies, & conserving matsize


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: Dummies representing combinations of dummies, & conserving matsize
Date   Mon, 23 Aug 2004 02:40:23 +0100 (BST)

CM wrote:

[...]

> For example, let the 14 dummies be represented by
> x1...x14.  Then I want another variable x1x2 which
> equates to 1 if x1 and x2 both equal 1; 0 otherwise.
> And then I would need this done for all 14c2 ("14
> choose 2") combinations.  I suppose I could do it
> manually, but there's gotta be a simpler way.

Simple: either -generate- an interaction term for x1x2 or use the -xi-
command; for example:

. xi: reg y x1 x2 x3 ... x14 x1*x2

Since x1 and x2 are dummy variables, the interaction term can _only_ take
the value of 1 when x1*x2 = 1 for any one case.

> Probably more importantly, is it possible to add these
> variables in a regression without eating into the 800
> max matsize that I get to use in Stata Intercooled?

Well, the solution offered merely calls for the addition of one term. I
guess it depends upon just how many degress of freedom your model consumes
(which you fail to mention), as well how large your dataset is. -set
matsize 800-, run the model and find out!

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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