Hi,
I need to create a table similar to that in the below picture and export it to a TEX file (for use in LaTeX).

It is obviously similar to a ttest, but I cannot use ttest, as I need to cluster standard errors by the District1 variable and weigh them by "withinwt".
I get the results using
Is there a way to get Stata to save the means and produce the above table in a TEX file using the regression output? Or do you have other suggestions for how to do it?
My data looks as follows
I need to create a table similar to that in the below picture and export it to a TEX file (for use in LaTeX).
It is obviously similar to a ttest, but I cannot use ttest, as I need to cluster standard errors by the District1 variable and weigh them by "withinwt".
I get the results using
Code:
reg elections Quota [aweight=withinwt], vce(cluster District1)
My data looks as follows
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float elections byte Quota float withinwt str14 District1 4 0 1.1162767 "D0309" 4 0 1.1162767 "D0309" 4 0 1.1162767 "D0309" 4 0 1.1162767 "D0309" 1 0 1.1162767 "D0308" 1 0 1.1162767 "D0309" 4 0 1.1162767 "D0308" 3 0 1.1162767 "D0308" 1 1 .9732189 "B0706" 4 1 .9732189 "B0706" 4 1 .9732189 "B0706" 4 1 .9732189 "B0706" 3 1 .9732189 "B0706" 3 1 .9732189 "B0706" 1 1 .9732189 "B0706" 4 1 .9732189 "B0706" 4 0 .6487038 "A0308" 2 0 .6487038 "A0308" 4 0 .6487038 "A0308" 4 0 .6487038 "A0308" 2 0 .6487038 "A0308" 4 0 .6487038 "A0308" 4 0 .6487038 "A0308" 2 0 .6487038 "A0308" 1 0 .9725117 "E1208" 1 0 .9725117 "E1208" 4 0 .9725117 "E1208" 3 0 .9725117 "E1208" 2 0 .9725117 "E1208" 3 0 .9725117 "E1209" 3 0 .9725117 "E1209" 2 0 .9725117 "E1209" 3 0 .9393414 "C1009" 4 0 .9393414 "C1009" 3 0 .9393414 "C1010" 4 0 .9393414 "C1010" 2 0 .9393414 "C1010" 4 0 .9393414 "C1010" 3 1 .6602322 "J1106" . 1 .6602322 "J1106" 1 1 .6602322 "J1106" 4 1 .6602322 "J1106" 4 1 .6602322 "J1106" 1 1 .6602322 "J1106" 2 1 .6602322 "J1106" 3 1 .6602322 "J1106" 1 1 1.0847074 "C1505" 3 1 1.0847074 "C1505" 4 1 1.0847074 "C1505" 4 1 1.0847074 "C1505" 4 1 1.0847074 "C1505" 4 1 1.0847074 "C1505" 1 1 1.0847074 "C1505" 2 1 1.0847074 "C1505" 3 0 .895265 "G0609" 3 0 .895265 "G0609" 1 0 1.0417415 "E0206" 1 0 1.0417415 "E0206" 1 0 1.0417415 "E0206" 4 0 1.0417415 "E0206" 3 0 1.0417415 "E0206" 2 0 1.0417415 "E0206" 1 0 1.0417415 "E0206" 3 0 1.0417415 "E0206" 2 1 1.1030433 "F0406" 4 1 1.1030433 "F0406" 1 1 1.1030433 "F0406" 2 1 1.1030433 "F0406" 1 1 1.1030433 "F0406" 4 1 1.1030433 "F0406" 4 1 1.1030433 "F0406" 4 1 1.1030433 "F0406" 1 1 .6517281 "G0802" 1 1 .6517281 "G0802" 4 0 .674803 "F1307" 1 0 .674803 "F1307" 4 0 .674803 "F1307" . 0 .674803 "F1307" end
Comment