# How do I explain the relationship between Health and Weight?

I have two columns in my dataset: Health and Weight, both being of numeric type:

    Health<-number of days when health is not good,
Weight<-weight


All I want to check if there is a relationship between Health and Weight. In other words, does a Weight increase yield an increase of the number of days where Health is not good, or the converse? I just want to check the relation between those two columns in dataset by plotting some graphs.

Here my sample dataset:

| Health     | Weight      |
|:-----------|------------:|
| 0          |      30     |
| 3          |      63     |
| 2          |      31     |
| 10         |      169    |
| 1          |      9      |
|0           |     139     |

• What have you tried? Something as simple as plotting one against the other? plot(newdata$Weight, newdata$Health)? – Spacedman Aug 20 '16 at 12:50
• @Sumanth Sharma I have somehow rephrased your question. I hope I have kept your initial goals – Laurent Duval Aug 20 '16 at 12:51
• Also, I'd call your "Health" variable "Sickness" or "BadHealth", because the larger the value, the less healthy the subject is. – Spacedman Aug 20 '16 at 16:02
• @Spacedman, i used the above thing which you said but as it is very big data base i can see the exact picture. How the graph is floating. – Sumanth Sharma Aug 20 '16 at 17:20
• How many points? This would be useful information to edit into your question. – Spacedman Aug 21 '16 at 14:31

I second Arun Aniyan's answer. Look at how the two features are related to each other by computing Pearson's correlation coefficient. Another option would be to visualize your data by plotting a scatterplot

### Suggestion

You could bin the 'Health' vector to make a categorical variable (ideally consisting of similar number of observations, for example : 2-bin would be median-split of 'high' and 'low', 3-bin would be tertiles of 'high', 'medium' and 'low', and so on), and then do box plots of 'Weight' per bin. You might see that the bin of 'low' is different from the bin of 'high'. The number of bins you choose depends on the distribution of the 'Health' variable and you can play around with that.

### Implementation

library(dplyr) # for modifying datasets
library(ggplot2) # for plotting
library(magrittr) # for piping
stackodato <- data.frame("Health" = sample(0:10, 10), "Weight" = sample(0:200, 10)) # creating a pseudo dataset

stackodato %>%
mutate(binnedHealth = factor(dplyr::ntile(Health, 2), labels=c("low", "high"))) %>% # add "binnedHealth" column which has the "Health" variable categorized into two factors : "high" and "low"
ggplot()+geom_boxplot(aes(x=binnedHealth, y=Weight)) # boxplot showing the distribution of "Weight" split by the "binnedHealth" factor


You can also try this :

stackodato %>% mutate(binnedHealth = factor(dplyr::ntile(Health, 2), labels=c("low", "high"))) %>% ggplot()+geom_boxplot(aes(x=Health, y=Weight, group = binnedHealth))


You could perform unsupervised clustering on the data(k-means), this will give you relationships like weights of the people whose health is not good for a particular number of days.