##thoughts of suicide wave 1
mergeddata4$sui_1<-Recode(mergeddata4$H1SU1, recodes="1=1; 0=0; else=NA")
## age, if friend attempted suicide, if family attempted, if live alone, education, thoughts of suicide, sex, race, closeness to mentor, and thoughts on likelihood of divorce at wave 3
mergeddata4$age_3<-(mergeddata4$IYEAR3 - mergeddata4$H3OD1Y)

mergeddata4$own_gun<-Recode(mergeddata4$H3DS14, recodes="1=1; 0=0; else=NA")
mergeddata4$H3TO27 <- as.numeric(mergeddata4$H3TO27)
mergeddata4$try_nth<-Recode(mergeddata4$H3TO27, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)
mergeddata4$H3TO28<- as.numeric(mergeddata4$H3TO28)
mergeddata4$l4excite<-Recode(mergeddata4$H3TO28, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)
mergeddata4$H3TO30<- as.numeric(mergeddata4$H3TO30)
mergeddata4$dthfmoment<-Recode(mergeddata4$H3TO30, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)
mergeddata4$H3TO31<- as.numeric(mergeddata4$H3TO31)
mergeddata4$excite_lc<-Recode(mergeddata4$H3TO31, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)
mergeddata4$H3TO32<- as.numeric(mergeddata4$H3TO32)
mergeddata4$like_no_res<-Recode(mergeddata4$H3TO32, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)
mergeddata4$H3TO33<- as.numeric(mergeddata4$H3TO33)
mergeddata4$follow_ins<-Recode(mergeddata4$H3TO33, recodes= "1='not_true'; 
                              2:3='true'; 4:5='very_true'; else=NA", as.factor=T)

mergeddata4$H3ED1 <- as.numeric(mergeddata4$H3ED1)
mergeddata4$educ_re3<-Recode(mergeddata4$H3ED1, recodes= "6:11='lesshigh'; 
                              12='high'; 13:15='somecol'; 16:22='col'; else=NA", as.factor=T)
mergeddata4$sui_3<-Recode(mergeddata4$H3TO130, recodes="1=1; 0=0; else=NA")
mergeddata4$male_3<-Recode(mergeddata4$BIO_SEX3, recodes="1=1; 2=0; else=NA")
mergeddata4$H3IR4 <- as.numeric(mergeddata4$H3IR4)
mergeddata4$race_3<-Recode(mergeddata4$H3IR4, recodes= "1='nwhite'; 
                              2='nhblack'; 3:5='other'; else=NA", as.factor=T)


## thoughts of suicide at wave four
mergeddata4$sui_4<-Recode(mergeddata4$H4SE1, recodes="1=1; 0=0; else=NA")
## use scale ( ) function for continuous, makes a z score
## in order to make an interaction term you do the following (variable name * variable name 2) within the regression model, do not attempt to make a unique variable
## no strata value, does not effect standard errors that much
##Selecting my variables

mergeddata4$d.event<-ifelse(mergeddata4$H3TO130==1,1,0) #did they think about it

mergeddata4$d.age<-ifelse(mergeddata4$H3TO130==1,mergeddata4$IYEAR3-(mergeddata4$H3OD1Y+1), NA)

myvars<-c( "AID", "age_3", "male_3", "race_3", "educ_re3", "own_gun", "try_nth", "l4excite", "dthfmoment", "excite_lc", "like_no_res", "follow_ins", "sui_1", "sui_3", "sui_4", "d.event", "d.age", "GSWGT134", "CLUSTER2")


mergeddata4<-mergeddata4[,myvars]
##subsetting data
sam <- mergeddata4 %>% 
  filter(complete.cases(.))
##suicide transition variable
sam<-sam %>% 
mutate(suitran_1 =ifelse(sui_1==0 & sui_3 ==0, 0,1),
       sui_tran2 =ifelse(suitran_1==1, NA,
                         ifelse(sui_3==0 & sui_4==0,0,1)))

#suicide thought transition based on self reported education at wave 3]



table1(~ d.age + male_3 + educ_re3 + race_3 + own_gun + try_nth + l4excite + dthfmoment + excite_lc + like_no_res + follow_ins| d.event,  data=sam, overall="Total")
## Warning in table1.formula(~d.age + male_3 + educ_re3 + race_3 + own_gun + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
1
(N=261)
Total
(N=261)
d.age
Mean (SD) 20.7 (1.91) 20.7 (1.91)
Median [Min, Max] 21.0 [18.0, 26.0] 21.0 [18.0, 26.0]
BIOLOGICAL SEX-W3
Mean (SD) 0.421 (0.495) 0.421 (0.495)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00]
educ_re3
col 30 (11.5%) 30 (11.5%)
high 79 (30.3%) 79 (30.3%)
lesshigh 39 (14.9%) 39 (14.9%)
somecol 113 (43.3%) 113 (43.3%)
race_3
nhblack 52 (19.9%) 52 (19.9%)
nwhite 202 (77.4%) 202 (77.4%)
other 7 (2.7%) 7 (2.7%)
S26Q14 DO YOU OWN A HANDGUN-W3
Mean (SD) 0.111 (0.315) 0.111 (0.315)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00]
try_nth
not_true 51 (19.5%) 51 (19.5%)
true 105 (40.2%) 105 (40.2%)
very_true 105 (40.2%) 105 (40.2%)
l4excite
not_true 39 (14.9%) 39 (14.9%)
true 99 (37.9%) 99 (37.9%)
very_true 123 (47.1%) 123 (47.1%)
dthfmoment
not_true 10 (3.8%) 10 (3.8%)
true 88 (33.7%) 88 (33.7%)
very_true 163 (62.5%) 163 (62.5%)
excite_lc
not_true 93 (35.6%) 93 (35.6%)
true 107 (41.0%) 107 (41.0%)
very_true 61 (23.4%) 61 (23.4%)
like_no_res
not_true 50 (19.2%) 50 (19.2%)
true 105 (40.2%) 105 (40.2%)
very_true 106 (40.6%) 106 (40.6%)
follow_ins
not_true 67 (25.7%) 67 (25.7%)
true 114 (43.7%) 114 (43.7%)
very_true 80 (30.7%) 80 (30.7%)
##You must form a person-period data set
subpp<-survSplit(Surv(d.age, d.event)~.,
              data = sam, cut=seq(19,28,1),
              episode ="age")


options(survey.lonely.psu = "adjust")
des<-svydesign(ids =~CLUSTER2, weights = ~GSWGT134,
    data = subpp, nest = T)
m0<-svyglm(d.event~male_3,
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m0)
## 
## Call:
## svyglm(formula = d.event ~ male_3, design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -0.7575     0.0888  -8.530 7.92e-14 ***
## male_3       -0.1611     0.1124  -1.434    0.154    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1.001355)
## 
## Number of Fisher Scoring iterations: 5
m1<-svyglm(d.event~as.factor(educ_re3),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m1)
## 
## Call:
## svyglm(formula = d.event ~ as.factor(educ_re3), design = des, 
##     family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 -1.34498    0.06666 -20.177  < 2e-16 ***
## as.factor(educ_re3)high      0.47035    0.12834   3.665 0.000382 ***
## as.factor(educ_re3)lesshigh  0.61338    0.16572   3.701 0.000337 ***
## as.factor(educ_re3)somecol   0.68674    0.12976   5.292 6.23e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1.001355)
## 
## Number of Fisher Scoring iterations: 5
m2<-svyglm(d.event~as.factor(d.age),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m2)
## 
## Call:
## svyglm(formula = d.event ~ as.factor(d.age), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         2.826798   0.012690 222.756  < 2e-16 ***
## as.factor(d.age)19 -4.411070   0.191521 -23.032  < 2e-16 ***
## as.factor(d.age)20 -3.956200   0.202632 -19.524  < 2e-16 ***
## as.factor(d.age)21 -3.482702   0.168172 -20.709  < 2e-16 ***
## as.factor(d.age)22 -3.738893   0.230003 -16.256  < 2e-16 ***
## as.factor(d.age)23 -3.133563   0.205580 -15.243  < 2e-16 ***
## as.factor(d.age)24 -2.971796   0.301665  -9.851  < 2e-16 ***
## as.factor(d.age)25 -1.988362   0.419982  -4.734  6.9e-06 ***
## as.factor(d.age)26 -0.005027   0.061349  -0.082    0.935    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9497283)
## 
## Number of Fisher Scoring iterations: 14
m3<-svyglm(d.event~as.factor(race_3),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m3)
## 
## Call:
## svyglm(formula = d.event ~ as.factor(race_3), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              -0.9982     0.1524  -6.548 1.87e-09 ***
## as.factor(race_3)nwhite   0.1852     0.1705   1.086    0.280    
## as.factor(race_3)other    0.2001     0.2311   0.866    0.388    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1.001355)
## 
## Number of Fisher Scoring iterations: 5
m4<-svyglm(d.event~own_gun,
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m4)
## 
## Call:
## svyglm(formula = d.event ~ own_gun, design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.83404    0.07303 -11.421   <2e-16 ***
## own_gun     -0.03617    0.17134  -0.211    0.833    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1.001355)
## 
## Number of Fisher Scoring iterations: 5
m5<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
## Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
summary(m5)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   2.5729     0.3082   8.348 4.29e-13 ***
## male_3                       -0.1900     0.1594  -1.192 0.236018    
## as.factor(educ_re3)high       0.2550     0.2170   1.175 0.242693    
## as.factor(educ_re3)lesshigh   0.4980     0.2205   2.259 0.026085 *  
## as.factor(educ_re3)somecol    0.5857     0.1746   3.354 0.001129 ** 
## as.factor(d.age)19           -4.6991     0.3416 -13.757  < 2e-16 ***
## as.factor(d.age)20           -4.2263     0.3442 -12.279  < 2e-16 ***
## as.factor(d.age)21           -3.7334     0.3094 -12.068  < 2e-16 ***
## as.factor(d.age)22           -3.9453     0.3497 -11.283  < 2e-16 ***
## as.factor(d.age)23           -3.3103     0.3228 -10.255  < 2e-16 ***
## as.factor(d.age)24           -3.1469     0.4126  -7.627 1.49e-11 ***
## as.factor(d.age)25           -2.0343     0.5173  -3.933 0.000156 ***
## as.factor(d.age)26            0.2433     0.1062   2.291 0.024110 *  
## as.factor(race_3)nwhite       0.2487     0.2498   0.996 0.321745    
## as.factor(race_3)other        0.5629     0.3340   1.685 0.095054 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9310614)
## 
## Number of Fisher Scoring iterations: 15
m6<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+own_gun,
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m6)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + own_gun, design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.56857    0.30716   8.362 4.25e-13 ***
## male_3                      -0.18575    0.15858  -1.171 0.244292    
## as.factor(educ_re3)high      0.25737    0.21942   1.173 0.243651    
## as.factor(educ_re3)lesshigh  0.50110    0.22477   2.229 0.028073 *  
## as.factor(educ_re3)somecol   0.58874    0.17672   3.331 0.001220 ** 
## as.factor(d.age)19          -4.69142    0.34203 -13.717  < 2e-16 ***
## as.factor(d.age)20          -4.21857    0.34469 -12.239  < 2e-16 ***
## as.factor(d.age)21          -3.72523    0.31339 -11.887  < 2e-16 ***
## as.factor(d.age)22          -3.93610    0.35135 -11.203  < 2e-16 ***
## as.factor(d.age)23          -3.30149    0.33092  -9.977  < 2e-16 ***
## as.factor(d.age)24          -3.13980    0.41686  -7.532 2.49e-11 ***
## as.factor(d.age)25          -2.02994    0.52246  -3.885 0.000186 ***
## as.factor(d.age)26           0.24109    0.10829   2.226 0.028289 *  
## as.factor(race_3)nwhite      0.24590    0.25148   0.978 0.330565    
## as.factor(race_3)other       0.55569    0.33963   1.636 0.105018    
## own_gun                     -0.05687    0.23750  -0.239 0.811269    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9309247)
## 
## Number of Fisher Scoring iterations: 15
m7<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(try_nth),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m7)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(try_nth), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.724105   0.369750   7.367 5.78e-11 ***
## male_3                      -0.194585   0.162902  -1.194 0.235197    
## as.factor(educ_re3)high      0.223005   0.231920   0.962 0.338662    
## as.factor(educ_re3)lesshigh  0.521436   0.222537   2.343 0.021164 *  
## as.factor(educ_re3)somecol   0.585238   0.187733   3.117 0.002401 ** 
## as.factor(d.age)19          -4.815657   0.388382 -12.399  < 2e-16 ***
## as.factor(d.age)20          -4.340652   0.368237 -11.788  < 2e-16 ***
## as.factor(d.age)21          -3.842095   0.338760 -11.342  < 2e-16 ***
## as.factor(d.age)22          -4.051494   0.366484 -11.055  < 2e-16 ***
## as.factor(d.age)23          -3.415553   0.356324  -9.586 1.05e-15 ***
## as.factor(d.age)24          -3.244226   0.456353  -7.109 1.99e-10 ***
## as.factor(d.age)25          -2.133057   0.531514  -4.013 0.000118 ***
## as.factor(d.age)26           0.128747   0.226320   0.569 0.570759    
## as.factor(race_3)nwhite      0.270489   0.234967   1.151 0.252488    
## as.factor(race_3)other       0.637521   0.322423   1.977 0.050848 .  
## as.factor(try_nth)true      -0.131745   0.182067  -0.724 0.471049    
## as.factor(try_nth)very_true  0.007263   0.176127   0.041 0.967191    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.934304)
## 
## Number of Fisher Scoring iterations: 15
m8<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(l4excite),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m8)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(l4excite), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    2.2782     0.3373   6.755 1.06e-09 ***
## male_3                        -0.2962     0.1777  -1.667  0.09872 .  
## as.factor(educ_re3)high        0.2815     0.2365   1.190  0.23692    
## as.factor(educ_re3)lesshigh    0.4577     0.2260   2.026  0.04556 *  
## as.factor(educ_re3)somecol     0.5777     0.2054   2.813  0.00594 ** 
## as.factor(d.age)19            -4.6895     0.2912 -16.106  < 2e-16 ***
## as.factor(d.age)20            -4.2057     0.2580 -16.299  < 2e-16 ***
## as.factor(d.age)21            -3.7014     0.2772 -13.354  < 2e-16 ***
## as.factor(d.age)22            -3.9103     0.2918 -13.402  < 2e-16 ***
## as.factor(d.age)23            -3.2675     0.2984 -10.951  < 2e-16 ***
## as.factor(d.age)24            -3.0786     0.3841  -8.015 2.50e-12 ***
## as.factor(d.age)25            -1.8348     0.4147  -4.424 2.53e-05 ***
## as.factor(d.age)26             0.6177     0.2974   2.077  0.04042 *  
## as.factor(race_3)nwhite        0.1076     0.2204   0.488  0.62642    
## as.factor(race_3)other         0.3572     0.3192   1.119  0.26592    
## as.factor(l4excite)true        0.4953     0.2427   2.041  0.04399 *  
## as.factor(l4excite)very_true   0.5583     0.2429   2.299  0.02365 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9237147)
## 
## Number of Fisher Scoring iterations: 15
m9<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(dthfmoment),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m9)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(dthfmoment), design = des, 
##     family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     2.11543    0.51194   4.132 7.63e-05 ***
## male_3                         -0.33076    0.16615  -1.991  0.04932 *  
## as.factor(educ_re3)high         0.22958    0.22572   1.017  0.31162    
## as.factor(educ_re3)lesshigh     0.40657    0.23706   1.715  0.08952 .  
## as.factor(educ_re3)somecol      0.55552    0.19768   2.810  0.00599 ** 
## as.factor(d.age)19             -4.89135    0.39754 -12.304  < 2e-16 ***
## as.factor(d.age)20             -4.40391    0.38292 -11.501  < 2e-16 ***
## as.factor(d.age)21             -3.90076    0.35967 -10.845  < 2e-16 ***
## as.factor(d.age)22             -4.11254    0.39394 -10.440  < 2e-16 ***
## as.factor(d.age)23             -3.45211    0.39117  -8.825 4.60e-14 ***
## as.factor(d.age)24             -3.23887    0.44810  -7.228 1.13e-10 ***
## as.factor(d.age)25             -2.05059    0.57716  -3.553  0.00059 ***
## as.factor(d.age)26              0.26437    0.09395   2.814  0.00592 ** 
## as.factor(race_3)nwhite         0.26336    0.24922   1.057  0.29325    
## as.factor(race_3)other          0.55370    0.33860   1.635  0.10523    
## as.factor(dthfmoment)true       0.60265    0.37927   1.589  0.11532    
## as.factor(dthfmoment)very_true  0.84359    0.32731   2.577  0.01146 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9285278)
## 
## Number of Fisher Scoring iterations: 15
m10<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(excite_lc),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m10)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(excite_lc), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                     2.4606     0.3493   7.044 2.70e-10 ***
## male_3                         -0.2205     0.1631  -1.352  0.17949    
## as.factor(educ_re3)high         0.2337     0.2230   1.048  0.29711    
## as.factor(educ_re3)lesshigh     0.4285     0.2317   1.849  0.06751 .  
## as.factor(educ_re3)somecol      0.5362     0.1932   2.776  0.00661 ** 
## as.factor(d.age)19             -4.6680     0.2833 -16.475  < 2e-16 ***
## as.factor(d.age)20             -4.1921     0.2964 -14.144  < 2e-16 ***
## as.factor(d.age)21             -3.6925     0.2777 -13.298  < 2e-16 ***
## as.factor(d.age)22             -3.8984     0.3169 -12.301  < 2e-16 ***
## as.factor(d.age)23             -3.2609     0.3046 -10.705  < 2e-16 ***
## as.factor(d.age)24             -3.0866     0.4011  -7.695 1.19e-11 ***
## as.factor(d.age)25             -1.9304     0.3986  -4.843 4.84e-06 ***
## as.factor(d.age)26              0.4074     0.2208   1.845  0.06804 .  
## as.factor(race_3)nwhite         0.2234     0.2385   0.937  0.35106    
## as.factor(race_3)other          0.6379     0.3418   1.866  0.06500 .  
## as.factor(excite_lc)true        0.2378     0.1800   1.322  0.18944    
## as.factor(excite_lc)very_true   0.1946     0.2570   0.757  0.45088    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9322157)
## 
## Number of Fisher Scoring iterations: 15
m11<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(l4excite),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m11)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(l4excite), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    2.2782     0.3373   6.755 1.06e-09 ***
## male_3                        -0.2962     0.1777  -1.667  0.09872 .  
## as.factor(educ_re3)high        0.2815     0.2365   1.190  0.23692    
## as.factor(educ_re3)lesshigh    0.4577     0.2260   2.026  0.04556 *  
## as.factor(educ_re3)somecol     0.5777     0.2054   2.813  0.00594 ** 
## as.factor(d.age)19            -4.6895     0.2912 -16.106  < 2e-16 ***
## as.factor(d.age)20            -4.2057     0.2580 -16.299  < 2e-16 ***
## as.factor(d.age)21            -3.7014     0.2772 -13.354  < 2e-16 ***
## as.factor(d.age)22            -3.9103     0.2918 -13.402  < 2e-16 ***
## as.factor(d.age)23            -3.2675     0.2984 -10.951  < 2e-16 ***
## as.factor(d.age)24            -3.0786     0.3841  -8.015 2.50e-12 ***
## as.factor(d.age)25            -1.8348     0.4147  -4.424 2.53e-05 ***
## as.factor(d.age)26             0.6177     0.2974   2.077  0.04042 *  
## as.factor(race_3)nwhite        0.1076     0.2204   0.488  0.62642    
## as.factor(race_3)other         0.3572     0.3192   1.119  0.26592    
## as.factor(l4excite)true        0.4953     0.2427   2.041  0.04399 *  
## as.factor(l4excite)very_true   0.5583     0.2429   2.299  0.02365 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9237147)
## 
## Number of Fisher Scoring iterations: 15
m12<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(like_no_res),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m12)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(like_no_res), design = des, 
##     family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       2.3820     0.3424   6.957 4.09e-10 ***
## male_3                           -0.3151     0.2128  -1.481 0.141954    
## as.factor(educ_re3)high           0.1758     0.2407   0.731 0.466822    
## as.factor(educ_re3)lesshigh       0.3490     0.2483   1.405 0.163093    
## as.factor(educ_re3)somecol        0.5248     0.1923   2.728 0.007557 ** 
## as.factor(d.age)19               -4.7731     0.4172 -11.440  < 2e-16 ***
## as.factor(d.age)20               -4.2848     0.4090 -10.475  < 2e-16 ***
## as.factor(d.age)21               -3.7677     0.3667 -10.273  < 2e-16 ***
## as.factor(d.age)22               -3.9748     0.3760 -10.572  < 2e-16 ***
## as.factor(d.age)23               -3.3509     0.3393  -9.876 2.49e-16 ***
## as.factor(d.age)24               -3.1508     0.4240  -7.431 4.25e-11 ***
## as.factor(d.age)25               -1.8497     0.4661  -3.968 0.000139 ***
## as.factor(d.age)26                0.6385     0.2069   3.086 0.002644 ** 
## as.factor(race_3)nwhite           0.2053     0.2413   0.851 0.396920    
## as.factor(race_3)other            0.6186     0.3067   2.017 0.046465 *  
## as.factor(like_no_res)true        0.3886     0.1793   2.168 0.032620 *  
## as.factor(like_no_res)very_true   0.6335     0.2675   2.368 0.019868 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9230586)
## 
## Number of Fisher Scoring iterations: 15
m13<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+as.factor(follow_ins),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m13)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + as.factor(follow_ins), design = des, 
##     family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      2.3804     0.3547   6.711 1.30e-09 ***
## male_3                          -0.2962     0.1666  -1.778 0.078471 .  
## as.factor(educ_re3)high          0.1343     0.2388   0.562 0.575189    
## as.factor(educ_re3)lesshigh      0.3796     0.2295   1.654 0.101332    
## as.factor(educ_re3)somecol       0.4790     0.2123   2.256 0.026316 *  
## as.factor(d.age)19              -4.7174     0.3782 -12.473  < 2e-16 ***
## as.factor(d.age)20              -4.2307     0.3643 -11.614  < 2e-16 ***
## as.factor(d.age)21              -3.7225     0.3316 -11.224  < 2e-16 ***
## as.factor(d.age)22              -3.9241     0.3740 -10.492  < 2e-16 ***
## as.factor(d.age)23              -3.2680     0.3550  -9.207 6.92e-15 ***
## as.factor(d.age)24              -3.0453     0.4366  -6.975 3.76e-10 ***
## as.factor(d.age)25              -1.9307     0.5680  -3.399 0.000982 ***
## as.factor(d.age)26               0.2459     0.1139   2.158 0.033384 *  
## as.factor(race_3)nwhite          0.2449     0.2597   0.943 0.347974    
## as.factor(race_3)other           0.5354     0.3740   1.431 0.155568    
## as.factor(follow_ins)true        0.4169     0.1765   2.362 0.020197 *  
## as.factor(follow_ins)very_true   0.5095     0.1947   2.616 0.010308 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.928674)
## 
## Number of Fisher Scoring iterations: 15
m14<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(race_3)+own_gun+as.factor(try_nth)+
              as.factor(l4excite)+as.factor(dthfmoment)+as.factor(excite_lc)+as.factor(l4excite)
            +as.factor(like_no_res)+as.factor(follow_ins),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!

## Warning in eval(family$initialize): glm.fit: fitted probabilities numerically 0
## or 1 occurred
summary(m14)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(race_3) + own_gun + as.factor(try_nth) + as.factor(l4excite) + 
##     as.factor(dthfmoment) + as.factor(excite_lc) + as.factor(l4excite) + 
##     as.factor(like_no_res) + as.factor(follow_ins), design = des, 
##     family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                      2.08700    0.59688   3.497 0.000748 ***
## male_3                          -0.47571    0.18796  -2.531 0.013195 *  
## as.factor(educ_re3)high          0.11206    0.25250   0.444 0.658316    
## as.factor(educ_re3)lesshigh      0.26147    0.28206   0.927 0.356520    
## as.factor(educ_re3)somecol       0.50698    0.23188   2.186 0.031504 *  
## as.factor(d.age)19              -5.04616    0.39842 -12.665  < 2e-16 ***
## as.factor(d.age)20              -4.52966    0.40767 -11.111  < 2e-16 ***
## as.factor(d.age)21              -3.98427    0.35246 -11.304  < 2e-16 ***
## as.factor(d.age)22              -4.16667    0.41169 -10.121 2.59e-16 ***
## as.factor(d.age)23              -3.47135    0.39807  -8.720 1.82e-13 ***
## as.factor(d.age)24              -3.19330    0.43846  -7.283 1.46e-10 ***
## as.factor(d.age)25              -1.87264    0.54015  -3.467 0.000824 ***
## as.factor(d.age)26               0.54212    0.37776   1.435 0.154891    
## as.factor(race_3)nwhite          0.24168    0.23885   1.012 0.314452    
## as.factor(race_3)other           0.51466    0.37211   1.383 0.170211    
## own_gun                         -0.04117    0.28331  -0.145 0.884811    
## as.factor(try_nth)true          -0.23238    0.18741  -1.240 0.218363    
## as.factor(try_nth)very_true     -0.28079    0.23269  -1.207 0.230850    
## as.factor(l4excite)true          0.41641    0.22748   1.831 0.070634 .  
## as.factor(l4excite)very_true     0.29408    0.25807   1.140 0.257642    
## as.factor(dthfmoment)true        0.34498    0.38407   0.898 0.371575    
## as.factor(dthfmoment)very_true   0.49455    0.32962   1.500 0.137178    
## as.factor(excite_lc)true        -0.14562    0.22092  -0.659 0.511557    
## as.factor(excite_lc)very_true   -0.42322    0.32824  -1.289 0.200735    
## as.factor(like_no_res)true       0.38428    0.20192   1.903 0.060364 .  
## as.factor(like_no_res)very_true  0.68307    0.28073   2.433 0.017036 *  
## as.factor(follow_ins)true        0.27083    0.19573   1.384 0.170034    
## as.factor(follow_ins)very_true   0.38824    0.22741   1.707 0.091384 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9313429)
## 
## Number of Fisher Scoring iterations: 15
exp(coef(m0))
## (Intercept)      male_3 
##   0.4688331   0.8511983
exp(coef(m1))
##                 (Intercept)     as.factor(educ_re3)high 
##                   0.2605446                   1.6005564 
## as.factor(educ_re3)lesshigh  as.factor(educ_re3)somecol 
##                   1.8466621                   1.9872232
exp(coef(m2))
##        (Intercept) as.factor(d.age)19 as.factor(d.age)20 as.factor(d.age)21 
##        16.89128939         0.01214218         0.01913570         0.03072427 
## as.factor(d.age)22 as.factor(d.age)23 as.factor(d.age)24 as.factor(d.age)25 
##         0.02378042         0.04356230         0.05121125         0.13691952 
## as.factor(d.age)26 
##         0.99498572
exp(coef(m3))
##             (Intercept) as.factor(race_3)nwhite  as.factor(race_3)other 
##               0.3685483               1.2034672               1.2215796
exp(coef(m4))
## (Intercept)     own_gun 
##   0.4342926   0.9644762
exp(coef(m5))
##                 (Intercept)                      male_3 
##                13.104289821                 0.826959221 
##     as.factor(educ_re3)high as.factor(educ_re3)lesshigh 
##                 1.290479611                 1.645451473 
##  as.factor(educ_re3)somecol          as.factor(d.age)19 
##                 1.796286840                 0.009103809 
##          as.factor(d.age)20          as.factor(d.age)21 
##                 0.014607054                 0.023912177 
##          as.factor(d.age)22          as.factor(d.age)23 
##                 0.019345003                 0.036503499 
##          as.factor(d.age)24          as.factor(d.age)25 
##                 0.042985751                 0.130769855 
##          as.factor(d.age)26     as.factor(race_3)nwhite 
##                 1.275474088                 1.282381224 
##      as.factor(race_3)other 
##                 1.755756263
exp(coef(m6))
##                 (Intercept)                      male_3 
##                13.047131320                 0.830478003 
##     as.factor(educ_re3)high as.factor(educ_re3)lesshigh 
##                 1.293523509                 1.650540294 
##  as.factor(educ_re3)somecol          as.factor(d.age)19 
##                 1.801710248                 0.009173614 
##          as.factor(d.age)20          as.factor(d.age)21 
##                 0.014719659                 0.024107635 
##          as.factor(d.age)22          as.factor(d.age)23 
##                 0.019524146                 0.036828423 
##          as.factor(d.age)24          as.factor(d.age)25 
##                 0.043291476                 0.131343107 
##          as.factor(d.age)26     as.factor(race_3)nwhite 
##                 1.272632114                 1.278773102 
##      as.factor(race_3)other                     own_gun 
##                 1.743138940                 0.944720932
exp(coef(m7))
##                 (Intercept)                      male_3 
##                15.242759298                 0.823176071 
##     as.factor(educ_re3)high as.factor(educ_re3)lesshigh 
##                 1.249827120                 1.684444177 
##  as.factor(educ_re3)somecol          as.factor(d.age)19 
##                 1.795418084                 0.008101895 
##          as.factor(d.age)20          as.factor(d.age)21 
##                 0.013028032                 0.021448610 
##          as.factor(d.age)22          as.factor(d.age)23 
##                 0.017396359                 0.032858232 
##          as.factor(d.age)24          as.factor(d.age)25 
##                 0.038998744                 0.118474598 
##          as.factor(d.age)26     as.factor(race_3)nwhite 
##                 1.137402290                 1.310605297 
##      as.factor(race_3)other      as.factor(try_nth)true 
##                 1.891786022                 0.876564364 
## as.factor(try_nth)very_true 
##                 1.007289654
exp(coef(m8))
##                  (Intercept)                       male_3 
##                  9.759379151                  0.743655497 
##      as.factor(educ_re3)high  as.factor(educ_re3)lesshigh 
##                  1.325136533                  1.580503844 
##   as.factor(educ_re3)somecol           as.factor(d.age)19 
##                  1.781950450                  0.009190914 
##           as.factor(d.age)20           as.factor(d.age)21 
##                  0.014909664                  0.024689107 
##           as.factor(d.age)22           as.factor(d.age)23 
##                  0.020034743                  0.038100992 
##           as.factor(d.age)24           as.factor(d.age)25 
##                  0.046023350                  0.159644824 
##           as.factor(d.age)26      as.factor(race_3)nwhite 
##                  1.854666216                  1.113657476 
##       as.factor(race_3)other      as.factor(l4excite)true 
##                  1.429286093                  1.641035686 
## as.factor(l4excite)very_true 
##                  1.747761282
exp(coef(m9))
##                    (Intercept)                         male_3 
##                    8.293175352                    0.718375958 
##        as.factor(educ_re3)high    as.factor(educ_re3)lesshigh 
##                    1.258072902                    1.501658606 
##     as.factor(educ_re3)somecol             as.factor(d.age)19 
##                    1.742850209                    0.007511284 
##             as.factor(d.age)20             as.factor(d.age)21 
##                    0.012229421                    0.020226497 
##             as.factor(d.age)22             as.factor(d.age)23 
##                    0.016366098                    0.031678630 
##             as.factor(d.age)24             as.factor(d.age)25 
##                    0.039208172                    0.128658355 
##             as.factor(d.age)26        as.factor(race_3)nwhite 
##                    1.302614509                    1.301298985 
##         as.factor(race_3)other      as.factor(dthfmoment)true 
##                    1.739672380                    1.826947279 
## as.factor(dthfmoment)very_true 
##                    2.324690217
exp(coef(m10))
##                   (Intercept)                        male_3 
##                   11.71181143                    0.80214358 
##       as.factor(educ_re3)high   as.factor(educ_re3)lesshigh 
##                    1.26329413                    1.53491448 
##    as.factor(educ_re3)somecol            as.factor(d.age)19 
##                    1.70948302                    0.00939070 
##            as.factor(d.age)20            as.factor(d.age)21 
##                    0.01511421                    0.02491032 
##            as.factor(d.age)22            as.factor(d.age)23 
##                    0.02027469                    0.03835229 
##            as.factor(d.age)24            as.factor(d.age)25 
##                    0.04565784                    0.14508760 
##            as.factor(d.age)26       as.factor(race_3)nwhite 
##                    1.50293331                    1.25037401 
##        as.factor(race_3)other      as.factor(excite_lc)true 
##                    1.89244351                    1.26849838 
## as.factor(excite_lc)very_true 
##                    1.21481010
exp(coef(m11))
##                  (Intercept)                       male_3 
##                  9.759379151                  0.743655497 
##      as.factor(educ_re3)high  as.factor(educ_re3)lesshigh 
##                  1.325136533                  1.580503844 
##   as.factor(educ_re3)somecol           as.factor(d.age)19 
##                  1.781950450                  0.009190914 
##           as.factor(d.age)20           as.factor(d.age)21 
##                  0.014909664                  0.024689107 
##           as.factor(d.age)22           as.factor(d.age)23 
##                  0.020034743                  0.038100992 
##           as.factor(d.age)24           as.factor(d.age)25 
##                  0.046023350                  0.159644824 
##           as.factor(d.age)26      as.factor(race_3)nwhite 
##                  1.854666216                  1.113657476 
##       as.factor(race_3)other      as.factor(l4excite)true 
##                  1.429286093                  1.641035686 
## as.factor(l4excite)very_true 
##                  1.747761282
exp(coef(m12))
##                     (Intercept)                          male_3 
##                    10.826732346                     0.729721933 
##         as.factor(educ_re3)high     as.factor(educ_re3)lesshigh 
##                     1.192242840                     1.417681531 
##      as.factor(educ_re3)somecol              as.factor(d.age)19 
##                     1.690100665                     0.008453884 
##              as.factor(d.age)20              as.factor(d.age)21 
##                     0.013776586                     0.023105989 
##              as.factor(d.age)22              as.factor(d.age)23 
##                     0.018783100                     0.035052347 
##              as.factor(d.age)24              as.factor(d.age)25 
##                     0.042818784                     0.157277729 
##              as.factor(d.age)26         as.factor(race_3)nwhite 
##                     1.893654954                     1.227897183 
##          as.factor(race_3)other      as.factor(like_no_res)true 
##                     1.856373668                     1.474977486 
## as.factor(like_no_res)very_true 
##                     1.884172193
exp(coef(m13))
##                    (Intercept)                         male_3 
##                   10.809199486                    0.743642095 
##        as.factor(educ_re3)high    as.factor(educ_re3)lesshigh 
##                    1.143738817                    1.461667211 
##     as.factor(educ_re3)somecol             as.factor(d.age)19 
##                    1.614463187                    0.008938456 
##             as.factor(d.age)20             as.factor(d.age)21 
##                    0.014542384                    0.024174400 
##             as.factor(d.age)22             as.factor(d.age)23 
##                    0.019759135                    0.038080813 
##             as.factor(d.age)24             as.factor(d.age)25 
##                    0.047581648                    0.145049566 
##             as.factor(d.age)26        as.factor(race_3)nwhite 
##                    1.278737430                    1.277479753 
##         as.factor(race_3)other      as.factor(follow_ins)true 
##                    1.708065210                    1.517241229 
## as.factor(follow_ins)very_true 
##                    1.664515043
exp(coef(m14))
##                     (Intercept)                          male_3 
##                     8.060711242                     0.621444487 
##         as.factor(educ_re3)high     as.factor(educ_re3)lesshigh 
##                     1.118574891                     1.298842119 
##      as.factor(educ_re3)somecol              as.factor(d.age)19 
##                     1.660271902                     0.006434008 
##              as.factor(d.age)20              as.factor(d.age)21 
##                     0.010784354                     0.018605929 
##              as.factor(d.age)22              as.factor(d.age)23 
##                     0.015503833                     0.031075037 
##              as.factor(d.age)24              as.factor(d.age)25 
##                     0.041036148                     0.153717787 
##              as.factor(d.age)26         as.factor(race_3)nwhite 
##                     1.719649773                     1.273385610 
##          as.factor(race_3)other                         own_gun 
##                     1.673077319                     0.959669140 
##          as.factor(try_nth)true     as.factor(try_nth)very_true 
##                     0.792642657                     0.755189239 
##         as.factor(l4excite)true    as.factor(l4excite)very_true 
##                     1.516509698                     1.341892440 
##       as.factor(dthfmoment)true  as.factor(dthfmoment)very_true 
##                     1.411957811                     1.639760946 
##        as.factor(excite_lc)true   as.factor(excite_lc)very_true 
##                     0.864486779                     0.654937453 
##      as.factor(like_no_res)true as.factor(like_no_res)very_true 
##                     1.468559449                     1.979949084 
##       as.factor(follow_ins)true  as.factor(follow_ins)very_true 
##                     1.311045835                     1.474388806
#interaction terms

m15<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+male_3*as.factor(educ_re3),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m15)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     male_3 * as.factor(educ_re3), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         2.83580    0.32148   8.821 4.36e-14 ***
## male_3                             -0.28664    0.19057  -1.504   0.1358    
## as.factor(educ_re3)high             0.28188    0.24756   1.139   0.2576    
## as.factor(educ_re3)lesshigh         0.35046    0.31383   1.117   0.2668    
## as.factor(educ_re3)somecol          0.48707    0.22304   2.184   0.0314 *  
## as.factor(d.age)19                 -4.68666    0.31997 -14.647  < 2e-16 ***
## as.factor(d.age)20                 -4.21397    0.33552 -12.559  < 2e-16 ***
## as.factor(d.age)21                 -3.72616    0.32233 -11.560  < 2e-16 ***
## as.factor(d.age)22                 -3.94887    0.34982 -11.288  < 2e-16 ***
## as.factor(d.age)23                 -3.31261    0.35733  -9.270 4.64e-15 ***
## as.factor(d.age)24                 -3.12911    0.41538  -7.533 2.48e-11 ***
## as.factor(d.age)25                 -2.04093    0.44153  -4.622 1.16e-05 ***
## as.factor(d.age)26                  0.12441    0.06423   1.937   0.0556 .  
## male_3:as.factor(educ_re3)high     -0.07418    0.37258  -0.199   0.8426    
## male_3:as.factor(educ_re3)lesshigh  0.30791    0.44711   0.689   0.4927    
## male_3:as.factor(educ_re3)somecol   0.23027    0.27565   0.835   0.4055    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9321839)
## 
## Number of Fisher Scoring iterations: 15
m16<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+male_3*as.factor(d.age),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m16)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     male_3 * as.factor(d.age), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients: (1 not defined because of singularities)
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  2.50759    0.20903  11.996  < 2e-16 ***
## male_3                       0.03832    0.03998   0.959  0.34025    
## as.factor(educ_re3)high      0.27864    0.21362   1.304  0.19530    
## as.factor(educ_re3)lesshigh  0.51511    0.22254   2.315  0.02281 *  
## as.factor(educ_re3)somecol   0.62668    0.17463   3.589  0.00053 ***
## as.factor(d.age)19          -4.37873    0.23241 -18.840  < 2e-16 ***
## as.factor(d.age)20          -3.95035    0.28378 -13.920  < 2e-16 ***
## as.factor(d.age)21          -3.54076    0.26498 -13.362  < 2e-16 ***
## as.factor(d.age)22          -3.62195    0.34060 -10.634  < 2e-16 ***
## as.factor(d.age)23          -3.25644    0.36695  -8.874 4.55e-14 ***
## as.factor(d.age)24          -2.89513    0.40378  -7.170 1.69e-10 ***
## as.factor(d.age)25           0.07841    0.05043   1.555  0.12340    
## as.factor(d.age)26           0.05672    0.06330   0.896  0.37255    
## male_3:as.factor(d.age)19   -0.34951    0.31770  -1.100  0.27409    
## male_3:as.factor(d.age)20   -0.23711    0.30267  -0.783  0.43537    
## male_3:as.factor(d.age)21   -0.07814    0.33550  -0.233  0.81633    
## male_3:as.factor(d.age)22   -0.38785    0.43136  -0.899  0.37088    
## male_3:as.factor(d.age)23    0.11683    0.44021   0.265  0.79128    
## male_3:as.factor(d.age)24   -0.23319    0.56325  -0.414  0.67982    
## male_3:as.factor(d.age)25   -2.31872    0.51623  -4.492 2.01e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9275231)
## 
## Number of Fisher Scoring iterations: 15
m17<-svyglm(d.event~male_3+as.factor(educ_re3)+as.factor(d.age)+as.factor(educ_re3)*as.factor(d.age),
          design=des, family=binomial (link="cloglog"))
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
summary(m17)
## 
## Call:
## svyglm(formula = d.event ~ male_3 + as.factor(educ_re3) + as.factor(d.age) + 
##     as.factor(educ_re3) * as.factor(d.age), design = des, family = binomial(link = "cloglog"))
## 
## Survey design:
## svydesign(ids = ~CLUSTER2, weights = ~GSWGT134, data = subpp, 
##     nest = T)
## 
## Coefficients: (5 not defined because of singularities)
##                                                 Estimate Std. Error t value
## (Intercept)                                      5.48893    0.62443   8.790
## male_3                                          -0.15791    0.15576  -1.014
## as.factor(educ_re3)high                         -2.42266    0.53622  -4.518
## as.factor(educ_re3)lesshigh                     -2.45248    0.54340  -4.513
## as.factor(educ_re3)somecol                      -2.44116    0.53944  -4.525
## as.factor(d.age)19                             -22.85937    0.64575 -35.400
## as.factor(d.age)20                              -7.65932    0.82860  -9.244
## as.factor(d.age)21                              -7.00199    0.80946  -8.650
## as.factor(d.age)22                              -6.62759    0.80884  -8.194
## as.factor(d.age)23                              -5.16536    0.59930  -8.619
## as.factor(d.age)24                              -2.39999    0.53067  -4.523
## as.factor(d.age)25                               0.04710    0.06520   0.722
## as.factor(d.age)26                               0.02898    0.06109   0.474
## as.factor(educ_re3)high:as.factor(d.age)19      17.79087    0.71484  24.888
## as.factor(educ_re3)lesshigh:as.factor(d.age)19  18.62796    0.72690  25.627
## as.factor(educ_re3)somecol:as.factor(d.age)19   18.76302    0.66739  28.114
## as.factor(educ_re3)high:as.factor(d.age)20       3.76836    0.84889   4.439
## as.factor(educ_re3)lesshigh:as.factor(d.age)20   3.62357    0.93096   3.892
## as.factor(educ_re3)somecol:as.factor(d.age)20    3.59633    0.80465   4.469
## as.factor(educ_re3)high:as.factor(d.age)21       3.74307    0.79479   4.710
## as.factor(educ_re3)lesshigh:as.factor(d.age)21   3.58306    0.85962   4.168
## as.factor(educ_re3)somecol:as.factor(d.age)21    3.26507    0.88336   3.696
## as.factor(educ_re3)high:as.factor(d.age)22       2.13880    0.95860   2.231
## as.factor(educ_re3)lesshigh:as.factor(d.age)22   2.39471    1.09530   2.186
## as.factor(educ_re3)somecol:as.factor(d.age)22    3.32540    0.84527   3.934
## as.factor(educ_re3)high:as.factor(d.age)23       1.23014    0.80869   1.521
## as.factor(educ_re3)lesshigh:as.factor(d.age)23   1.81943    0.94066   1.934
## as.factor(educ_re3)somecol:as.factor(d.age)23    2.01356    0.73055   2.756
## as.factor(educ_re3)high:as.factor(d.age)24      -1.91503    0.78772  -2.431
## as.factor(educ_re3)lesshigh:as.factor(d.age)24  -0.30781    0.89958  -0.342
## as.factor(educ_re3)high:as.factor(d.age)25      -2.24607    0.46788  -4.800
## as.factor(educ_re3)lesshigh:as.factor(d.age)25  -0.14730    0.20467  -0.720
##                                                Pr(>|t|)    
## (Intercept)                                    1.88e-13 ***
## male_3                                         0.313636    
## as.factor(educ_re3)high                        2.07e-05 ***
## as.factor(educ_re3)lesshigh                    2.11e-05 ***
## as.factor(educ_re3)somecol                     2.02e-05 ***
## as.factor(d.age)19                              < 2e-16 ***
## as.factor(d.age)20                             2.36e-14 ***
## as.factor(d.age)21                             3.57e-13 ***
## as.factor(d.age)22                             2.88e-12 ***
## as.factor(d.age)23                             4.12e-13 ***
## as.factor(d.age)24                             2.04e-05 ***
## as.factor(d.age)25                             0.472162    
## as.factor(d.age)26                             0.636477    
## as.factor(educ_re3)high:as.factor(d.age)19      < 2e-16 ***
## as.factor(educ_re3)lesshigh:as.factor(d.age)19  < 2e-16 ***
## as.factor(educ_re3)somecol:as.factor(d.age)19   < 2e-16 ***
## as.factor(educ_re3)high:as.factor(d.age)20     2.79e-05 ***
## as.factor(educ_re3)lesshigh:as.factor(d.age)20 0.000201 ***
## as.factor(educ_re3)somecol:as.factor(d.age)20  2.49e-05 ***
## as.factor(educ_re3)high:as.factor(d.age)21     9.99e-06 ***
## as.factor(educ_re3)lesshigh:as.factor(d.age)21 7.57e-05 ***
## as.factor(educ_re3)somecol:as.factor(d.age)21  0.000394 ***
## as.factor(educ_re3)high:as.factor(d.age)22     0.028400 *  
## as.factor(educ_re3)lesshigh:as.factor(d.age)22 0.031639 *  
## as.factor(educ_re3)somecol:as.factor(d.age)22  0.000174 ***
## as.factor(educ_re3)high:as.factor(d.age)23     0.132069    
## as.factor(educ_re3)lesshigh:as.factor(d.age)23 0.056537 .  
## as.factor(educ_re3)somecol:as.factor(d.age)23  0.007204 ** 
## as.factor(educ_re3)high:as.factor(d.age)24     0.017233 *  
## as.factor(educ_re3)lesshigh:as.factor(d.age)24 0.733093    
## as.factor(educ_re3)high:as.factor(d.age)25     7.02e-06 ***
## as.factor(educ_re3)lesshigh:as.factor(d.age)25 0.473773    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 0.9009256)
## 
## Number of Fisher Scoring iterations: 16
exp(coef(m15))
##                        (Intercept)                             male_3 
##                       17.044022494                        0.750781353 
##            as.factor(educ_re3)high        as.factor(educ_re3)lesshigh 
##                        1.325623746                        1.419724567 
##         as.factor(educ_re3)somecol                 as.factor(d.age)19 
##                        1.627543856                        0.009217463 
##                 as.factor(d.age)20                 as.factor(d.age)21 
##                        0.014787479                        0.024085168 
##                 as.factor(d.age)22                 as.factor(d.age)23 
##                        0.019276559                        0.036420839 
##                 as.factor(d.age)24                 as.factor(d.age)25 
##                        0.043756771                        0.129907984 
##                 as.factor(d.age)26     male_3:as.factor(educ_re3)high 
##                        1.132477347                        0.928506602 
## male_3:as.factor(educ_re3)lesshigh  male_3:as.factor(educ_re3)somecol 
##                        1.360578145                        1.258943363
exp(coef(m16))
##                 (Intercept)                      male_3 
##                 12.27533306                  1.03906649 
##     as.factor(educ_re3)high as.factor(educ_re3)lesshigh 
##                  1.32132913                  1.67382562 
##  as.factor(educ_re3)somecol          as.factor(d.age)19 
##                  1.87139494                  0.01254125 
##          as.factor(d.age)20          as.factor(d.age)21 
##                  0.01924798                  0.02899125 
##          as.factor(d.age)22          as.factor(d.age)23 
##                  0.02673039                  0.03852542 
##          as.factor(d.age)24          as.factor(d.age)25 
##                  0.05529196                  1.08156175 
##          as.factor(d.age)26   male_3:as.factor(d.age)19 
##                  1.05835835                  0.70503212 
##   male_3:as.factor(d.age)20   male_3:as.factor(d.age)21 
##                  0.78890760                  0.92483091 
##   male_3:as.factor(d.age)22   male_3:as.factor(d.age)23 
##                  0.67851553                  1.12393310 
##   male_3:as.factor(d.age)24   male_3:as.factor(d.age)25 
##                  0.79200452                  0.09839919
exp(coef(m17))
##                                    (Intercept) 
##                                   2.419971e+02 
##                                         male_3 
##                                   8.539245e-01 
##                        as.factor(educ_re3)high 
##                                   8.868542e-02 
##                    as.factor(educ_re3)lesshigh 
##                                   8.607978e-02 
##                     as.factor(educ_re3)somecol 
##                                   8.705951e-02 
##                             as.factor(d.age)19 
##                                   1.181145e-10 
##                             as.factor(d.age)20 
##                                   4.716274e-04 
##                             as.factor(d.age)21 
##                                   9.100699e-04 
##                             as.factor(d.age)22 
##                                   1.323349e-03 
##                             as.factor(d.age)23 
##                                   5.710994e-03 
##                             as.factor(d.age)24 
##                                   9.071872e-02 
##                             as.factor(d.age)25 
##                                   1.048224e+00 
##                             as.factor(d.age)26 
##                                   1.029406e+00 
##     as.factor(educ_re3)high:as.factor(d.age)19 
##                                   5.326907e+07 
## as.factor(educ_re3)lesshigh:as.factor(d.age)19 
##                                   1.230329e+08 
##  as.factor(educ_re3)somecol:as.factor(d.age)19 
##                                   1.408236e+08 
##     as.factor(educ_re3)high:as.factor(d.age)20 
##                                   4.330916e+01 
## as.factor(educ_re3)lesshigh:as.factor(d.age)20 
##                                   3.747099e+01 
##  as.factor(educ_re3)somecol:as.factor(d.age)20 
##                                   3.646407e+01 
##     as.factor(educ_re3)high:as.factor(d.age)21 
##                                   4.222744e+01 
## as.factor(educ_re3)lesshigh:as.factor(d.age)21 
##                                   3.598338e+01 
##  as.factor(educ_re3)somecol:as.factor(d.age)21 
##                                   2.618200e+01 
##     as.factor(educ_re3)high:as.factor(d.age)22 
##                                   8.489255e+00 
## as.factor(educ_re3)lesshigh:as.factor(d.age)22 
##                                   1.096506e+01 
##  as.factor(educ_re3)somecol:as.factor(d.age)22 
##                                   2.781017e+01 
##     as.factor(educ_re3)high:as.factor(d.age)23 
##                                   3.421721e+00 
## as.factor(educ_re3)lesshigh:as.factor(d.age)23 
##                                   6.168326e+00 
##  as.factor(educ_re3)somecol:as.factor(d.age)23 
##                                   7.489951e+00 
##     as.factor(educ_re3)high:as.factor(d.age)24 
##                                   1.473373e-01 
## as.factor(educ_re3)lesshigh:as.factor(d.age)24 
##                                   7.350516e-01 
##     as.factor(educ_re3)high:as.factor(d.age)25 
##                                   1.058145e-01 
## as.factor(educ_re3)lesshigh:as.factor(d.age)25 
##                                   8.630360e-01