You are on page 1of 7

Title: Heart Disease

Introduction: This report presents the results of the analysis conducted on


maximum heart rate split on gender. Moreover, it shows the correlation of maximum
heart rate and age. The aim of this data analysis is to find out the prevalence of heart
disease among the female and male genders.

Data Description: This data collection contains records of medical samples of 303
individuals which were admitted to a hospital. It encompasses the gender of the
individuals, age, the chest pain type, resting blood pressure, serum cholesterol
levels(mg/dl), maximum heart rate achieved and the standard depression induced
by exercise relative to rest. We used the JASP software to analyse the medical record.

Descriptive Statistics
Frequency Distribution table

Table 1. Frequency distribution of maximum heart rate split on Gender

Maximum heart rate


Female Male
Valid 96 207
Missing 0 0
Mean 151.125 148.961
Median 157.000 151.000
Std. Deviation 20.048 24.131
IQR 23.750 36.000
Variance 401.921 582.299
25th percentile 141.250 132.000
50th percentile 157.000 151.000
75th percentile 165.000 168.000

In this medical record the were a total of 303 people who were admitted to the
hospital of which 96 were female and 207 were male. The mean is estimated by the
n

average
∑ X i and the mean maximum heart rate obtained is 151.125 for females
X́ = i =1
n
and 148.961 for males. The median is the 50th percentile and the table shows as the
median and the 50th percentile were equal for both male and female genders. The
median for female is 157 and the median for male is 151. In addition to that, the
n
2
variance was estimated by the formula S =∑ ¿ ¿¿ and the values of the variance for
i =1
females is 401.921 and for males is 582.299. Moreover, the table also shows that the
standard deviation (variation around the mean) is 20.048 for females and 24.131 for
males. The standard deviation was estimated by the formula S= √ S2 . The first
quartile (25th percentile Q 1) is equal to 141.250 for females and 132 for males. The
second quartile (50th percentile Q 2). The third quartile (75th percentile Q 3) is 165 for
females and 168 for males. Furthermore, the inter quartile range was calculated by
the formula IQR=Q 3 −Q 1 and the inter quartile range for females is 23.750 and for
males it is 36.00.

Boxplots

thalach- maximum heart rate


0- Female
1- Males

Figure 1. Box plots for maximum heart rate split on gender.

As the box plot above shows, the first quantile for male is higher than the first
quantile for female. The second quantile is higher for the female than for the male’s
second quantile. The second quantile is also called the median. Moreover, the third
quantile for the female is higher than the third quantile for male. The overall inter
quartile range is larger for males (36.00) than females (23.75) (table 1). As can be
observed from the figure, the extreme values are 97(217th value) and 96(137th value)
for female, and 71(273th value) for male.

Histogram
thalach- maximum heart rate

Figure 2. Histogram for the maximum heart rate for females.

The histogram distribution for maximum heart rate for females shows a smooth
curve at the top but at the right and left ends, it is a bit distorted. (Figure 2)

thalach- maximum heart rate

Figure 3. Histogram for the maximum heart rate for males.

The histogram distribution for maximum heart rate for females above show a
smooth curve at the top but at the right and left ends, it is a bit distorted (Figure 3).

Q-Q Plots
Figure 4. The quantile-quantile plot for maximum heart rate for females.

The Q-Q plot shows that the points for maximum heart rate are a bit far from the line
in the beginning of the Q-Q plot, this shows that the histogram of the data is
distorted from the standard normal distribution in the left hand side of the
histogram. However, the points get closer in the middle of the line showing that the
histogram of the data set is standard normal in the middle. Moreover, the points
start to move further from the line showing that the data set is distorted from the
standard normal distribution towards the right of the histogram of the data set. This
justifies the histogram for the maximum heart rates for females (figure 1)

Figure 5. The quantile-quantile plot for maximum heart rate for males.

The Q-Q plot shows that the points for maximum heart rate are close to the line from
the beginning towards the end of the Q-Q plot showing that the histogram of the
data set is standard normal from the beginning to about just before the end.
Moreover, the points start to move further from the line at the right end of the line
showing that the data set is distorted from the standard normal distribution towards
the end right of the histogram of the data set. This justifies the histogram for the
maximum heart rates for males (figure 2)

Correlation plot
thalach- maximum heart rate

Figure 6. Correlation plat for age and maximum heart rate.

In this data we see that the is a negative correlation between age and the maximum
heart rate. This means as the age of the admitted individuals increased the maximum
heart rate decreased in this data (Figure 6).
Confidence Interval
We constructed a 90% confidence interval using the following procedure

Female Male

P(L<μ<U)=1-α P(L<μ<U)=1-α
1-α=0.9 1-α=0.9
α =0.1 α =0.1

S S S S
X̄ −Z α ≤ μ ≤ X̄ +Z α X̄ −Z α ≤ μ ≤ X̄ +Z α
2 √n 2 √n 2 √n 2 √n

α α α α
P( Z> Z ¿ ¿ )= ¿ P( Z> Z ¿ ¿ )= ¿
2 2 2 2

P( Z> Z ¿¿ 0.05)=0.1/2 ¿ P ( Z> Z ¿¿ 0.05)=0.1/2 ¿


P( Z< Z ¿¿ 0.05)=0.95 ¿ P ( Z< Z 0.05 ¿=0.95
Z 0.05=1.65 Z 0.05=1.65
S=20.048 n=303 X̄ =151.125 S=24.131 n=303 X̄ =148.961
S S S S
X̄ −Z α ≤ μ ≤ X̄ +Z α X̄ −Z α ≤ μ ≤ X̄ +Z α
2 √n 2 √n 2 √n 2 √n
S¯ S S¯ S
( X ¿ −Z α , X̄ + Z α )¿ ( X ¿ −Z α , X̄ + Z α )¿
2 √n 2 √n 2 √n 2 √n
¿ ¿
20.048 24.131
151.125+1.65 ¿ 148.961+1.65 ¿
√303 √ 303
(149.225,153 .025) (146.674,151.248)

The 90% confidence interval shows that the mean value of maximum heartrate is between
149.225 and 153.025 for females as well as between 146.674 and 151.248 for males with
probability of 0.9.
We constructed another confidence interval which is 95% using similar procedure.

Female Male

P(L<μ<U)=1-α P(L<μ<U)=1-α
1-α=0.95 1-α=0.95
α =0.05 α =0.05

S S S S
X̄ −Z α ≤ μ ≤ X̄ +Z α X̄ −Z α ≤ μ ≤ X̄ +Z α
2 √n 2 √n 2 √n 2 √n

α α α α
P( Z> Z ¿ ¿ )= ¿ P( Z> Z ¿ ¿ )= ¿
2 2 2 2

P( Z> Z ¿¿ 0.0 25)=0.05 /2¿ P ( Z> Z ¿¿ 0.0 25)=0.05/ 2¿


P( Z< Z ¿¿ 0.0 25)=0.97 5 ¿ P ( Z< Z 0.0 2 5 ¿=0.9 7 5
Z 0.025 =1.96 Z 0.0 25 =1.96
S=20.048 n=303 X̄ =151.125 S=24.131 n=303 X̄ =148.961
S S S S
X̄ −Z α ≤ μ ≤ X̄ +Z α X̄ −Z α ≤ μ ≤ X̄ +Z α
2 √n 2 √n 2 √n 2 √n
S ¯ S S¯ S
( X ¿ −Z α , X̄ + Z α )¿ ( X ¿ −Z α , X̄ + Z α )¿
2 √n 2 √n 2 √n 2 √n
¿ ¿
20.048 24.131
151.125+1. 96 ¿ 148.961+1. 96 ¿
√303 √ 303
(14 8.868 , 153. 382) (146 .244 , 151. 67 8)

Changing the confidence interval from 90% to 95% brings different results. Even though it
isn’t a huge difference in our case, the 95% confidence interval is broader. The reason is in
order to capture higher precision, you must have a broader interval.

You might also like