Hello ,
I have a couple of questions for the Stata experts in this forum. I apologize if you deem them to be basic questions. I use Stata 13 .
QUESTION-1:
==========
After successfully running a survey estimation command (to get counts) (ONE WAY TABULATE COMMAND), how can round contents of a matrix before exporting them to excel using putexcel (new command in Stata 13).
After searching the internet, I found a trunc function, but I am not able to use it.
My commands so far are as follows
My goal is to round the contents of matrix before I use the putexcel command.
Can anyone please let me know.Thank you for your time .
QUESTIONS-2:
===========
After running a survey estimation command (to get counts) (TWO WAY TABULATE COMMAND), how can I export the first column of the resulting 4 x 4 table to excel using the putexcel command.
If I use the matrix e(b), it lists all the cells but not specifically cells in the first column
My code is as follows
I am interested in exporting only p11, p21 and p31 to excel, and I am not sure how can I do it
Can anyone please let me know.Thank you for your time .
thank you again,
Sincerely,
Lucas
I have a couple of questions for the Stata experts in this forum. I apologize if you deem them to be basic questions. I use Stata 13 .
QUESTION-1:
==========
After successfully running a survey estimation command (to get counts) (ONE WAY TABULATE COMMAND), how can round contents of a matrix before exporting them to excel using putexcel (new command in Stata 13).
After searching the internet, I found a trunc function, but I am not able to use it.
My commands so far are as follows
Code:
svy, subpop(MAIN): tabulate VAR1 , count mat p = e(b)'* e(N_subpop) mat q=e(Row)' putexcel A1=("NAME") B1=("COUNT") B2=matrix(p) A2=matrix(q, rownames) using results, modify
Can anyone please let me know.Thank you for your time .
QUESTIONS-2:
===========
After running a survey estimation command (to get counts) (TWO WAY TABULATE COMMAND), how can I export the first column of the resulting 4 x 4 table to excel using the putexcel command.
If I use the matrix e(b), it lists all the cells but not specifically cells in the first column
My code is as follows
Code:
webuse nhanes2b, clear svy: tabulate race sex , per **********RESULTS FROM THE COMMAND****************************** Number of strata = 31 Number of obs = 10351 Number of PSUs = 62 Population size = 117157513 Design df = 31 1=white, 2=black, 1=male, 2=female 3=other Male Female Total White 42.25 45.66 87.92 Black 4.35 5.201 9.551 Other 1.33 1.204 2.534 Total 47.94 52.06 100 ************************************************************************************* mat list e(b) e(b)[1,6] p11 p12 p21 p22 p31 p32 y1 .42254909 .45660537 .04349737 .05200855 .01330376 .01203586
Can anyone please let me know.Thank you for your time .
thank you again,
Sincerely,
Lucas
Comment