DAY 4 ANSWERS

 

1.  What is the average age of heads of households in South Africa?

Commands:

means age if rel_head==1

Answer:

The mean age of heads of households is 46.74 years old.

 

 

 

2. What would be the best measures of central tendency (mean, median, mode) for the variables: metro, province, age, age10, & safety_o? Calculate the measures of central tendency.

Commands:

tab metro
tab province
sum age
tab age10
sort hhid
tab safety_o if hhid[_n]~=hhid[_n-1]

Answer:

The best measure of central tendency for the variable age is the mean.  For the rest of the variables listed above, the mode is the best measure of central tendency.  The mode for metro is rural which accounts for 59.25% of all 3 options available under the metro variable. The mode for province is Transvaal which accounts for 21.37% of all 14 options available under the province variable.  The mean or average for age is 24.24.  Most people (mode) under the age10 variable fall under the age group of 0-9, which accounts for 24.78%.  Regarding individuals perception of safety outside their home (safety_o), most individuals (mode) feel the same (64.78%).

 

 

 

3. What does the variable tmxpur measure? Does the average of this variable differ by setting, meaning do urban and rural households have the same average? What do these results tell you?

Commands:

codebook tmxpur
sort hhid
sum tmxpur if rural==0 & hhid[_n]~=hhid[_n-1]
sum tmxpur if rural==1 & hhid[_n]~=hhid[_n-1]

Answer:

The variable tmxpur measures the total month food purchase value.  By looking at the different means, average food expenditure in non-rural areas (612.85) is greater than in rural areas (418.61).

 

 

 

4.  Do households with income levels at or above the median level report a higher level of satisfaction than those who report an income below the median level, and if so, by how much?

Commands:

sort hhid
sum totminc if hhid[_n]~=hhid[_n-1], detail
gen sat2=satisfie
replace sat2=. if sat2 < 0
sort hhid
sum sat2 if totminc>=900 & totminc~=. & hhid[_n]~=hhid[_n-1]
sum sat2 if totminc<900 & hhid[_n]~=hhid[_n-1]

Answer:

The average level of satisfaction among the top income half is 3.11 while that of the bottom half is 3.65.  Households at or above the median are more satisfied, but we should view this result with some caution since income is only reported for a small fraction of the households. 

 

 

 

5.  What language is spoken by more respondents than any other?  That is, what is the modal language?

Commands:

lookfor language
tab lang_cod

Answer:

The modal language spoken at home is Zulu.

 

 

 

6a. Using the variable for all members in a household, recode or generate a variable that breaks down number of members into groups of 5 (ex. 1-5, 6-10).

Commands:

gen hhsizegr=hhsizem
replace hhsizegr=1 if hhsizem>=0 & hhsizem<6
replace hhsizegr=2 if hhsizem>=6 & hhsizem<11
replace hhsizegr=3 if hhsizem>=11 & hhsizem<16
replace hhsizegr=4 if hhsizem>=16 & hhsizem<21
label define temp 1 "1-5" 2 "6-10" 3 "11-15" 4 "16-20"
label values hhsizegr temp
label variable hhsizegr "HH Members Grouped"

 

 

6b. Using graphs, determine which group is the most represented in the survey?

Commands:

tab hhsizegr, gen(h)
sort hhid
graph h1-h4 if hhid[_n]~=hhid[_n-1], pie

Answer:

The 1-5 group is the largest in the distribution.  Of the 1062 households, 69% fall into the 1-5 grouping, by far the largest category.

 

 

 

6c. Determine what the average food expenditures are for each of the grouped household categories.

Commands:

sort hhid
sum tmxpur if hhsizegr == 1& hhid[_n]~=hhid[_n-1]
sum tmxpur if hhsizegr == 2& hhid[_n]~=hhid[_n-1]
sum tmxpur if hhsizegr == 3& hhid[_n]~=hhid[_n-1]
sum tmxpur if hhsizegr == 4& hhid[_n]~=hhid[_n-1]

or

sort hhid
tab hhsizegr if hhid[_n]~=hhid[_n-1], sum(tmxpur)

Answer:

The average food expenditure for households with 1-5 people is 461.22 rand.  Households with 6-10 people average 583.32 rand.  Households with 11-15 people average 754.13 rand, while households with 16-20 people spend 1688.95 rand on average.

 

 

 

6d. Comparing the means, what do you notice as the size of household increases?

Answer:

As the number of members in the household increase, the average food expenditure increases by group.