I was analyzing the different treatments applied to products. It started out with a a plethora of variables but I came to the conclusion that I can essentially only control the treatment applied so I only wanted to calculate those odds and dropped all other variables that I cannot control.
Status = c('Fail','Pass','Pass','Fail','Fail','Fail','Fail','Fail','Fail','Fail','Fail','Fail','Pass','Fail','Pass','Pass','Fail','Fail','Fail','Fail','Fail','Fail','Pass','Fail','Pass','Fail','Fail','Fail','Fail','Fail','Pass','Fail','Pass','Pass','Pass','Pass','Pass','Pass','Pass','Pass')
Treatment = c('B','C','B','B','B','B','B','B','B','B','B','Z','B','B','B','B','B','C','C','B','B','B','B','B','B','B','C','C','C','C','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z')
length(X)
length(D)
df = cbind(Status,Treatment)
df = as.data.frame(df)
xtabs(~Status + Treatment,data = df)
mylogit <- glm(Status ~ Treatment, data = df,family = "binomial")
exp(cbind(OR = coef(mylogit), confint(mylogit)))
I want to make sure that I am interpreting the results correctly.
Treatment Z increases the odds of Pass by 1200%
Treatment C increases the odds of Pass by a factor 0f 44%
Also, where do I get the odds for Treatment B?