Code
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "lm", formula = y ~ x, se = FALSE)+
theme_bw()
Read in data
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "lm", formula = y ~ x, se = FALSE)+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "lm", formula = y ~ poly(x, 2), se = F)+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "lm", formula = y ~ poly(x, 3))+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "loess", formula = y ~ x)+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "gam", formula = y ~ splines::ns(x, 2))+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "gam", formula = y ~ splines::ns(x, 3))+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "gam", formula = y ~ splines::bs(x, 3))+
theme_bw()
%>%
df_data1 ggplot(aes(x = weight, y = height)) +
geom_point()+
geom_smooth(method = "lm", formula = y ~ quantreg::qr(.5))+
theme_bw()
Warning: Failed to fit group -1.
Caused by error:
! 'qr' is not an exported object from 'namespace:quantreg'