People say there is a relationship between Sex, height and weight. As you can see from the box plots and scatter plots and the P value there clearly is a statistical significance. As you can see from the first box plot, women on average weigh significantly less than men. On the second scatter plot with the exception of 2-3 out liars you can see that as height increases so does weight. On the third box plot you can see that men on average are taller than women. According to the data you can see that as height increases weight increases o average. Men on average are taller and heavier than women.
library(rmarkdown)
library(Zelig)
library(car)
library(stargazer)
library(DescTools)
data(stargazer)
## Warning in data(stargazer): data set 'stargazer' not found
data(Zelig)
## Warning in data(Zelig): data set 'Zelig' not found
data(Davis)
data(turnout)
reg1 <- zelig(repwt ~ weight, data = Davis, model = "normal")
reg2 <- zelig(repwt ~ weight + sex, data = Davis, model = "normal")
reg3 <- zelig(repht ~ height, data = Davis, model = "normal")
reg4 <- zelig(repht ~ height + sex, data = Davis, model = "normal")
stargazer(reg1, reg2, reg3, reg4, type = "html")
| Dependent variable: | ||||
| repwt | repht | |||
| (1) | (2) | (3) | (4) | |
| weight | 0.753*** | 0.570*** | ||
| (0.037) | (0.038) | |||
| sexM | 9.751*** | 8.786*** | ||
| (1.177) | (0.966) | |||
| height | 0.570*** | 0.362*** | ||
| (0.038) | (0.039) | |||
| Constant | 15.759*** | 23.520*** | 71.550*** | 102.999*** |
| (2.498) | (2.328) | (6.476) | (6.391) | |
| Observations | 183 | 183 | 183 | 183 |
| Log Likelihood | -630.422 | -600.850 | -597.535 | -562.927 |
| Akaike Inf. Crit. | 1,264.844 | 1,207.701 | 1,199.070 | 1,131.855 |
| Note: | p<0.1; p<0.05; p<0.01 | |||
plot(weight ~ sex, data = Davis)
plot(weight ~ height, data = Davis)
plot(height ~ sex, data = Davis)