2024-02-01

Data Set Info

Title = Estimation of obesity levels based on eating habits and physical condition

Year = 2019

Howpublished = UCI Machine Learning Repository

Note = DOI: https://doi.org/10.24432/C5H31Z

Data plot of age vs weight

Data plot (3D) of age vs weight vs obesity level

Data plot of activity age vs obesity

Data plot of weight vs activity freq

\(\begin{equation} Mean = {1/n}\sum_{i=1}^{n}x_i \end{equation}\)

Obesity vs Avg activity freq
obesity Avg_Activity_Freq
-1 1.2501313
0 1.2473868
1 1.0567960
2 0.9580723
3 0.9867483
4 0.9718570
5 0.6648171

Obesity vs Avg Activity Freq

\(\begin{equation} y = \beta_0 + \beta_1\cdot x + \varepsilon \end{equation}\)

R code of 3D plot

df <- select(dat,Age,FAF, NObeyesdad) %>% mutate(obse=match(dat$NObeyesdad, c(“Insufficient_Weight”, “Normal_Weight”, “Overweight_Level_I”, “Overweight_Level_II”, “Obesity_Type_I”, “Obesity_Type_II”,“Obesity_Type_III” ))-2)

xax <- list( title = “Age”, titlefont = list(family=“Modern Computer Roman”) )

yax <- list( title = “Avg Activity Freq”, titlefont = list(family=“Modern Computer Roman”) )

zax <- list( title = “Obesity Level”, titlefont = list(family=“Modern Computer Roman”) )

fig1 <- plot_ly(x=df$Age, y=df$FAF, z=df$obse, type=“scatter3d”, mode=“markers”, color=df$obse) %>% layout( title = “Age vs Avg Activity Freq vs Obesity Level”, scene=list(xaxis=xax, yaxis=yax, zaxis=zax))

config(fig1, displaylogo=FALSE)