Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: How can i extract Matrices from data set


From   "Nadeem Shafique" <[email protected]>
To   [email protected]
Subject   st: How can i extract Matrices from data set
Date   Fri, 17 Aug 2007 16:27:47 +0500

Respected All,

I have entered data into stata data editor and i wish to extract
matrices from the data set and want to write STATA Mata function for
further maipulations. For example consider the following data
m	v1	v2 	v3	gr
23	1	2	3	1
11	3	1	2	1
23	2	2	1	1
25	1	2	3	2
23	2	1	2	2
28	3	3	1	2
2	1	1	2	3
3	1	3	1	3
1	2	1	2	3
.	.	.	.	4
.	.	.	.	4
.	.	.	.	4

i wish to extract
m1=(23,11,23) m2=(25,23,28) and m3=(2,3,1)
var1=(1,2,3/3,1,2/2,2,1) var2=(1,2,3/2,1,2) and v3=(1,1,2/1,3,1/2,1,2)
Can we make a general program that can extract matrices and vectors
based on the grouping variable entered in stata data editor.

Further if a code is repeated 4 times in grouping variable will
implies that there will be four enteries in "m" vectors and "var"
matrices will be of order 4 X 4 and so on.

Looking for the solution to this problem. If anyone can help me I will
be highly thankful.

Regards,

Nadeem Shafique Butt
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index