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?
Decomposing String Variable While Retaining Adjacent Column ValueI am trying to convert some data retaining the information from a string variable and replacing the …
LRTEST poisson vs negative binomial loopHello everyone, im testing over dispersion in a count variable. I'm using Hilbe's book "Negative bin…
Passing arguments from Stata to Python (or Stata equivalent to "itertools" )Dear Readers I wonder if there is an equivalent in Stata to "itertools" in python? For a large numb…
Graphing in a nested loopHi. I am trying to graph across two variables using a nested loop. My first variable refers to disea…
Choosing a model for unbalanced panel data with some time invariant independent variablesDear all, I have a question that I have been struggling with for some time now even after reading m…
Subscribe to:
Post Comments (Atom)
0 Response to how can I create all pairwise combination of many variables?
Post a Comment