Hi all,
I'm trying to create a table with different types of variables using esttab, similar to the format in the attached image. However, I’m facing an issue with displaying variables in different units. Specifically:
Additionally, I would like the home-based, school-based, and center-based daycare to be displayed on the same line. Currently, each is a dummy variable (where 1 indicates the type of establishment). Should I convert this to a categorical variable to make the table work better?
Any advice on how to handle this would be much appreciated!
Here’s the code I’ve been working with:
local numch home_based school_based center_based
local tab5 s1_less_one_enrolled s1_one_year_enrolled s1_two_year_enrolled ///
s1_three_year_enrolled s1_four_year_enrolled s1_above_five ///
s1_yearsexperience s1_receive_support religious_affiliation ///
total_children
est clear
eststo all: estpost sum `numch' `tab5'
eststo home: estpost sum `tab5' if provider_type == 1
eststo school: estpost sum `tab5' if provider_type == 2
eststo center: estpost sum `tab5' if provider_type == 3
esttab all home school center using "$tables/desc_stats_types.tex", label ///
star(* 0.10 ** 0.05 *** 0.01) ///
replace main(count %6.0f) wide mtitle("All" "Home-based" "School-based" "Center-based")
I'm trying to create a table with different types of variables using esttab, similar to the format in the attached image. However, I’m facing an issue with displaying variables in different units. Specifically:
- I want total counts for variables like "Number of centers," "Number of children," "Years of experience," and "Total children."
- I want percentages for variables like "Receiving support" and "Religious affiliation."
Additionally, I would like the home-based, school-based, and center-based daycare to be displayed on the same line. Currently, each is a dummy variable (where 1 indicates the type of establishment). Should I convert this to a categorical variable to make the table work better?
Any advice on how to handle this would be much appreciated!
Here’s the code I’ve been working with:
local numch home_based school_based center_based
local tab5 s1_less_one_enrolled s1_one_year_enrolled s1_two_year_enrolled ///
s1_three_year_enrolled s1_four_year_enrolled s1_above_five ///
s1_yearsexperience s1_receive_support religious_affiliation ///
total_children
est clear
eststo all: estpost sum `numch' `tab5'
eststo home: estpost sum `tab5' if provider_type == 1
eststo school: estpost sum `tab5' if provider_type == 2
eststo center: estpost sum `tab5' if provider_type == 3
esttab all home school center using "$tables/desc_stats_types.tex", label ///
star(* 0.10 ** 0.05 *** 0.01) ///
replace main(count %6.0f) wide mtitle("All" "Home-based" "School-based" "Center-based")
