Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: creat the matrix based on the condition


From   wanhaiyou <[email protected]>
To   [email protected]
Subject   st: creat the matrix based on the condition
Date   Fri, 11 Apr 2014 15:41:11 +0800 (GMT+08:00)

Dear Statalisters,

I have three variables in the dataset as following

clear
input v1  v2  v3
1 3 5
3 4 6
1 2 .
end


I want to creat the linkage matrix based on these variables. 
The result is as following


1 0 1 0 1 0
0 0 1 1 0 1
1 1 0 0 0 0

The max number is 6, so the dimension of matrix is 3*6


Thanks for all suggestions.

Bests,
wanhaiyou
Hunan University
--
Bests,

wanhaiyou

Hunan University
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index