Hello,
I have only recently started using STATA, so forgive me for what will probably be something very straightforward.
Let's say you have 2 matrices:
A =
a
b
c
d
B = (1,2,3)
Now, I would like to merge these two into following matrix:
C =
a 1
a 2
a 3
b 1
b 2
b 3
c 1
c 2
c 3
d 1
d 2
d 3
So a new matrix, with
- the number of rows = number of rows A * number of columns in B
- number of columns = 2
Which commands do I use to go from A to B?
Thank you in advance,
Willem
I have only recently started using STATA, so forgive me for what will probably be something very straightforward.
Let's say you have 2 matrices:
A =
a
b
c
d
B = (1,2,3)
Now, I would like to merge these two into following matrix:
C =
a 1
a 2
a 3
b 1
b 2
b 3
c 1
c 2
c 3
d 1
d 2
d 3
So a new matrix, with
- the number of rows = number of rows A * number of columns in B
- number of columns = 2
Which commands do I use to go from A to B?
Thank you in advance,
Willem
Comment