Hi,
I wrote a program to export the results of my survey weighted cross tabulations into an excel file using esttab, matselrc, and putexcel (Stata 15.1). I used this program numerous times without problems, but now I get no results after the esttab command. It appears the esttab command is not storing the estimates in memory. Has there been a change in the esttab command? How can I work around this issue?
I get this Stata ouput:
I wrote a program to export the results of my survey weighted cross tabulations into an excel file using esttab, matselrc, and putexcel (Stata 15.1). I used this program numerous times without problems, but now I get no results after the esttab command. It appears the esttab command is not storing the estimates in memory. Has there been a change in the esttab command? How can I work around this issue?
Code:
global brfss obese foreach var in $brfss { capture noisily svy, subpop(if year==2010): tab mracealpha `var', row ci percent obs format (%7.1f) esttab ., cells("obs b(fmt(1)) lb(fmt(1)) ub(fmt(1)) se(fmt(1))")unstack noobs matlist r(coefs) matrix results=r(coefs) matlist results *return list matselrc results r1 , r(10/17) c(1/5) matlist r1 putexcel set draftresults.xlsx, sheet(ModelSum`var'1) modify putexcel set draftresults.xlsx, sheet(ModelSumsmoker1) modify putexcel B2=matrix(r1) }
I get this Stata ouput:
HTML Code:
(running tabulate on estimation sample) Number of strata = 18 Number of obs = 18,559 Number of PSUs = 18,559 Population size = 8,238,102 Subpop. no. obs = 18,559 Subpop. size = 8,238,102 Design df = 18,541 ------------------------------------------------- mracealph | obese, BMI>=30 a | No Yes Total ----------+-------------------------------------- AIAN | 53.5 46.5 100.0 | [42.3,64.3] [35.7,57.7] | 85.0 61.0 146.0 | Asian | 92.3 7.7 100.0 | [90.3,93.9] [6.1,9.7] | 1195.0 94.0 1289.0 | Black | 66.1 33.9 100.0 | [61.1,70.8] [29.2,38.9] | 429.0 212.0 641.0 | Multiple | 76.3 23.7 100.0 | [70.9,80.9] [19.1,29.1] | 294.0 111.0 405.0 | NHPI | 70.9 29.1 100.0 | [58.5,80.8] [19.2,41.5] | 64.0 33.0 97.0 | White | 76.7 23.3 100.0 | [75.7,77.7] [22.3,24.3] | 12401.0 3580.0 15981.0 | Total | 78.2 21.8 100.0 | [77.3,79.1] [20.9,22.7] | 14468.0 4091.0 18559.0 ------------------------------------------------- Key: row percentage [95% confidence interval for row percentage] number of observations Pearson: Uncorrected chi2(5) = 528.8654 Design-based F(4.92, 91168.18)= 37.7259 P = 0.0000 Note: 23 strata omitted because they contain no subpopulation members. ------------ ------------ ------------ . end of do-file . matlist r(coefs) | active | obs b lb ub se -------------+------------------------------------------------------- p11 | .y .53501 .y .y .0571526 p12 | .y .46499 .y .y .0571526 p21 | .y .9228453 .y .y .009021 p22 | .y .0771547 .y .y .009021 p31 | .y .6612203 .y .y .02494 p32 | .y .3387797 .y .y .02494 p41 | .y .7629963 .y .y .0255429 p42 | .y .2370037 .y .y .0255429 p51 | .y .7087532 .y .y .0576917 p52 | .y .2912468 .y .y .0576917 p61 | .y .7671453 .y .y .0051494 p62 | .y .2328547 .y .y .0051494
Comment