Part 3: Relationship between bmi, gender, and frequency of alcohol consumption

In [2]:
from cchs import*
import matplotlib.pyplot as plt
%matplotlib inline
CCHS = np.genfromtxt('CCHSX.csv', delimiter=',', skip_header=1, dtype=DATA_COLUMNS)
replace_nominal_codes(CCHS, 'biosex', (('1','M'),('2','F')))
replace_missing_with_nan(CCHS, 'alcoweek', (996,))

BMI Frequency

In [3]:
plt.figure(figsize=(10,4))
plt.hist(CCHS['bmi'],bins=10, color='y')
plt.title('Histogram of bmi')
plt.xlabel('bmi')
plt.ylabel('Frequency')
plt.show()

The distribution is slightly right skewed. The highest frequency is between BMI: 22-26.

BMI Frequency by Gender

In [4]:
CCHS_FEMALE_POP=CCHS[CCHS['biosex']=='F']      #mask for women only
CCHS_MALE_POP=CCHS[CCHS['biosex']=='M']       #mask for men only
CCHS_POP=[CCHS_MALE_POP['bmi'], CCHS_FEMALE_POP['bmi']]
ax=plt.figure(1, figsize=(10,4)).add_subplot(111)
ax.boxplot(CCHS_POP)
ax.set_xticklabels(['Male', 'Female'])
plt.title('Bmi by Gender')
plt.show()
In [5]:
print('Mean bmi for men is:', np.mean(CCHS_MALE_POP['bmi']), 'while Mean bmi for women is:', np.mean(CCHS_FEMALE_POP['bmi']))
print ('The Boxplot shows that the Mean BMI for Men is higher.')
Mean bmi for men is: 26.881736526946106 while Mean bmi for women is: 26.064819711538462
The Boxplot shows that the Mean BMI for Men is higher.

The mean, median, minimum, 1st quartile and 3rd quartile values is higher for men. However, women have a higher maximum and more extreme outliers.

Alcohol Comsumption Frequency for Women and Men

In [ ]:
 

The data was distributed in the following categories:

  1. Never: No drinks
  2. Low drinking frequency: < Once a month, Once a month
  3. Medium drinking frequency: 2 to 3 times a month, Once a week
  4. High drinking frequency: 2 to 3 times a week, 4 to 6 times a week, Every day

Comsumption Frequency for Women

In [6]:
CCHS_FEMALE_NEVERDRINK=CCHS[(CCHS['biosex']=='F') & (CCHS['alcofreq']==1)]                        #never drinking
CCHS_FEMALE_LOWDRINK=CCHS[(CCHS['biosex']=='F') & (CCHS['alcofreq']>1) & (CCHS['alcofreq']<=3)]   #low drinking
CCHS_FEMALE_MIDDRINK=CCHS[(CCHS['biosex']=='F') & (CCHS['alcofreq']>3) & (CCHS['alcofreq']<=5)]   #medium drinking
CCHS_FEMALE_HIGHDRINK=CCHS[(CCHS['biosex']=='F') & (CCHS['alcofreq']>5)]                          #high drinking
CCHS_FEMALE=[CCHS_FEMALE_NEVERDRINK['bmi'],CCHS_FEMALE_LOWDRINK['bmi'], CCHS_FEMALE_MIDDRINK['bmi'], CCHS_FEMALE_HIGHDRINK['bmi']]
ax=plt.figure(1, figsize=(10,6)).add_subplot(111)
ax.boxplot(CCHS_FEMALE)
ax.set_xticklabels(['Never','Low', 'Medium', 'High'])
plt.title('bmi by alcohol consumption frequency for women')
plt.show()
In [7]:
print('Mean bmi for women-never drinking:', np.mean(CCHS_FEMALE_NEVERDRINK['bmi']))
print('Mean bmi for women-low drinking frequency:', np.mean(CCHS_FEMALE_LOWDRINK['bmi']))
print('Mean bmi for women-medium drinking frequency:', np.mean(CCHS_FEMALE_MIDDRINK['bmi']))
print('Mean bmi for women-high drinking frequency:', np.mean(CCHS_FEMALE_HIGHDRINK['bmi']))
Mean bmi for women-never drinking: 26.425487804878053
Mean bmi for women-low drinking frequency: 26.73366255144033
Mean bmi for women-medium drinking frequency: 26.601192660550456
Mean bmi for women-high drinking frequency: 24.429033816425118

For women, the high drinking frequency group have the lowest mean, median, 1st quartile, 3rd quartile and maximum BMI.

Comsumption Frequency for Men

In [8]:
CCHS_MALE_NEVERDRINK=CCHS[(CCHS['biosex']=='M') & (CCHS['alcofreq']==1)]                        #never drinking
CCHS_MALE_LOWDRINK=CCHS[(CCHS['biosex']=='M') & (CCHS['alcofreq']>1) & (CCHS['alcofreq']<=3)]   #low drinking
CCHS_MALE_MIDDRINK=CCHS[(CCHS['biosex']=='M') & (CCHS['alcofreq']>3) & (CCHS['alcofreq']<=5)]   #medium drinking
CCHS_MALE_HIGHDRINK=CCHS[(CCHS['biosex']=='M') & (CCHS['alcofreq']>5)]                          #high drinking
CCHS_MALE=[CCHS_MALE_NEVERDRINK['bmi'],CCHS_MALE_LOWDRINK['bmi'], CCHS_MALE_MIDDRINK['bmi'], CCHS_MALE_HIGHDRINK['bmi']]
ax=plt.figure(1, figsize=(10,6)).add_subplot(111)
ax.boxplot(CCHS_MALE)
ax.set_xticklabels(['Never','Low', 'Medium', 'High'])
plt.title('bmi by alcohol consumption frequency for men')
plt.show()
In [9]:
print('Mean bmi for men-never drinking:', np.mean(CCHS_MALE_NEVERDRINK['bmi']))
print('Mean bmi for men-low drinking frequency:', np.mean(CCHS_MALE_LOWDRINK['bmi']))
print('Mean bmi for men-medium drinking frequency:', np.mean(CCHS_MALE_MIDDRINK['bmi']))
print('Mean bmi for men-high drinking frequency:', np.mean(CCHS_MALE_HIGHDRINK['bmi']))
Mean bmi for men-never drinking: 26.500796460176993
Mean bmi for men-low drinking frequency: 27.8145283018868
Mean bmi for men-medium drinking frequency: 27.084000000000003
Mean bmi for men-high drinking frequency: 26.558387096774194

For men, the never drinking group has the lowest mean, median, and 1st quartile BMI

Summary

The results obtained in this report demonstrates that Women in all 4 categores (never drinking, low drinking, medium drinking, high drinking) have lower BMI than Men.

In [ ]: