-- Leo's gemini proxy

-- Connecting to gemlog.blue:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Prevalence Of Drug Use Disorders Males vs Females

Prevalence, "Share (%) of population suffering from drug use disorders, in males versus females. "


Software required to recreate plots:

Install: R language, RTools40, RStudio, and GGPLot2 (see link below).

Download code and data from Github.com (see link below).

Move R code and data to working directory


Run code:


install.packages("ggplot2")
library(ggplot2)
rm(list=ls())
df <- read.csv("./prevalence-of-drug-use-disorders-males-vs-females.csv")
US <- subset(df,Code =="USA" & Year >="1990")
## Plot1:
plot(US$Year,US$Male,main="Male",type="l")
grid(col="gray")
## Plot2:
plot(US$Year,US$Female,type="l",main="Female")
grid(col="gray")
## Plot 3:
ggplot(US) + geom_line(aes(x=Year,y=Male,col="Males")) +
  geom_line(aes(x=Year,y=Female,col="Female")) +
  labs(title="Share(%) of population suffering from drug use disorders: males versus females",y="Drug use prevalence ")

Plots:

(Plot1) Female Prevalence

(Plot2) Male Prevalence

(GGPlot2) Combined Male and Female Prevalence


Resources:

R Code, data

R Language and Rtools10 (click and "base" and "Rtools")

Download and install RStduio

-- Response ended

-- Page fetched on Thu Apr 18 01:52:00 2024