Hello, I'm very new to R and have a problem to find the call rates of a specific category in a row in the following database:
resume <- read.csv('https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/resume.csv')
head(resume)
How can I find the call rate for a specific category such as "white" and "black" in the "race" row?
You can use 'dplyr' functions to group and summarize some variables. Here are some examples, I hope it will be useful for you.
to calculate total call by race
resume %>%
group_by(race) %>%
summarise(total = sum(call))
to calculate mean of call by race
resume %>%
group_by(race) %>%
summarise(mean = mean(call))
1 Like
Thank you, it worked. I would also like to know how to find the call rate by the first name and the highest and lowest call rates by first name.
In that case you need to group by the desired variable(s) and then summarize:
resume %>%
group_by(firstname) %>%
summarise(mean = mean(call))
other useful functions are max(), min(), median(), sd(), range()
1 Like
system
Closed
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.