[R] Could the Odds represent weight in Generalized Linear Model?
contact retour-client
retour.client.contact at gmail.com
Tue Jan 30 11:14:49 CET 2018
Hello all,
I'm sorry if my question seems basic.
Im studying a responses (Yes,No) in a survey and, thanks to GLM I obtain
the following relation with my variables : (Yes,No)~ β0 + Age We note this
this certain type of (Yes,No) response is linked to age (p<0.05 in glm) .
After that we calculated :
model1=glm(cbind(Yes,No) ~ Age + Times + Type, family=binomial)
summary(model1)
exp(model1$coefficients)
exp(model1$coefficients)(Intercept) Age Times TypeRegular
0.01659381 1.02546748 1.01544154 1.70056425
The odds of answering 'Yes' is multiplied with 1.02 for each additional
year of age.
My questions is :
(1) it is possible to add to my model, (Yes,No)~ β0 + Age, the weight of
the variable Age. Is it in fact the odd value ? Here is an example : is it
ok to formulate my model as that (Yes,No)~ β0 + 1.02* Age: here 1.02 is
what I call weight of age, in other words, I want to quantify its impact in
the model.
(2)suppose I want to model (Yes,No)~ β0 + Type with type a categorical
data. odd value of TypeRegular is 1.70056425. But in my model it is simply
Type that include Regular and Irregular. How to adapt this value to Type ?
My data
res=structure(list(Age = c(10, 14, 14, 15, 16, 16, 16, 17, 17, 17, 17,
18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22,
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23,
23, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29,
29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31,
31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35,
35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 36, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40,
40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42,
42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
43, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47,
47, 47, 47, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 50,
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 58, 58, 59,
59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 61, 62, 62, 62, 62,
63, 64, 64, 65, 65, 67, 74), Times = c(6L, 6L, 16L, 6L, 9L, 23L, 33L,
6L, 14L, 17L, 36L, 4L, 9L, 15L, 20L, 26L, 28L, 30L, 33L, 6L, 11L, 14L,
20L, 26L, 28L, 30L, 32L, 4L, 4L, 6L, 9L, 17L, 26L, 28L, 30L, 33L, 44L,
47L, 4L, 6L, 23L, 26L, 32L, 4L, 9L, 11L, 11L, 14L, 14L, 15L, 17L, 18L,
20L, 23L, 26L, 36L, 44L, 50L, 4L, 9L, 28L, 30L, 32L, 4L, 17L, 23L, 4L,
6L, 9L, 9L, 11L, 14L, 25L, 33L, 33L, 51L, 4L, 6L, 14L, 17L, 18L, 26L,
28L, 30L, 32L, 33L, 44L, 50L, 6L, 9L, 9L, 11L, 14L, 17L, 22L, 23L,
30L, 4L, 9L, 11L, 14L, 15L, 20L, 23L, 28L, 29L, 36L, 39L, 43L, 51L,
58L, 14L, 20L, 23L, 26L, 28L, 36L, 51L, 4L, 6L, 9L, 16L, 17L, 18L,
23L, 33L, 37L, 51L, 9L, 11L, 14L, 18L, 23L, 26L, 28L, 58L, 9L, 17L,
33L, 36L, 37L, 58L, 4L, 6L, 9L, 9L, 11L, 17L, 20L, 26L, 28L, 32L, 33L,
47L, 4L, 6L, 9L, 15L, 23L, 28L, 4L, 9L, 9L, 15L, 17L, 18L, 20L, 23L,
28L, 30L, 30L, 4L, 6L, 6L, 9L, 17L, 18L, 33L, 36L, 4L, 6L, 11L, 14L,
15L, 17L, 23L, 26L, 28L, 36L, 4L, 6L, 9L, 11L, 17L, 18L, 23L, 25L,
28L, 30L, 6L, 9L, 11L, 14L, 14L, 17L, 20L, 23L, 28L, 35L, 44L, 4L, 6L,
9L, 14L, 17L, 44L, 6L, 9L, 14L, 17L, 22L, 26L, 28L, 29L, 33L, 36L,
50L, 4L, 6L, 6L, 17L, 20L, 23L, 28L, 30L, 36L, 51L, 58L, 4L, 9L, 9L,
14L, 15L, 17L, 23L, 26L, 28L, 30L, 36L, 38L, 6L, 6L, 9L, 17L, 23L,
26L, 28L, 43L, 44L, 4L, 15L, 17L, 17L, 25L, 26L, 28L, 36L, 44L, 51L,
58L, 6L, 9L, 16L, 25L, 28L, 32L, 44L, 58L, 4L, 9L, 17L, 28L, 30L, 36L,
43L, 44L, 6L, 11L, 14L, 16L, 26L, 30L, 44L, 15L, 20L, 23L, 26L, 28L,
52L, 4L, 6L, 9L, 9L, 11L, 14L, 16L, 17L, 20L, 23L, 26L, 28L, 30L, 33L,
35L, 37L, 50L, 51L, 6L, 9L, 14L, 17L, 18L, 18L, 26L, 44L, 50L, 9L,
14L, 14L, 15L, 18L, 20L, 23L, 28L, 33L, 36L, 43L, 44L, 50L, 4L, 9L,
11L, 14L, 18L, 26L, 28L, 29L, 30L, 32L, 43L, 44L, 52L, 6L, 9L, 20L,
23L, 28L, 30L, 33L, 36L, 43L, 4L, 9L, 11L, 14L, 16L, 20L, 23L, 26L,
28L, 36L, 50L, 51L, 4L, 6L, 9L, 14L, 18L, 23L, 26L, 30L, 36L, 43L,
44L, 52L, 6L, 9L, 17L, 18L, 23L, 26L, 28L, 30L, 35L, 9L, 14L, 20L,
32L, 33L, 36L, 44L, 6L, 9L, 23L, 25L, 36L, 51L, 9L, 17L, 17L, 18L,
20L, 33L, 58L, 9L, 23L, 26L, 28L, 36L, 6L, 20L, 28L, 20L, 23L, 4L,
15L), Type = c("Regular", "Regular", "Irregular", "Regular",
"Regular", "Irregular", "Regular", "Irregular", "Irregular",
"Irregular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Irregular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Irregular", "Regular", "Regular",
"Irregular", "Regular", "Irregular", "Regular", "Regular", "Regular",
"Irregular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Irregular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Irregular",
"Regular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Irregular", "Regular", "Irregular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Irregular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Irregular", "Regular", "Irregular",
"Regular", "Regular", "Irregular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Irregular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Irregular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Irregular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Irregular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Irregular", "Regular", "Irregular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Irregular", "Irregular", "Irregular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Irregular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Irregular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Regular", "Regular", "Regular",
"Irregular", "Regular", "Regular", "Regular", "Irregular", "Regular",
"Regular", "Regular", "Regular", "Irregular", "Regular", "Regular",
"Regular", "Regular", "Regular", "Irregular", "Regular", "Regular",
"Regular", "Irregular", "Regular", "Regular"), Yes = c(0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L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 1L)),
.Names = c("Age", "Times", "Type", "Yes", "No"), row.names = c(NA,
-426L), class = "data.frame")
Thansk a lot for your help.
Lenny
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Garanti
sans virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
[[alternative HTML version deleted]]
More information about the R-help
mailing list