D599 Task 2: Statistical Analysis and Testing
Part I: Univariate Statistical Analysis
A. Univariate Analysis
This section identifies and analyzes two continuous variables (age and BMI) and two
categorical variables (sex and smoker). Univariate statistics like mean, standard
deviation, and frequency counts are applied to explore central tendency and variability.
This foundational analysis gives insights into individual variable behavior before
exploring relationships.
For the continuous variable Age, the distribution appears approximately symmetric and
unimodal. The mean age is 39.2 years, with a standard deviation of 14.1. The five-
number summary is: minimum = 18, Q1 = 27, median = 39, Q3 = 51, maximum = 64.
For the continuous variable BMI, the distribution is unimodal and moderately right-
skewed. The mean BMI is 30.7, with a standard deviation of 6.1. The five-number
summary is: minimum = 16.0, Q1 = 26.3, median = 30.4, Q3 = 34.7, maximum = 53.1.
For the categorical variable Smoker, 79.5% of the individuals are non-smokers, and
20.5% are smokers. The mode is 'No', as it is the most frequent category.
For the categorical variable Sex, 50.5% of the individuals are female, and 49.5% are
male. The mode is 'Female', representing the most common category in the dataset.
Two continuous variables selected: Age and BMI.
Two categorical variables selected: Sex and Smoker.
Summary Statistics (Continuous):
age bmi
count 1338.000000 1338.000000
mean 39.207025 30.663397
std 14.049960 6.098187
min 18.000000 15.960000
25% 27.000000 26.296250
50% 39.000000 30.400000
75% 51.000000 34.693750
max 64.000000 53.130000
Frequency Counts (Categorical):
, Sex:
male 676
female 662
Name: sex, dtype: int64
Smoker:
no 1064
yes 274
Name: smoker, dtype: int64
The visual representation includes histograms for continuous variables and bar charts for
categorical ones. These visuals provide a clearer understanding of distribution shape,
outliers, and frequency patterns. They support and confirm the statistical summaries from
Part A.
A1. Visual Representation
Univariate Visuals:
Part I: Univariate Statistical Analysis
A. Univariate Analysis
This section identifies and analyzes two continuous variables (age and BMI) and two
categorical variables (sex and smoker). Univariate statistics like mean, standard
deviation, and frequency counts are applied to explore central tendency and variability.
This foundational analysis gives insights into individual variable behavior before
exploring relationships.
For the continuous variable Age, the distribution appears approximately symmetric and
unimodal. The mean age is 39.2 years, with a standard deviation of 14.1. The five-
number summary is: minimum = 18, Q1 = 27, median = 39, Q3 = 51, maximum = 64.
For the continuous variable BMI, the distribution is unimodal and moderately right-
skewed. The mean BMI is 30.7, with a standard deviation of 6.1. The five-number
summary is: minimum = 16.0, Q1 = 26.3, median = 30.4, Q3 = 34.7, maximum = 53.1.
For the categorical variable Smoker, 79.5% of the individuals are non-smokers, and
20.5% are smokers. The mode is 'No', as it is the most frequent category.
For the categorical variable Sex, 50.5% of the individuals are female, and 49.5% are
male. The mode is 'Female', representing the most common category in the dataset.
Two continuous variables selected: Age and BMI.
Two categorical variables selected: Sex and Smoker.
Summary Statistics (Continuous):
age bmi
count 1338.000000 1338.000000
mean 39.207025 30.663397
std 14.049960 6.098187
min 18.000000 15.960000
25% 27.000000 26.296250
50% 39.000000 30.400000
75% 51.000000 34.693750
max 64.000000 53.130000
Frequency Counts (Categorical):
, Sex:
male 676
female 662
Name: sex, dtype: int64
Smoker:
no 1064
yes 274
Name: smoker, dtype: int64
The visual representation includes histograms for continuous variables and bar charts for
categorical ones. These visuals provide a clearer understanding of distribution shape,
outliers, and frequency patterns. They support and confirm the statistical summaries from
Part A.
A1. Visual Representation
Univariate Visuals: