estpost tabulate Q10
esttab, cells("b pct") tex
esttab, cells("b pct") tex
invalid syntax
in not found
But this code works for some other variables.
label variable q25 "Gender" estpost tabulate q25 esttab, cells("b pct") tex
label list q10 tabulate q10, missing generate Q10 = (q10==1 | q10==2) replace Q10=2 if missing(q10) label define Q10 0 "Correct Answer" /// 1 "Wrong Answer" /// 2 "Don't Know" label values Q10 Q10 estpost tabulate Q10 esttab, cells("b pct") tex
invalid syntax in not found
* Example generated by -dataex-. To install: ssc install dataex clear input str17 responseid byte(q10 q25) "R_07olc7RfV4QoiOJ" 3 1 "R_0AHixEJ5QkFlXah" 3 2 "R_0DtFbTIGolHL22R" 3 1 "R_0JJgNpi2HthEfK1" 3 1 "R_0OIugt5thDAck13" 3 1 "R_10MoMzFBSZhVJin" 3 2 "R_10N32NeGqhSOVjp" 3 1 "R_10pwKkqQqLwRVQW" 2 1 "R_10q74QS1XVOlhOy" 3 1 "R_10qPgsB4h3Ht4Ec" 3 1 "R_115AIunMB6ZKPPR" 3 1 "R_11WU5Fi2yhVFzsC" 3 1 "R_11XTWBHdJ7eDL5M" 3 1 "R_11d5bz5K858gZXF" 3 1 "R_11hf3CdzklbcJd7" 3 1 "R_124udSczHFF6dL8" 2 1 "R_12GdaU1RKdEofOd" 3 1 "R_12sadEIKYiXQ00R" 3 1 "R_12tjCsMMfQyy6zY" 3 1 "R_12yFLbkzIgFtHt6" 3 2 end label values q10 q10 label def q10 2 "Less than $102", modify label def q10 3 "More than $102", modify label values q25 q25 label def q25 1 "Female", modify label def q25 2 "Male", modify
. * Example generated by -dataex-. To install: ssc install dataex . . clear . . input str17 responseid byte(q10 q25) responseid q10 q25 1. . "R_07olc7RfV4QoiOJ" 3 1 2. . "R_0AHixEJ5QkFlXah" 3 2 3. . "R_0DtFbTIGolHL22R" 3 1 4. . "R_0JJgNpi2HthEfK1" 3 1 5. . "R_0OIugt5thDAck13" 3 1 6. . "R_10MoMzFBSZhVJin" 3 2 7. . "R_10N32NeGqhSOVjp" 3 1 8. . "R_10pwKkqQqLwRVQW" 2 1 9. . "R_10q74QS1XVOlhOy" 3 1 10. . "R_10qPgsB4h3Ht4Ec" 3 1 11. . "R_115AIunMB6ZKPPR" 3 1 12. . "R_11WU5Fi2yhVFzsC" 3 1 13. . "R_11XTWBHdJ7eDL5M" 3 1 14. . "R_11d5bz5K858gZXF" 3 1 15. . "R_11hf3CdzklbcJd7" 3 1 16. . "R_124udSczHFF6dL8" 2 1 17. . "R_12GdaU1RKdEofOd" 3 1 18. . "R_12sadEIKYiXQ00R" 3 1 19. . "R_12tjCsMMfQyy6zY" 3 1 20. . "R_12yFLbkzIgFtHt6" 3 2 21. . end . . label values q10 q10 . . label def q10 2 "Less than $102", modify . . label def q10 3 "More than $102", modify . . label values q25 q25 . . label def q25 1 "Female", modify . . label def q25 2 "Male", modify . . . . label list q10 q10: 2 Less than $102 3 More than $102 . . tabulate q10, missing q10 | Freq. Percent Cum. ---------------+----------------------------------- Less than $102 | 2 10.00 10.00 More than $102 | 18 90.00 100.00 ---------------+----------------------------------- Total | 20 100.00 . . generate Q10 = (q10==1 | q10==2) . . replace Q10=2 if missing(q10) (0 real changes made) . . label define Q10 0 "Correct Answer" 1 "Wrong Answer" 2 "Don't Know" . . label values Q10 Q10 . . estpost tabulate Q10 Q10 | e(b) e(pct) e(cumpct) -------------+--------------------------------- Correct_An~r | 18 90 90 Wrong_Answer | 2 10 100 -------------+--------------------------------- Total | 20 100 . . esttab, cells("b pct") tex { \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \begin{tabular}{l*{1}{cc}} \hline\hline &\multicolumn{2}{c}{(1)} \\ &\multicolumn{2}{c}{Q10} \\ & b& pct\\ \hline Correct Answer& 18& 90\\ Wrong Answer& 2& 10\\ Total & 20& 100\\ \hline \(N\) & 20& \\ \hline\hline \end{tabular} }
Comment