The name is absent



Stata Technical Bulletin


STB-20


. disp_s
S_l:

7

S_2:

1

S_3:

1994

S_4:

Sat.

Note that today did not mistakenly put “Sat.” in S_4. today happens to use only S_l-S_3, leaving S_4 from the lastday
command.

ip6 Storing variables in vectors and matrices

Ken Heinecke, Federal Reserve Bank of Kansas City, FAX 816-881-2199

mkmat takes the variables listed in varlist and stores them in column vectors; that is, N × 1 matrices where N = _N, the
number of observations in the data set. The syntax of mkmat is

mkmat varlist [if exp] [in range] [, matrix (mataame) ]

If the matrix() option is specified, the vectors are also combined in a matrix.

Discussion

Although it is possible to load variables into a matrix using the matrix accum command, programmers may find it more
convenient to work with the variables in their data sets as vectors instead of as cross products. mkmat allows the user a simple
way to load specific variables into matrices in Stata’s memory.

Example

. describe

Contains data from test.dta

Obs:    10 (max=  2562)

Vars:     3 (max=   200)

Width:    12 (max=   402)

1. x              float  7,9.0g

2. y             float  7,9.0g

3. z              float  7,9.0g

Sorted by:
. list

x

У

z

1.

1

10

2

2.

2

9

4

3.

3

8

3

4.

4

7

Б

Б.

Б

6

7

6.

6

Б

6

7.

7

4

8

8.

8

3

10

9.

9

2

1

10.

10

1

9

. mkmat y z
. matrix list y
y[10,l]

У
rl 10
r2 9
r3 8
r4 7
гБ 6
гб Б
г7 4
г8 3
г9 2
rlθ 1

. matrix list z



More intriguing information

1. The name is absent
2. From Communication to Presence: Cognition, Emotions and Culture towards the Ultimate Communicative Experience. Festschrift in honor of Luigi Anolli
3. Aktive Klienten - Aktive Politik? (Wie) Läßt sich dauerhafte Unabhängigkeit von Sozialhilfe erreichen? Ein Literaturbericht
4. Une Gestion des ressources humaines à l'interface des organisations : vers une GRH territoriale ?
5. Human Resource Management Practices and Wage Dispersion in U.S. Establishments
6. Linkages between research, scholarship and teaching in universities in China
7. Perceived Market Risks and Strategic Risk Management of Food Manufactures: Empirical Results from the German Brewing Industry
8. Nietzsche, immortality, singularity and eternal recurrence1
9. Unemployment in an Interdependent World
10. The magnitude and Cyclical Behavior of Financial Market Frictions
11. THE ECONOMICS OF COMPETITION IN HEALTH INSURANCE- THE IRISH CASE STUDY.
12. The name is absent
13. Dementia Care Mapping and Patient-Centred Care in Australian residential homes: An economic evaluation of the CARE Study, CHERE Working Paper 2008/4
14. Telecommuting and environmental policy - lessons from the Ecommute program
15. The name is absent
16. Initial Public Offerings and Venture Capital in Germany
17. BUSINESS SUCCESS: WHAT FACTORS REALLY MATTER?
18. Improving the Impact of Market Reform on Agricultural Productivity in Africa: How Institutional Design Makes a Difference
19. How we might be able to understand the brain
20. Regional Intergration and Migration: An Economic Geography Model with Hetergenous Labour Force