Hello, I need your help on matrix and Excel in Stata.
I have a matrix m and would like to stack its columns, making it a column vector and then output it to excel. How may I do it? I got an error message but do not know how to proceed. Your help is highly appreciated.
mata
m1 = colshape(st_matrix("m"), 1)
end
getmata m1
export excel using test.xlsx, replace
putexcel set results211117.xlsx, sheet(a, replace) modify
This is my matrix m (The column names are 0, 1, 2,......8)
. matrix list m
m[10,9]
0 1 2 3 4 5
bxxxxxxx .52266514 .58911588 .83552992 .56056369 .8199342 .7093596
pxxx 3.732e-17 4.505e-07 1.945e-11 8.223e-08 .00003257 2.086e-37
pyyy 7.988e-15 .00036929 .16934102 .00002184 .35435738 3.141e-09
impoxxxxxxxx .69417235 .97630077 1.0495413 .75846318 1.0857929 1.010838
pxxx .00005891 3.303e-10 1.661e-06 .00010401 5.796e-06 1.058e-06
pyyy .07332287 .87432756 .81737478 .21084674 .71513743 .95735001
impoaaaaaaaa .35782885 .18078305 .57813267 .31135534 .46354425 .39562263
pxxx .11893438 .47588783 .00996288 .25309767 .14475445 .06826691
pyyy .00535643 .00136421 .05931852 .01186249 .09168185 .00553321
pxxxxxxxxxx .38558787 .02224672 .18134953 .28309624 .12058027 .13453773
.........
Related Posts with convert a matrix to a column vector, and then output it to Excel file
 Complete Time SeriesHello everyone,
I'm wondering how to 'insert' empty values in my panel data. My data looks as follo… Complete Time SeriesHello everyone,
I'm wondering how to 'insert' empty values in my panel data. My data looks as follo…
 Points of mass in running variable - RDDear all,
I am struggling with my RD specification. I am using the rdrobust package from SSC and wh… Points of mass in running variable - RDDear all,
I am struggling with my RD specification. I am using the rdrobust package from SSC and wh…
 ppmlhdfe with disaggregated data: exporter,importer,sector fiexed effectsHello, I am running a gravity model.
My data looks something like this
Code:
use "http://fmwww.bc.… ppmlhdfe with disaggregated data: exporter,importer,sector fiexed effectsHello, I am running a gravity model.
My data looks something like this
Code:
use "http://fmwww.bc.…
 Interactions between sex and country of birth : do I also have to include interactions between control variables and sex?Dear STATA community,
This is my first post and I hope that you can help me with my problem.
In a n… Interactions between sex and country of birth : do I also have to include interactions between control variables and sex?Dear STATA community,
This is my first post and I hope that you can help me with my problem.
In a n…
 Fine and Gray with CensoringWhen I produce cumulative incidence curves (CIC) for the Fine and Gray model using stcrreg and stcur… Fine and Gray with CensoringWhen I produce cumulative incidence curves (CIC) for the Fine and Gray model using stcrreg and stcur…
Subscribe to:
Post Comments (Atom)
0 Response to convert a matrix to a column vector, and then output it to Excel file
Post a Comment