I am trying to find the total of the variables in stata but keep getting error message "that one of the variables is a string variable". Below is the dataset, which shows the programs in rows and the variables local, state and local in columns. There are over 200 observations, which are grouped like the way i have presented it here, but just selected two for this post.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str26 program str2 ParticipantsPublic str3 local str1 state str2 national "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Coverage" "" "" "" "" "Screening" "" "" "" "" "Lead" "0" "2" "0" "0" "Breastfeeding" "" "" "" "" "Family" "" "" "" "" " Home" "" "" "" "" "Transition" "" "" "" "" "Abroad" "2" "12" "3" "23" "Evaluation" "0" "3" "0" "0" "Developmental Screening" "" "" "" "" "Genetics" "0" "0" "0" "0" "Health Equity" "7" "6" "5" "11" "Prevention" "" "" "" "" "Screening" "" "" "" "" "Newborn Screening" "" "" "" "" "Nutrition" "0" "0" "0" "0" "Health" "" "" "" "" "Perinatal/ Postpartum Care" "" "" "" "" "Prenatal Care" "" "" "" "" "Child" "" "" "" "" "Sleep" "" "" "" "" "eCigarette Use" "" "" "" "" "Visit" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Coverage" "" "" "" "" "Screening" "" "" "" "" "Lead" "0" "20" "0" "1" "Breastfeeding" "" "" "" "" "Family" "" "" "" "" " Home" "" "" "" "" "Transition" "0" "5" "0" "1" "Abroad" "2" "70" "2" "2" "Evaluation" "6" "100" "0" "6" "Developmental Screening" "" "" "" "" "Genetics" "0" "10" "0" "0" "Health Equity" "0" "10" "0" "0" "Prevention" "" "" "" "" "Screening" "" "" "" "" "Newborn Screening" "" "" "" "" "Nutrition" "10" "3" "0" "0" "Health" "" "" "" "" "Perinatal/ Postpartum Care" "" "" "" "" "Prenatal Care" "" "" "" "" "Child" "" "" "" "" "Sleep" "" "" "" "" "eCigarette Use" "" "" "" "" "Visit" "" "" "" "" "" "" "" "" "" end
I was to add the them and present the output in the format below -- please, any ideas on how to code this in stata?
program | Participants/ Public | local | state | national |
Coverage | ||||
Screening | ||||
Lead | ||||
Breastfeeding | ||||
Family | ||||
Home | ||||
Transition | ||||
Abroad | ||||
Evaluation | ||||
Developmental Screening | ||||
Genetics | ||||
Health Equity | ||||
Prevention | ||||
Screening | ||||
Newborn Screening | ||||
Nutrition | ||||
Health | ||||
Perinatal/ Postpartum Care | ||||
Prenatal Care | ||||
Child | ||||
Sleep | ||||
eCigarette Use | ||||
Visit |
0 Response to Need help to add observations for each category.
Post a Comment