I need to change the values of the variables that are taken as reference when doing the logistic regression.
I made this reprex to show what I need
# A tibble: 15 × 4
test1 test2 test3 test4
<fct> <chr> <chr> <chr>
1 No car red Up
2 Yes bike pink Up
3 Yes bike blue Down
4 No car red Up
5 Yes car blue Up
6 No bike red Up
7 Yes bike pink Down
8 Yes car pink Down
9 No bike pink Down
10 No bike red Down
11 Yes bike pink Up
12 Yes car blue Down
13 Yes bike red Up
14 Yes bike red Down
15 No bike red Up
metodo_prueba <- glm(formula = test1 ~
test2 +
test3 +
test4,
data = prueba,
family = binomial(link = "logit"))
summary(metodo_prueba)
I only will show the coeficients because that is what It matters for me now:
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.923e+01 3.705e+03 0.005 0.996
test2car -9.163e-01 1.621e+00 -0.565 0.572
test3pink -1.762e+01 3.705e+03 -0.005 0.996
test3red -1.992e+01 3.705e+03 -0.005 0.996
test4Up 2.803e-15 1.443e+00 0.000 1.000
How can I make the coefficients relative to the other values? For example, test2bike instead of test2car. Test4Down instead of test4Up.
Thanks