Dear all,
I have this data
code:
clear
input str6(var1 var2 var3 var4 var5)
"A01B1" "A01C05" "A01C11" "A01M21" "E02F3"
"A01H11" "B25D1" "E23P15" "" ""
end
and i want to create all possible pairwises combinations in order to get this:
code:
clear
input str6 (var1 var2 var3 var4 var5) str200 combine
"A01B1" "A01C05" "A01C11" "A01M21" "E02F3" "A01B1.A01C5;A01B1.A01C11;A01B1.A01M21; A01B1.E02F3;A01C05.A01C11;A01C05.A01M21;A01C05.E02 F3;A01C11.A01M21;A01C05.E02F3;A01C11.A01M21;A01C11 .E02F3;A01M21.E02F3"
"A01H11" "B25D1" "E23P15" "" "" "A01H11.B25D1;A01H11.E23P15;B25D1.E23P15"
end
Thank you in advance for the suggestions.
Related Posts with how can I create all pairwise combination of many variables?
egen newvar=group(varlist) does not generate a variable based on all unique combinations in the varlistI have been using egen newvar=group(varname1 varname2) for a while, with the understanding that newv…
Select US listed companies only (Compustat)Hi all, I would like to select only the firms (gvkey) in my dataset which are listed in the US (US …
Missing deciles with Portfolio SortHi, I have the following problem. When using the fastxtile command to sort my values into deciles, …
Looping through multiple strings for comparisonDear all, I would like to compare educational institutions of two workers and code a binary variabl…
zero-inflated (poisson) mediatorsHi, I am running a mediation which the mediator is zero-inflated poisson and the outcome variable is…
Subscribe to:
Post Comments (Atom)
0 Response to how can I create all pairwise combination of many variables?
Post a Comment