On Sat, 2009-04-18 at 08:55 +0200, Serguei Kaniovski wrote: > > Dear All! > > my data is on pairs of countries, i and j, e.g.: > > y,i,j > 1,AUT,BEL > 2,AUT,GER > 3,BEL,GER > > I would like to create a dummy (indicator) variable for use in regression > (using factor?), such that it takes the value of 1 if the country is in the > pair (i.e. EITHER an i-country OR an j-country). > > Thank you for your help, > Serguei
Hi Serguei, If I understand your doubt, the solution is something like this for pair i-country is AUT or j-country is BEL output ~ I(i-country=="AUT"|j-country=="BEL") -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.