Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Amanda Fu <mandy.fu1@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st:weave two matrices row by row |

Date |
Sun, 26 Dec 2010 19:34:28 -0500 |

Hi All, I was wondered if there is any way to weave two matrix row by row. Say, I have matrix A [10,8] and B[10,8]. I want to create a new matrix C looks like as: matrix C [20,8]: --------------------------------- row 1 : row 1 of A row 2: row 1 of B row 3: row 2 of A row 4: row 2 of B .......... row 19: row 10 of A row 20: row 10 of B --------------------------------- Right now I think I could do the following: (1) matrix define C as a 20*8 matrix. (2) use -mkmat- to change A and B into 8 variables respectively A1,A2,..A8,B1,..,B8. (3) Then define each row using the variables from (2). But when actually conducting the above way,I find it requires to be very careful and much more work than I expected. This is why I think it would be better that I ask the expert here to see how an expert will deal with this. Thanks for your time! Sincerely, Amanda * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st:weave two matrices row by row***From:*Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>

- Prev by Date:
**Re: st: why results after expanding data for probability weight is only close to the svy estimation** - Next by Date:
**Re: st:weave two matrices row by row** - Previous by thread:
**st: Happy Holidays** - Next by thread:
**Re: st:weave two matrices row by row** - Index(es):