Hi guys,
I ran the below R code:
> department <- c(rep("B", 2), rep("C", 2),
rep("D", 2), rep("E", 2),
rep("F", 2))> gender <- rep(c("Male", "Female"), 5)
> admitted <- c(353, 17, 120, 202, 138, 131, 53, 94, 22, 24)
> not.admitted <- c(207, 8, 205, 391, 279, 244, 138, 299, 351, 317)
> cbind(department, gender, admitted, not.admitted)
department gender admitted not.admitted
[1,] "B" "Male" "353" "207"
[2,] "B" "Female" "17" "8"
[3,] "C" "Male" "120" "205"
[4,] "C" "Female" "202" "391"
[5,] "D" "Male" "138" "279"
[6,] "D" "Female" "131" "244"
[7,] "E" "Male" "53" "138"
[8,] "E" "Female" "94" "299"
[9,] "F" "Male" "22" "351"
[10,] "F" "Female" "24" "317"
> gender <- factor(gender)
> department <- factor(department)
> y <- cbind(admitted, not.admitted)
> fit1 <- glm(y ~ department + gender, family = binomial)
> summary(fit1)
Call:
glm(formula = y ~ department + gender, family = binomial)
Deviance Residuals:
1 2 3 4 5 6 7 8 9 10
-0.1191 0.5680 0.5239 -0.3914 -0.5164 0.5440 0.6868 -0.4892 -0.5024 0.5158
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.51349 0.11936 4.302 1.69e-05 ***
departmentC -1.14008 0.12188 -9.354 < 2e-16 ***
departmentD -1.19456 0.11984 -9.968 < 2e-16 ***
departmentE -1.61308 0.13928 -11.581 < 2e-16 ***
departmentF -3.20527 0.17880 -17.927 < 2e-16 ***
genderMale 0.03069 0.08676 0.354 0.724
Can someone tell me how should I intercept these coefficients given that
the dependent variable Y is y <- cbind(admitted, not.admitted)
Thanks
[[alternative HTML version deleted]]