how would i run this multiple times?
I have a variable called percent_people, which looks if we have 5000000 people in the variable country, and have a variable called city_share which looks at the percentage share per city, eg London = 40%, the percent variable has different levels of how many of them could potentially become unemployed (i.e. ranging from 100% to 75% or 50% or 25%), and how these different percentages could affect the how the unemployment rate will change?
However, right now I can only introduce one city_share and one percent_people variables. How could I code it so that I can loop through more than one input of each of the variables?
Right now I have the following:
library(dplyr)
Prediction <- function(city_share,
percent_people) {
unemployed_lon <-5000000 %>%
multiply_by(city_share) %>%
multiply_by(percent_people)
unemp <- 100000 +unemployed_lon
unemprate <- unemp %>% divide_by(5000000)
return(unemprate)
}
# Check -0.4 share + 100% percent_people
Prediction(0.4,1)