The data is like this.(of course, I have a more data)
week name reponse x1 x2
5 a 1 1.9 0.5
6 a 1 1.4 0.4
7 a 1 1.62 0.2
8 a 1 1.2 0.1
4 b 0 1 0.2
5 b 0 1.3 0.3
7 b 0 1.4 0.4
8 b 0 0.95 0.3
1 c 1 -0.6 0.2
8 c 1 0.2 0.1
I want to know whether whose response is 1 or 0.
model <- glm(response ~ week + x1 + x2, data = df)
predict(model, new_data, type = "response")
but the output is
1 2 3 4 5
0.3266134 0.3967968 0.4260996 0.4576125 0.5436105
6 7 8 9 10
0.5428340 0.5596906 0.6288423 0.7670795 0.4516189
I want to print the "a" is (predictions) "b" is (predictions), ... etc
, not 1 is 0.3266134, 2 is 0.3967968 .. etc.
How can I fix it?
If the code is right, how can I interpret it?