library(RcmdrMisc)
Loading required package: car
Loading required package: carData
Registered S3 method overwritten by 'data.table':
  method           from
  print.data.table     
Loading required package: sandwich
Registered S3 method overwritten by 'htmlwidgets':
  method           from         
  print.htmlwidget tools:rstudio
install.packages("carData")
Error in install.packages : Updating loaded packages
library(esquisse)
package 㤼㸱esquisse㤼㸲 was built under R version 3.6.2

Restarting R session...

Data presented on this output are height and weight information from a group of people going through a regular exercise routine. A pair of data are the actual measurements gathered, while another pair are based from what the participants themselves reported. The first 6 rows of 200 are displayed below for a quick glance.

head(DAVIS)

Here’s a quick summary of its statistics.

str(DAVIS)
'data.frame':   200 obs. of  5 variables:
 $ sex   : Factor w/ 2 levels "F","M": 2 1 1 2 1 2 2 2 2 2 ...
 $ weight: int  77 58 53 68 59 76 76 69 71 65 ...
 $ height: int  182 161 161 177 157 170 167 186 178 171 ...
 $ repwt : int  77 51 54 70 59 76 77 73 71 64 ...
 $ repht : int  180 159 158 175 155 165 165 180 175 170 ...

Now, the following are some of the interesting findings derived from the data set.

Male vs Female

Height and Weight per Gender

library(ggplot2)
ggplot(DAVIS) +
 aes(x = weight, fill = sex) +
 geom_histogram(bins = 30L) +
 scale_fill_hue() +
 labs(title = "Weight per Gender") +
 theme_minimal()

library(ggplot2)

ggplot(DAVIS) +
 aes(x = height, fill = sex) +
 geom_histogram(bins = 30L) +
 scale_fill_hue() +
 labs(title = "Height per Gender") +
 theme_minimal()

Males are generally heavier and taller than females. Now that’s one confirmed thing!

Height-Weight Correlation per Gender



library(ggplot2)

ggplot(DAVIS) +
 aes(x = weight, y = height, fill = sex) +
 geom_point(size = 2.44, colour = "#0c4c8a") +
 geom_smooth(span = 0.69) +
 scale_fill_hue() +
 labs(title = "Height-Weight Correlation per Gender") +
 theme_classic()

Males’ height and weight are more correlated than that of the females. But that doesn’t say much about either party, right?

Measured vs Reported Weight per Gender

library(ggplot2)

ggplot(DAVIS) +
 aes(x = weight, y = repwt, fill = sex) +
 geom_point(size = 1L, colour = "#0c4c8a") +
 geom_smooth(span = 0.75) +
 scale_fill_hue() +
 labs(title = "Measured vs Reported Weight on both Genders") +
 theme_minimal()

Here’s the thing, males’ report of their weight vs that of the actual measurements are closer to each other than that of the reports of the females vs their actual weight. Maybe a perception issue?

Now, using the regression equations below, we will have another perspective on these data from another angle.

\[ weight = f(repwt) \]

\[ height = f(repht) \]

weight.lm <- lm(weight~repwt,data=DAVIS)
height.lm <- lm(height~repht,data=DAVIS)
weight.lm

Call:
lm(formula = weight ~ repwt, data = DAVIS)

Coefficients:
(Intercept)        repwt  
     5.3363       0.9278  
height.lm

Call:
lm(formula = height ~ repht, data = DAVIS)

Coefficients:
(Intercept)        repht  
     6.1681       0.9722  

From the entire participant population, and on either gender, actual height measurements are technically closer to reported numbers compared to that of weight.

Think about it. People during regular exercises are really more focused on their weight, and may have been putting that in consideration more than their height. Moreover, since weight is more modifiable than height, it also tends to be easier to influence through constant physical activities than the other. This output may have shown differences in weight and height for both men and women, but in reality, there are more aspects we can focus on beyond these statistics. Whether you’re a male or a female, health should be our top priority.

LS0tDQp0aXRsZTogIkhlaWdodCBhbmQgV2VpZ2h0IEFuYWx5c2lzIg0KYXV0aG9yOiAiQ2hyaXN0aWFuIFBhdWxvIEd1YW56b24iDQpkYXRlOiAyOCBGZWIgMjAyMA0Kb3V0cHV0OiBodG1sX25vdGVib29rDQotLS0NCg0KYGBge3J9DQpsaWJyYXJ5KFJjbWRyTWlzYykNCmluc3RhbGwucGFja2FnZXMoImNhckRhdGEiKQ0KbGlicmFyeShlc3F1aXNzZSkNCmxpYnJhcnkoSG1pc2MpDQpvcHRpb25zKHNjaXBlbj0xMCkNCmxpYnJhcnkoY2FyRGF0YSkNCkRhdmlzDQpEQVZJUyA8LSBEYXZpcw0KYGBgDQogIA0KICANCiAgDQpEYXRhIHByZXNlbnRlZCBvbiB0aGlzIG91dHB1dCBhcmUgaGVpZ2h0IGFuZCB3ZWlnaHQgaW5mb3JtYXRpb24gZnJvbSBhIGdyb3VwIG9mIHBlb3B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