I have a data and alanyze GLM model.
#to generate data
genotype=rep(c("cv1","cv2"),each=20)
score=c(0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1)
dataA=data.frame(genotype,score)
#GLM model
glm=glm(score~genotype, family="binomial", data=dataA)
summary(glm)
#Output
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.6190 0.4688 -1.320 0.1867
genotypecv2 1.4663 0.6767 2.167 0.0302 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Here, the reference level is cv2 and the coefficients for cv2 is 1.4663 when cv1 is 0. I'd like to change the reference level (cv2 as 0).
Could you tell me how to do that?
Thanks,