Stata 15 help for mf_rows

[M-5] rows() -- Number of rows and number of columns


real scalar rows(transmorphic matrix P)

real scalar cols(transmorphic matrix P)

real scalar length(transmorphic matrix P)


rows(P) returns the number of rows of P.

cols(P) returns the number of columns of P.

length(P) returns rows(P)*cols(P).


length(P) is typically used with vectors, as in

for (i=1; i<=length(x); i++) { ... x[i] ... }


rows(P), cols(P), length(P): P: r x c result: 1 x 1


rows(P), cols(P), and length(P) return a result that is greater than or equal to zero.

Source code

Functions are built in.

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