Hello, I am new to Mata and how do you count the number of rows and columns of a non-null values in matrix. Of course, We can exchange rows and columns, so at least columns or rows non-empty number can be calculated.lots of command can get the results,but i should do this by matrix or mata. Thank you very much for example T=(1,1,4, . \ 2,2,5,12 \ 3,3,6,13 \ 4, . ,7,11 \ 5,5,8,. \ 6,6,9,18 \ 7,7,., 20 \ 8,8, . ,21 \ 9,9,12,23 \ 10,10,13, .) the wanted matrix should be as follow: wanted = (10,9,8,7) the number of the wanted matrix represent the number of non-null values in each column.
Related Posts with How to count the number of rows and columns of a non-null values in matrix?
Identify variables with identical prefixesDear Statalisters, say I have the following variable names: Code: child_id_kp child_id_ka child_id…
How to remove rows containing ratees not in the rater list in a team?I would like to remove the rows containing ratees not in the rater list. For example, in the dataset…
Stochastic frontier analysis-flexible Fourier(augmented translog) cost functionHello Statalist, I am trying to do a flexible fourier analysis on stata using truncated normal dist…
Exporting instrument test results from ivreg2Following is my ivreg2 code Code: asdoc ivreg2 pro l.le l.a (rec interaction= pay ca bor),nest re…
How to replace missing values for certain rows in STATAI'm wondering how to replace missing values in STATA for certain rows only (as noted above). I have…
Subscribe to:
Post Comments (Atom)
0 Response to How to count the number of rows and columns of a non-null values in matrix?
Post a Comment