Hi
Apologies if this is basic, I'm new to using mata and nothing from previous questions seems to work.
I needed to switch into mata to use the eigensystem command and am now trying to return a single column matrix with 255 rows back into stata.
I brought my data into mata with " w_tilde_mat = st_matrix("w_tilde") "
I used " eigensystem(w_tilde_mat, v_vect_tilde=.,w_val_tilde=.) " to get a 255x255 matrix of 255, 255 row eigenvectors.
I then used " col_ec = w_vect_tilde[.,2] " to extract the second eigenvector which is what I need.
I then want to put col_ec back into stata, and am trying to use st_matrix again, and have tried various things but nothing works.
For example st_matrix("col_ec", col_st_ec) returns an error code with col_st_ec not being found (3499) but this is what I want the matrix created back in stata to be called.
Thanks in advance.
Apologies if this is basic, I'm new to using mata and nothing from previous questions seems to work.
I needed to switch into mata to use the eigensystem command and am now trying to return a single column matrix with 255 rows back into stata.
I brought my data into mata with " w_tilde_mat = st_matrix("w_tilde") "
I used " eigensystem(w_tilde_mat, v_vect_tilde=.,w_val_tilde=.) " to get a 255x255 matrix of 255, 255 row eigenvectors.
I then used " col_ec = w_vect_tilde[.,2] " to extract the second eigenvector which is what I need.
I then want to put col_ec back into stata, and am trying to use st_matrix again, and have tried various things but nothing works.
For example st_matrix("col_ec", col_st_ec) returns an error code with col_st_ec not being found (3499) but this is what I want the matrix created back in stata to be called.
Thanks in advance.
Comment