I am looking for a function that allows me to calculate adjusted odds (not odds ratios) for a combination of multiple independent variables and one binary dependent variable. Would appreciate the help.
in the following dataframe example : z is the dependent binary variable. x and y are the independent variables. I want to find the odds of the groups of x adjusted on y and the odds of the groups of y adjusted on x.
set.seed(555)
x = rep(rep(c('a','b'),each=5),2)
y = rep(rep(1:5,2),2)
z = c(rep(1,10),rep(0,10))
Freq = trunc(runif(20,1,6))
m = data.frame(x,y,z,Freq)
m
The resulted dataset would look like this