This survey was placed to graph the military versus non-military alcohol use. I surmised that military members would be more apt to drink more than their civilian counterparts. I utilized google forms and facebook to distribute this survey.
library(tidyverse)
library(readxl)
alcohol <- read_excel("alcohols.xlsx")
glimpse(alcohol)
Observations: 57
Variables: 10
$ Timestamp [3m[90m<dttm>[39m[23m …
$ military [3m[90m<chr>[39m[23m …
$ `What is your gender?` [3m[90m<chr>[39m[23m …
$ `What is your age range?` [3m[90m<chr>[39m[23m …
$ `How often do you drink a week?` [3m[90m<chr>[39m[23m …
$ `When you drink, how many drinks do you USUALLY consume` [3m[90m<dbl>[39m[23m …
$ `How many times a month do you binge drink (5 drinks in one sitting)` [3m[90m<chr>[39m[23m …
$ `If you drink, how long ago has it been since you blacked out (drinking until unconscious)?` [3m[90m<chr>[39m[23m …
$ `Do you feel like you have a drinking problem?` [3m[90m<chr>[39m[23m …
$ `Is alcohol a factor in having fun in social settings?` [3m[90m<chr>[39m[23m …
alcohol <-alcohol %>%
rename (age = "What is your age range?") %>%
rename (gender = "What is your gender?") %>%
rename (party = "Is alcohol a factor in having fun in social settings?") %>%
rename (frequency = "How often do you drink a week?")
alcohol <- alcohol %>%
mutate(military = fct_recode(military, "Military" = "1", "No military" = "2"))
Unknown levels in `f`: 1, 2
alcohol %>%
count(military)
alcohol <- alcohol %>%
mutate(frequency = fct_recode(frequency, "never" = "0", " to 2 times a week" = "1", "3 to 5 times a week" = "2", "6 to 7 times a week" = "3"))
Unknown levels in `f`: 0, 1, 2, 3
alcohol %>%
count(frequency)
This chart shows the frequency of Military and no military members
alcohol %>%
drop_na(frequency) %>%
ggplot(aes(x = military, fill = frequency)) +
geom_bar(position = "dodge")+
scale_fill_viridis_d()+
coord_flip()+
theme_minimal()
This graph represents the frequency use of alcohol based on the ages of participants.
alcohol %>%
drop_na(frequency) %>%
ggplot(aes(x = age, fill = frequency)) +
geom_bar(position = "dodge")+
scale_fill_viridis_d()+
coord_flip()+
theme_minimal()+
labs(y = "Age",
x = "Number of participants",
title = "Age vs. Alcohol use")
This graph shows the thoughts on alcohol during social settings.
alcohol %>%
drop_na(party) %>%
ggplot(aes(x = military, fill = party)) +
geom_bar(position = "dodge")+
scale_fill_viridis_d()+
coord_flip()+
theme_minimal()+
labs(y = "military",
x = "alcohol at social events",
title = "military vs. non-military alcohol in social settings")
This graph shows the gender differences in uses
alcohol %>%
drop_na(gender) %>%
ggplot(aes(x = frequency, fill = gender)) +
geom_bar(position = "dodge")+
scale_fill_viridis_d()+
coord_flip()+
theme_minimal()+
labs(y = "gender",
x = "frequency",
title = "gender frequency uses")