Hello!
I keep struggling with my data and analysis
I've got 2 factor variables in dataset:
acceptance (with 2 levels - accepted and rejected) and
timeslot (with 6 levels of different time bins).
So I managed to calculate probability of acceptance for every timeslot. I did it via glm model and predict function. Then I also did it via CrossTable. And it's all very nice (esp. CrossTable "cause it gives you % directly and it's all nicely visualised in a table).
Now I need to calculate the same probability again but with the adjustment for multiple other factor like age, gender, etc.
So I guess CrossTable is out of the picture here, right? Or is there any way to include it there?
So I'm trying to do glm again.
hour_glm2 = glm(acceptance ~ timeslot + age + gender , family="binomial", data = df)
summary(hour_glm)
This is how I did probability when only 2 factors where involved:
newdata <- data.frame(timeslot= c("1", "2", "3", "4", "5", "6"))
prob_admis <- predict(hour_glm, newdata = newdata, type = "response")
newdata$prob_admis <- prob_admis
newdata
But with all other factors involved when I try to apply the same approach I keep getting errors.
Any idea how to calculate probabity for every timeslot but with all other factors involved?
Huge thanx! xx