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 on April 23, and its replacement, statalist.org is already up and running.


[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 <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu
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:  Richard.A.Williams.5@ND.Edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index