Hi,
Is there any function in Stata, in dtable, that allows calculating row percentages of weighted N?
For example: var1: female 65.1%, male 34.9%, total 100%.
Is there any function in Stata, in dtable, that allows calculating row percentages of weighted N?
For example: var1: female 65.1%, male 34.9%, total 100%.
Code:
input byte(Sex edu_lvl var1 var2) 1 2 1 1 2 1 1 0 1 3 0 1 2 4 0 0 2 1 0 1 2 2 . 0 1 4 . 1 1 3 . 1 1 2 1 1 2 2 0 0 2 1 1 0 2 3 . 1 1 4 1 0 1 2 . 1 2 1 . 1 2 4 1 1 end dtable, by(Sex) /// cont(var1 var2, stat(total mean )) /// nosample /// nformat(%2.0f total) /// name(a1) collect composite define column1 = total collect composite define column2 = mean collect label levels result column1 "N" column2 "Row % of weighted N", modify collect layout (var) (Sex#result)
Comment