Read the female respondent file and display the variables names.
In [1]:
import chap01soln
resp = chap01soln.ReadFemResp()
resp.columns
Out[1]:
Make a histogram of totincr the total income for the respondent's family. To interpret the codes see the codebook.
In [2]:
import thinkstats2
hist = thinkstats2.Hist(resp.totincr)
Display the histogram.
In [3]:
import thinkplot
thinkplot.Hist(hist, label='totincr')
thinkplot.Show()
Make a histogram of age_r, the respondent's age at the time of interview.
In [3]:
Make a histogram of numfmhh, the number of people in the respondent's household.
In [3]:
Make a histogram of parity, the number children the respondent has borne. How would you describe this distribution?
In [3]:
Use Hist.Largest to find the largest values of parity.
In [3]:
Use totincr to select the respondents with the highest income. Compute the distribution of parity for just the high income respondents.
In [3]:
Find the largest parities for high income respondents.
In [3]:
Compare the mean parity for high income respondents and others.
In [3]:
Investigate any other variables that look interesting.
In [3]:
In [3]: