September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
13
Task/Combinations/Stata/combinations-1.stata
Normal file
13
Task/Combinations/Stata/combinations-1.stata
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
program combin
|
||||
tempfile cp
|
||||
tempvar k
|
||||
gen `k'=1
|
||||
quietly save "`cp'"
|
||||
rename `1' `1'1
|
||||
forv i=2/`2' {
|
||||
joinby `k' using "`cp'"
|
||||
rename `1' `1'`i'
|
||||
quietly drop if `1'`i'<=`1'`=`i'-1'
|
||||
}
|
||||
sort `1'*
|
||||
end
|
||||
20
Task/Combinations/Stata/combinations-2.stata
Normal file
20
Task/Combinations/Stata/combinations-2.stata
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
. set obs 5
|
||||
. gen a=_n
|
||||
. combin a 3
|
||||
. list
|
||||
|
||||
+--------------+
|
||||
| a1 a2 a3 |
|
||||
|--------------|
|
||||
1. | 1 2 3 |
|
||||
2. | 1 2 4 |
|
||||
3. | 1 2 5 |
|
||||
4. | 1 3 4 |
|
||||
5. | 1 3 5 |
|
||||
|--------------|
|
||||
6. | 1 4 5 |
|
||||
7. | 2 3 4 |
|
||||
8. | 2 3 5 |
|
||||
9. | 2 4 5 |
|
||||
10. | 3 4 5 |
|
||||
+--------------+
|
||||
Loading…
Add table
Add a link
Reference in a new issue