---
title: 'View from a doctor on some features'
author: 'Peter Hahn'
date: '`r Sys.Date()`'
output:
  html_document:
    number_sections: true
    toc: true
---
## Introduction
The Healthy Brain Network (HBN) dataset is a clinical sample of about five-thousand 5-22 year-olds who have
undergone both clinical and research screenings.
The goal of this competition is to develop a predictive model that analyzes childrens physical activity
and fitness data to identify early signs of problematic internet use.
Identifying these patterns can help trigger interventions to encourage healthier digital habits.

## Be careful with the data
When I looked at the data for the first time, as a surgeon I saw a few special features that could possibly have an
influence on the model. I will explain this below.

### Missing measurements units
Some features have missing or confusing units:
See this link:
https://www.kaggle.com/c/child-mind-institute-problematic-internet-use/discussion/276366

## Load libraries
```{r message = FALSE}
library(tidyverse) # metapackage of all tidyverse packages
library(janitor) # for cleaning data
library(ggpubr) # for ggplot2 themes
```
## Load the train data and do some manipulations on names

```{r message = FALSE}
# Load the data
train <- read_csv("../input/child-mind-institute-problematic-internet-use/train.csv")
test <- read_csv("../input/child-mind-institute-problematic-internet-use/test.csv")

### Modify column names with clean_names
train <- train %>% clean_names()
train <- train |> rename(age = basic_demos_age, sex = basic_demos_sex,bmi = physical_bmi,
                         height = physical_height, weight = physical_weight,
                         waist = physical_waist_circumference, systolic = physical_systolic_bp,diastolic = physical_diastolic_bp,
                         hr = physical_heart_rate,
                         grip_nd = fgc_fgc_gsnd, grip_d = fgc_fgc_gsd)
train <- train |> mutate(sex = ifelse(sex == 1,"female", "male"))
```

## Analysis of some features and their particularities
### How does age and sex influence other variables
#### Age and BMI

```{r message = FALSE}
train %>% 
  ggplot(aes(x = age, y = bmi)) +
  geom_point() + theme_bw() + facet_wrap(~sex)
```
   
There is a trend but not linear.
Here are the trend for    
- boys : https://www.cdc.gov/growthcharts/data/set1clinical/cj41c024.pdf   
- girls: https://www.cdc.gov/growthcharts/data/set1clinical/cj41c024.pdf   


#### Age heart rate and blood pressure
```{r message = FALSE}
train %>% 
  ggplot(aes(x = age, y = hr)) +
  geom_point()+ theme_bw()+ facet_wrap(~sex)
```
   
The heart rate decreases with age. This is a normal development in children and adolescents. The heart rate is the number of heartbeats per unit of time, typically per minute.
Blood pressure increases, systolic as well as diastolic.
Here are the normal values for children and adolescents from 
https://www.pedscases.com/pediatric-vital-signs-reference-chart


#### Age and grip strength dominant hand
As mentioned above, there are no units provided. The so called dynamometers regulary used provide values in kg or pound.

```{r message = FALSE}
train %>% 
  ggplot(aes(x = age, y = grip_d))+ 
  geom_point()+  theme_bw()+ facet_wrap(~sex)
```
   
Here are normal values from this study:   
https://www.sciencedirect.com/science/article/pii/S1836955313702029#fig0005   

From my own experience values above 60 kg are even rare for adults. So I would suggest to check the data again. From the values I expect the units to be in kg with outliers due to errors.
