Bookmark and Share

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: new dummy variable based on two categorical variables


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: new dummy variable based on two categorical variables
Date   Sat, 16 Oct 2010 19:34:42 -0500

At 06:22 PM 10/16/2010, Delahanty, Ryan wrote:
I had such awesome help from you stats ballers on this list with the last Q, I thought I'd take a spin again.

Please correct my language in this email if I'm off in proper terms.

Say I have two variables with i and j different levels, like this: var1=1,2,3,4; var2=1,2,3
And I want to get ORs on all 12 categories: 1,1; 1,2; 1,3; 2,1... 4,3.

What is the most efficient way to make a new categorical variable that contains all i x j combinations?

I know once complete, I want to do logistic this way:
xi, prefix(): logistic affec i.newvar

If you have Stata 11, you want

logistic affect var1#var2

Even then, you don't get all i x j combos; something has to serve as the reference.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index