I have two data frames:
Sexo <- rep(1:2 , length.out = 51)
Estudo <- rep(1: 17, length.out = 51)
Salário <- c(runif(51, min=900, max=3000))
data1 <- data.frame(Sexo, Estudo, Salário)
data2 <- data.frame(TaxaHomens = c(seq(0.1,0.99,length=17)),
TaxaMulheres = c(seq(0.2,0.99,length=17)),
Estudo = c(1:17))
The variable Sex at date1 is classified as 1 for men and 2 for women, Study corresponds to the person's years of studies and salary for the monthly earnings.
Is it possible to create a column called Rate on the first date frame so that the rates of the second date frame are organized according to Sex and Study?
For example, in the new data1 column I want to have Sex = 1 and Study = 3 a rate of 0.211250, for all observations of that type, and so on.