I have the following dataframe:
data <- data.frame(Individuo=c("1","2","3","4","5","6"),
Sexo=c(2,4,4,2,4,2),Ocupaçao=c(1,1,2,2,1,2),
Raça=c("Branco","Negro","Pardo","Branco","Pardo","Branco"),
Estudo=c(10,12,14,16,13,11))
Where, in Sex, the male is represented by the number 2 and the female by the number 4, in Occupation the number 1 represents the individuals occupied and 2 represents the unemployed.
How do I calculate the following ratio, (Unemployed) / (Occupied + Unemployed)? (This is the formula for the unemployment rate)
In addition, is there any way to represent such a relationship graphically (Scatter, lines or bars) by different groups? For example, (Unemployed) / (Occupied + Unemployed) only for white men or any other combination in this sense.