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?
Aggregating units in a control groupI am trying to draw a common pre-trend graph for a diff-in-diff design. My treatment group is made o…
linktest interpretationHi all, Could you please help in interpreting the below result of the link test (attached). Also, I…
Using _n to create a sequence variable using "if"Hi I have a dataset consisting of dispensed medication items - there are multiple records for each …
Create a scatter plot with quartiles (visualisation)Hi folks. I hope this isn't a silly question, but still learning how to work with Stata. I am tryin…
Transfer variable labels from excel list into stata datasetDear colleagues. For various data-release/red-tape reasons, I have been given a Stata dataset (wide…
Subscribe to:
Post Comments (Atom)
0 Response to how can I create all pairwise combination of many variables?
Post a Comment