Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all articles
Browse latest Browse all 1125

Re: Retaining an Excel cell’s format when using putexcel

$
0
0

There currently isn't an easy way to export a twoway tabulation table. I will try and write a program to do this soon. You can get the row frequencies using the following code.



. tabulate for rep, matcell(a)

| Repair Record 1978
Car type | 1 2 3 4 5 | Total
-----------+-------------------------------------------------------+----------
Domestic | 2 8 27 9 2 | 48
Foreign | 0 0 3 9 9 | 21
-----------+-------------------------------------------------------+----------
Total | 2 8 30 18 11 | 69

. matrix list a

a[2,5]
c1 c2 c3 c4 c5
r1 2 8 27 9 2
r2 0 0 3 9 9

. putexcel B2=matrix(a) using test.xlsx
file test.xlsx saved


Viewing all articles
Browse latest Browse all 1125

Trending Articles