Hi,
I have two variables for which I use the sum command to aggregate the values, so I end-up with two numbers. I want to export these two results so I use the matrix function. I also want to divide these two results together and export the result too. It is here that I have a problem. I do not find how to proceed for the division.
I have the following code :
Code:
.estpost tabstat VARIABLE1 if year == 2008, statistics(sum)
.esttab, wide nonumber cell("sum(label(Total Variable1 in 2008))")
.mat II = e(sum)'
.estpost tabstat VARIABLE2 if year == 2008, statistics(sum)
.esttab, wide nonumber cell("sum(label(Total Variable2 in 2008))")
.mat JJ = e(sum)'
.putexcel set "name.xlsx", replace
.putexcel A3 = "2008"
.putexcel B3 = matrix(II)
.putexcel C3 = matrix(JJ)
Thank you in advance.
David
Related Posts with matrix division
Finding and plotting the trend of the weighted average of variable Code: * Example generated by -dataex-. To install: ssc install dataex clear input double total_asse…
Remove part of a Text in observationHi guys, Below is a sample of my data. I would like to remove the "-TOT RETURN IND" in all the obser…
Creating categorical summary values for cities annually, weighted/unweightedHi guys. New to running Stata for large groups. I'm working with IPUMs American Community Survey Da…
Merge mulitple .csv filesI am using Stata 16.1 MP to merge six .csv files on neonatal, infant, and child mortality. I would l…
xtivreg2 export first and second stage resultsAs the description of xtivreg2 says, it is the wrapper of ivreg2. But the "savefirst“ option of ivre…
Subscribe to:
Post Comments (Atom)
0 Response to matrix division
Post a Comment