I'm trying to create a logistic regression model with Response (responder / non-responder binomial variable, where response is an event) as dependent variable and Intercept and Treatment as independent variables. Example dataset:
gender TRTPN responseCategory
<chr> <dbl> <chr>
1 MALE 2 SD
2 FEMALE 1 CR
3 MALE 2 PD
4 MALE 1 SD
5 FEMALE 1 PR
6 FEMALE 1 SD
What I'm doing is first, converting Treatment to a factor. Secondly, run a glm:
regression <- glm(responseCategoryfac ~ TRTPNfac, data = resp1, family = "binomial")
summary(regression)
the output is:
Call:
glm(formula = responseCategoryfac ~ TRTPNfac, family = "binomial",
data = resp1)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.3675 0.0831 0.0831 0.1661 0.1661
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.2767 0.5035 8.495 <2e-16 ***
TRTPNfac2 1.3898 1.1211 1.240 0.215
Could you please tell me why the TRTPNfac1 is included in Intercept? What I'm doing is correctly or not?
Thanks in advance