Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72764

Generate a table of summed obs organized by variable label

$
0
0
Using the following data example, I would like to generate a table of summing the numeric obs by variable label. The following describes how the variables are labeled:
Vars "basicneeds transportation housing childeldercare employment" fall under a domain called "financial stability" and vars "employment experience school_readiness1 emotions1 school_readiness2 emotions2" fall under the domain "education and training". I would like to sum the observations by domain. I have labeled the variables accordingly. Thanks for any helkp! I alway struggle with creating tables... I get sort of in the weeds between tabulate, table, using parens, options, etc.


Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str8 id str10 date int ffy str25 admin_times byte(num_adults num_child num_schoolagechild basicneeds transportation housing childeldercare employment experience school_readiness1 emotions1 school_readiness2 emotions2)
"210211"   "1/27/2021"  2021 "1st time" 2 1 0 3 1 4 3 3 1 0 0 0 0
"210111"   "2/4/2021"   2021 "1st time" 1 3 1 3 3 2 0 0 3 3 2 0 0
"210311"   "3/29/2021"  2021 "1st time" 2 1 0 4 4 4 4 0 3 0 0 0 0
"210411"   "4/16/2021"  2021 "1st time" 2 3 2 3 2 3 0 0 3 3 3 3 0
"211011"   "5/24/2021"  2021 "1st time" 1 1 0 4 4 2 0 0 2 0 0 0 0
"210711"   "5/25/2021"  2021 "1st time" 2 1 0 2 0 2 1 0 2 0 0 0 0
"210211"   "7/29/2021"  2021 "2nd time" 2 1 1 3 2 3 3 2 1 2 4 0 0
"211111"   "7/29/2021"  2021 "1st time" 1 1 1 3 4 1 3 2 3 3 3 0 0
"211311"   "8/27/2021"  2021 "1st time" 3 3 0 3 1 3 2 2 2 0 0 0 0
"210F11"   "9/1/2021"   2021 "1st time" 1 5 3 0 0 2 1 1 3 4 4 4 3
"210611"   "9/20/2021"  2021 "1st time" 1 1 1 4 4 4 3 4 4 4 3 0 0
"210C11"   "9/21/2021"  2021 "1st time" 1 2 2 2 2 3 1 0 3 4 4 1 1
"210B11"   "9/24/2021"  2021 "1st time" 4 1 0 3 2 3 3 0 2 0 0 0 0
"211711"   "9/28/2021"  2021 "1st time" 1 1 0 2 2 4 2 0 3 0 0 0 0
"211411"   "9/29/2021"  2021 "1st time" 2 1 0 3 0 3 2 3 2 0 0 0 0
"211811"   "11/12/2021" 2022 "1st time" 2 1 0 2 2 3 3 0 3 0 0 0 0
"211B11"   "11/23/2021" 2022 "1st time" 1 1 1 2 2 3 0 4 4 2 3 0 0
"211C11"   "12/8/2021"  2022 "1st time" 2 3 0 3 4 3 0 0 2 0 0 0 0
"211D11"   "12/21/2021" 2022 "1st time" 4 7 0 3 4 4 3 0 3 0 0 0 0
"211F11"   "1/6/2022"   2022 "1st time" 2 1 1 4 2 3 3 3 3 3 3 0 0
"220311"   "1/10/2022"  2022 "1st time" 2 1 1 3 3 0 0 0 3 4 4 0 0
"210411"   "1/14/2022"  2022 "2nd time" 1 3 2 3 2 2 2 2 3 3 3 3 3
"210211"   "1/19/2022"  2022 "3rd time" 2 1 1 3 3 4 0 2 2 2 2 0 0
"211911"   "1/27/2022"  2022 "1st time" 1 2 1 2 1 2 3 3 2 0 4 0 0
"220211"   "2/2/2022"   2022 "1st time" 1 1 0 2 4 3 3 3 0 0 0 0 0
"211011"   "2/3/2022"   2022 "2nd time" 1 1 0 3 4 0 2 0 4 0 0 0 0
"211111"   "2/8/2022"   2022 "2nd time" 1 1 1 2 3 3 3 2 3 0 0 0 0
"220611"   "2/10/2022"  2022 "1st time" 1 4 4 3 4 2 0 2 3 4 3 3 3
"211811"   "2/21/2022"  2022 "2nd time" 2 1 1 2 2 2 4 2 3 3 2 0 0
"210F11"   "3/1/2022"   2022 "2nd time" 3 6 3 3 4 3 3 0 3 4 4 0 4
"211311"   "3/17/2022"  2022 "2nd time" 3 1 0 2 3 2 0 0 2 0 0 0 0
"220911"   "3/18/2022"  2022 "1st time" 2 3 0 4 4 3 4 0 4 0 0 0 0
"210C11"   "4/22/2022"  2022 "2nd time" 1 2 2 4 4 3 3 1 3 3 4 2 2
"220511"   "5/4/2022"   2022 "1st time" 2 2 2 2 3 2 0 0 2 2 2 2 2
"211B11"   "5/31/2022"  2022 "2nd time" 1 1 1 3 3 3 0 3 4 2 3 0 0
"221711"   "6/14/2022"  2022 "1st time" 1 5 5 1 2 2 2 2 3 3 3 3 3
"211D11"   "6/20/2022"  2022 "2nd time" 4 7 0 3 3 3 0 0 2 0 0 0 0
"221B11"   "6/24/2022"  2022 "1st time" 1 1 0 2 2 2 3 1 2 0 0 0 0
"210B11"   "7/5/2022"   2022 "2nd time" 3 1 0 3 4 3 3 2 3 0 0 0 0
"221D11"   "7/14/2022"  2022 "1st time" 1 1 1 3 2 2 0 3 2 2 1 0 0
"2.2E+13"  "7/25/2022"  2022 "1st time" 2 2 0 3 3 3 0 3 3 0 0 0 0
"211411"   "7/26/2022"  2022 "2nd time" 2 2 1 4 4 2 0 0 0 4 3 0 0
"210211"   "7/27/2022"  2022 "4th time" 2 1 1 2 2 2 3 2 1 3 2 0 0
"221A11"   "7/27/2022"  2022 "1st time" 1 1 1 3 4 4 3 2 4 4 2 0 0
"2.21E+13" "7/28/2022"  2022 "1st time" 1 1 1 4 1 3 4 4 4 4 4 0 0
"210411"   "7/29/2022"  2022 "3rd time" 2 3 . 3 2 3 3 3 3 0 0 0 0
"221811"   "8/2/2022"   2022 "1st time" 2 1 0 2 2 2 3 3 4 0 0 0 0
"220611"   "8/5/2022"   2022 "2nd time" 2 4 4 3 4 2 3 3 3 4 3 4 3
"220311"   "8/17/2022"  2022 "2nd time" 2 2 2 2 2 3 3 3 2 0 3 3 3
"211111"   "8/29/2022"  2022 "3rd time" 2 1 1 2 3 2 3 2 3 2 3 0 0
"220022"   "9/2/2022"   2022 "1st time" 8 6 4 4 4 4 4 0 2 4 4 4 4
"220011"   "9/2/2022"   2022 "1st time" 8 6 . 4 4 4 4 0 2 0 0 0 0
"220611"   "9/22/2022"  2022 "3rd time" 2 6 4 4 3 3 0 0 3 4 4 4 4
"211B11"   "9/26/2022"  2022 "3rd time" 1 1 1 3 3 3 0 3 3 2 3 0 0
"211911"   "10/19/2022" 2023 "2nd time" 2 2 1 4 4 4 3 0 4 4 2 0 0
"211F11"   "11/2/2022"  2023 "2nd time" 1 1 1 3 2 2 3 0 3 4 3 0 0
"211311"   "11/4/2022"  2023 "3rd time" 2 1 0 3 4 4 1 0 2 0 0 0 0
"211B11"   "11/14/2022" 2023 "4th time" 1 1 1 3 3 3 0 3 3 1 3 0 0
"221C11"   "11/29/2022" 2023 "1st time" 2 1 0 2 2 2 3 2 2 0 0 0 0
"220511"   "11/30/2022" 2023 "2nd time" 2 3 3 2 3 3 3 0 3 3 3 3 3
end

Viewing all articles
Browse latest Browse all 72764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>