The name is absent



Stata Technical Bulletin

z[10,1]
z

rl 2

r2 4

r3 3

r4 5

r5 7

гб 6

г7 8

r8 10

r9 1

TlO 9

The variables can be restricted using if and in subcommands as well.

. mkmat x if z<9 in 7/1

. mat 1 x
x[2,l]
x

rl 7

r2 9

Note that mkmat uses the variable name to name the single column in the vector. This feature guarantees that the variable
name will be carried along in any additional matrix calculations. This feature is also useful when vectors are combined in a
general matrix.

. matrix drop _all

. mkmat x у z, matrix(xyzmat)

. matrix dir

xyzmat[10,3]

z [10,1]

у [10,1]

X[10,1]

. matrix list xyzmat

xyzm

at [10

,3]

x

У

z

rl

1

10

2

r2

2

9

4

r3

3

8

3

r4

4

7

ε

r5

ε

6

7

r6

6

ε

6

r7

7

4

8

r8

8

3

10

r9

9

2

1

rlθ

10

1

9

Caveats

The size of any matrix will be restricted by your matsize specification. A variable can have a maximum of 399 observations
under Unix and Intercooled versions of Stata and 40 for regular versions of Stata. Variables containing more data points will
not fit into a single vector.

Finally, if one of the variables has missing values, you will receive an error message and no matrices will be created.

. matrix drop _all

. replace у = . in 5

(1 real change made, 1 to missing)

. mkmat x у z

matrix у would have missing values
r(504);

. matrix dir

This problem can be taken care of by restricting the matrix to nonmissing values.



More intriguing information

1. Co-ordinating European sectoral policies against the background of European Spatial Development
2. The Shepherd Sinfonia
3. An Investigation of transience upon mothers of primary-aged children and their school
4. ADJUSTMENT TO GLOBALISATION: A STUDY OF THE FOOTWEAR INDUSTRY IN EUROPE
5. DEVELOPING COLLABORATION IN RURAL POLICY: LESSONS FROM A STATE RURAL DEVELOPMENT COUNCIL
6. The name is absent
7. The Environmental Kuznets Curve Under a New framework: Role of Social Capital in Water Pollution
8. Kharaj and land proprietary right in the sixteenth century: An example of law and economics
9. Pupils’ attitudes towards art teaching in primary school: an evaluation tool
10. Optimal Vehicle Size, Haulage Length, and the Structure of Transport Costs
11. IMMIGRATION POLICY AND THE AGRICULTURAL LABOR MARKET: THE EFFECT ON JOB DURATION
12. Globalization and the benefits of trade
13. The name is absent
14. The name is absent
15. Human Rights Violations by the Executive: Complicity of the Judiciary in Cameroon?
16. The Effects of Attendance on Academic Performance: Panel Data Evidence for Introductory Microeconomics
17. Behavioural Characteristics and Financial Distress
18. Incorporating global skills within UK higher education of engineers
19. The name is absent
20. Philosophical Perspectives on Trustworthiness and Open-mindedness as Professional Virtues for the Practice of Nursing: Implications for he Moral Education of Nurses