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


From   "Delahanty, Ryan" <ryan.delahanty@vanderbilt.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: new dummy variable based on two categorical variables
Date   Sat, 16 Oct 2010 18:22:14 -0500

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

to get ORs.

Thanks again,

Ryan

*
*   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