library(car)
## Loading required package: carData
library(stargazer)
## 
## Please cite as:
##  Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
library(survey)
## Loading required package: grid
## Loading required package: Matrix
## Loading required package: survival
## 
## Attaching package: 'survey'
## The following object is masked from 'package:graphics':
## 
##     dotchart
library(questionr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:car':
## 
##     recode
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.6     v stringr 1.4.0
## v tidyr   1.1.4     v forcats 0.5.1
## v readr   2.1.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x tidyr::expand() masks Matrix::expand()
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## x tidyr::pack()   masks Matrix::pack()
## x dplyr::recode() masks car::recode()
## x purrr::some()   masks car::some()
## x tidyr::unpack() masks Matrix::unpack()
library(broom)
library(emmeans)
library(table1)
## 
## Attaching package: 'table1'
## The following objects are masked from 'package:base':
## 
##     units, units<-
library(ggplot2)
library(haven)
X37166_0005_Data <- read_sav("37166-0005-Data.sav")
View(X37166_0005_Data)
nams<-names(X37166_0005_Data)
head(nams, n=10)
##  [1] "STUDYID"      "WAVE3_WEIGHT" "W3Q01"        "W3Q02"        "W3Q03"       
##  [6] "W3Q04"        "W3Q05"        "W3Q06"        "W3Q07"        "W3Q08"
newnames<-tolower(gsub(pattern = "_",replacement =  "",x =  nams))
names(X37166_0005_Data)<-newnames
X37166_0005_Data$wish_death<-Recode(X37166_0005_Data$w3q82, recodes="1=0; 2=1;else=NA")
summary(X37166_0005_Data$wish_death, na.rm = TRUE)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## 0.00000 0.00000 0.00000 0.09855 0.00000 1.00000      17
X37166_0005_Data$plan_death<-Recode(X37166_0005_Data$w3q83, recodes="1=0; 2=1;else=NA")
summary(X37166_0005_Data$plan_death, na.rm = TRUE)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##  0.0000  0.0000  0.0000  0.2656  1.0000  1.0000      18
X37166_0005_Data$attempt_suicide<-Recode(X37166_0005_Data$w3q84, recodes="1=0; 2=1;else=NA")
summary(X37166_0005_Data$attempt_suicide, na.rm = TRUE)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
## 0.00000 0.00000 0.00000 0.02032 0.00000 1.00000      18
##educ
X37166_0005_Data$educ<-Recode(X37166_0005_Data$geduc2, recodes="1=1; 2=0;else=NA")
summary(X37166_0005_Data$educ, na.rm = TRUE)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  0.0000  0.1556  0.0000  1.0000
X37166_0005_Data$grace <- as.numeric(X37166_0005_Data$grace)

X37166_0005_Data$race<-Recode(X37166_0005_Data$grace, recodes="1='white'; 3='black'; 5='hispanic'; else=NA", as.factor=T)
X37166_0005_Data$race<-relevel(X37166_0005_Data$race, ref='white')
summary(X37166_0005_Data$race, na.rm = TRUE)
##    white    black hispanic     NA's 
##      540       70       86       11
X37166_0005_Data$w3q20 <- as.numeric(X37166_0005_Data$w3q20)
X37166_0005_Data$geniden<-Recode(X37166_0005_Data$w3q20, recodes="1='female'; 2='male'; 3:5='nonbin/trans'; else=NA", as.factor=T)
X37166_0005_Data$geniden<-relevel(X37166_0005_Data$geniden, ref='female')
summary(X37166_0005_Data$geniden, na.rm = TRUE)
##       female         male nonbin/trans         NA's 
##          317          325           53           12
X37166_0005_Data$w3sexminid <- as.numeric(X37166_0005_Data$w3sexminid)
X37166_0005_Data$sexuality<-Recode(X37166_0005_Data$w3sexminid, recodes="1='les/gay'; 2='bisexual'; 3='other'; else=NA", as.factor=T)
X37166_0005_Data$sexuality<-relevel(X37166_0005_Data$sexuality, ref='bisexual')
summary(X37166_0005_Data$sexuality, na.rm = TRUE)
## bisexual  les/gay    other     NA's 
##      189      419       93        6
X37166_0005_Data$w3cohort <- as.numeric(X37166_0005_Data$w3cohort)
X37166_0005_Data$agecohort<-Recode(X37166_0005_Data$w3cohort, recodes="1='younger'; 2='middle'; 3='older'; else=NA", as.factor=T)
X37166_0005_Data$agecohort<-relevel(X37166_0005_Data$agecohort, ref='older')
summary(X37166_0005_Data$agecohort, na.rm = TRUE)
##   older  middle younger 
##     274     157     276
X37166_0005_Data$soimp<-Recode(X37166_0005_Data$w3q25, recodes="1:3=1; 4:6=0;else=NA")
X37166_0005_Data$lgbimp<-Recode(X37166_0005_Data$w3q27, recodes="1:3=1; 4:6=0;else=NA")
X37166_0005_Data$parlgbcom<-Recode(X37166_0005_Data$w3q30, recodes="1:2=1; 3:4=0;else=NA")
X37166_0005_Data$poslgbcom<-Recode(X37166_0005_Data$w3q31, recodes="1:2=1; 3:4=0;else=NA")
X37166_0005_Data$bondlgbcom<-Recode(X37166_0005_Data$w3q32, recodes="1:2=1; 3:4=0;else=NA")
X37166_0005_Data$proudlgbcom<-Recode(X37166_0005_Data$w3q33, recodes="1:2=1; 3:4=0;else=NA")
X37166_0005_Data$imppolactlgbcom<-Recode(X37166_0005_Data$w3q34, recodes="1:2=1; 3:4=0;else=NA")
sub<-X37166_0005_Data%>%
  select(attempt_suicide, wish_death, plan_death, geniden, educ, sexuality, race, agecohort, soimp, lgbimp, parlgbcom, poslgbcom, bondlgbcom, proudlgbcom, imppolactlgbcom, wave3weight) %>%
  filter( complete.cases( . ))
table1(~ sexuality + geniden + educ + race + agecohort + sexuality + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom
      + proudlgbcom + imppolactlgbcom| attempt_suicide,  data=sub, overall="Total")
## Warning in table1.formula(~sexuality + geniden + educ + race + agecohort + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
0
(N=632)
1
(N=14)
Total
(N=646)
sexuality
bisexual 174 (27.5%) 6 (42.9%) 180 (27.9%)
les/gay 377 (59.7%) 4 (28.6%) 381 (59.0%)
other 81 (12.8%) 4 (28.6%) 85 (13.2%)
geniden
female 281 (44.5%) 6 (42.9%) 287 (44.4%)
male 305 (48.3%) 3 (21.4%) 308 (47.7%)
nonbin/trans 46 (7.3%) 5 (35.7%) 51 (7.9%)
High school or less
Mean (SD) 0.152 (0.359) 0.357 (0.497) 0.156 (0.363)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
race
white 493 (78.0%) 12 (85.7%) 505 (78.2%)
black 61 (9.7%) 1 (7.1%) 62 (9.6%)
hispanic 78 (12.3%) 1 (7.1%) 79 (12.2%)
agecohort
older 247 (39.1%) 1 (7.1%) 248 (38.4%)
middle 136 (21.5%) 3 (21.4%) 139 (21.5%)
younger 249 (39.4%) 10 (71.4%) 259 (40.1%)
My sexual orientation is a central part of my identity.
Mean (SD) 0.411 (0.492) 0.357 (0.497) 0.410 (0.492)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
Being an LGB person is a very important aspect of my life.
Mean (SD) 0.328 (0.470) 0.143 (0.363) 0.324 (0.468)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
You feel you're a part of the LGBT community.
Mean (SD) 0.608 (0.489) 0.857 (0.363) 0.613 (0.487)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
Participating in the LGBT community is a positive thing for you.
Mean (SD) 0.742 (0.438) 0.857 (0.363) 0.745 (0.436)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You feel a bond with the LGBT community.
Mean (SD) 0.633 (0.482) 0.929 (0.267) 0.639 (0.481)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You are proud of the LGBT community.
Mean (SD) 0.862 (0.345) 0.857 (0.363) 0.862 (0.345)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
It is important for you to be politically active in the LGBT community.
Mean (SD) 0.568 (0.496) 0.786 (0.426) 0.573 (0.495)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
table1(~ sexuality + geniden + educ + race + agecohort + sexuality + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom
      + proudlgbcom + imppolactlgbcom| plan_death,  data=sub, overall="Total")
## Warning in table1.formula(~sexuality + geniden + educ + race + agecohort + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
0
(N=480)
1
(N=166)
Total
(N=646)
sexuality
bisexual 121 (25.2%) 59 (35.5%) 180 (27.9%)
les/gay 316 (65.8%) 65 (39.2%) 381 (59.0%)
other 43 (9.0%) 42 (25.3%) 85 (13.2%)
geniden
female 212 (44.2%) 75 (45.2%) 287 (44.4%)
male 243 (50.6%) 65 (39.2%) 308 (47.7%)
nonbin/trans 25 (5.2%) 26 (15.7%) 51 (7.9%)
High school or less
Mean (SD) 0.135 (0.343) 0.217 (0.413) 0.156 (0.363)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
race
white 381 (79.4%) 124 (74.7%) 505 (78.2%)
black 45 (9.4%) 17 (10.2%) 62 (9.6%)
hispanic 54 (11.3%) 25 (15.1%) 79 (12.2%)
agecohort
older 197 (41.0%) 51 (30.7%) 248 (38.4%)
middle 116 (24.2%) 23 (13.9%) 139 (21.5%)
younger 167 (34.8%) 92 (55.4%) 259 (40.1%)
My sexual orientation is a central part of my identity.
Mean (SD) 0.417 (0.494) 0.392 (0.490) 0.410 (0.492)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
Being an LGB person is a very important aspect of my life.
Mean (SD) 0.333 (0.472) 0.295 (0.458) 0.324 (0.468)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
You feel you're a part of the LGBT community.
Mean (SD) 0.642 (0.480) 0.530 (0.501) 0.613 (0.487)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
Participating in the LGBT community is a positive thing for you.
Mean (SD) 0.758 (0.429) 0.705 (0.458) 0.745 (0.436)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You feel a bond with the LGBT community.
Mean (SD) 0.640 (0.481) 0.639 (0.482) 0.639 (0.481)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You are proud of the LGBT community.
Mean (SD) 0.865 (0.343) 0.855 (0.353) 0.862 (0.345)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
It is important for you to be politically active in the LGBT community.
Mean (SD) 0.575 (0.495) 0.566 (0.497) 0.573 (0.495)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
table1(~ sexuality + geniden + educ + race + agecohort + sexuality + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom
      + proudlgbcom + imppolactlgbcom| wish_death,  data=sub, overall="Total")
## Warning in table1.formula(~sexuality + geniden + educ + race + agecohort + :
## Terms to the right of '|' in formula 'x' define table columns and are expected
## to be factors with meaningful labels.
0
(N=583)
1
(N=63)
Total
(N=646)
sexuality
bisexual 156 (26.8%) 24 (38.1%) 180 (27.9%)
les/gay 357 (61.2%) 24 (38.1%) 381 (59.0%)
other 70 (12.0%) 15 (23.8%) 85 (13.2%)
geniden
female 264 (45.3%) 23 (36.5%) 287 (44.4%)
male 282 (48.4%) 26 (41.3%) 308 (47.7%)
nonbin/trans 37 (6.3%) 14 (22.2%) 51 (7.9%)
High school or less
Mean (SD) 0.132 (0.339) 0.381 (0.490) 0.156 (0.363)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
race
white 464 (79.6%) 41 (65.1%) 505 (78.2%)
black 53 (9.1%) 9 (14.3%) 62 (9.6%)
hispanic 66 (11.3%) 13 (20.6%) 79 (12.2%)
agecohort
older 234 (40.1%) 14 (22.2%) 248 (38.4%)
middle 132 (22.6%) 7 (11.1%) 139 (21.5%)
younger 217 (37.2%) 42 (66.7%) 259 (40.1%)
My sexual orientation is a central part of my identity.
Mean (SD) 0.410 (0.492) 0.413 (0.496) 0.410 (0.492)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
Being an LGB person is a very important aspect of my life.
Mean (SD) 0.324 (0.468) 0.317 (0.469) 0.324 (0.468)
Median [Min, Max] 0 [0, 1.00] 0 [0, 1.00] 0 [0, 1.00]
You feel you're a part of the LGBT community.
Mean (SD) 0.617 (0.486) 0.571 (0.499) 0.613 (0.487)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
Participating in the LGBT community is a positive thing for you.
Mean (SD) 0.746 (0.436) 0.730 (0.447) 0.745 (0.436)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You feel a bond with the LGBT community.
Mean (SD) 0.640 (0.480) 0.635 (0.485) 0.639 (0.481)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
You are proud of the LGBT community.
Mean (SD) 0.868 (0.339) 0.810 (0.396) 0.862 (0.345)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
It is important for you to be politically active in the LGBT community.
Mean (SD) 0.573 (0.495) 0.571 (0.499) 0.573 (0.495)
Median [Min, Max] 1.00 [0, 1.00] 1.00 [0, 1.00] 1.00 [0, 1.00]
options(survey.lonely.psu = "adjust")
des<-svydesign(ids= ~1,
               
               weights= ~wave3weight
               , data = sub )

fit.logit1<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit2<-svyglm(attempt_suicide ~ race + agecohort + educ + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit3<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit4<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + soimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit5<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + lgbimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit6<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + parlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit7<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + poslgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit8<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + bondlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit9<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + proudlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit10<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit11<-svyglm(attempt_suicide ~ race + agecohort + educ + sexuality + geniden + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom + proudlgbcom + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit1%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.203 1.071 -4.859 0.000 0.005 0.001 0.045
raceblack -1.649 1.246 -1.323 0.186 0.192 0.017 2.211
racehispanic -1.255 1.050 -1.195 0.233 0.285 0.036 2.233
agecohortmiddle 2.426 1.285 1.887 0.060 11.310 0.911 140.491
agecohortyounger 2.842 1.094 2.596 0.010 17.142 2.006 146.460
educ 0.750 0.713 1.052 0.293 2.117 0.523 8.563
sexualityles/gay -1.619 0.866 -1.870 0.062 0.198 0.036 1.081
sexualityother -0.689 0.796 -0.865 0.387 0.502 0.106 2.389
fit.logit2%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.991 1.098 -5.455 0.000 0.003 0.000 0.022
raceblack -1.708 1.271 -1.343 0.180 0.181 0.015 2.191
racehispanic -1.337 1.062 -1.259 0.208 0.263 0.033 2.105
agecohortmiddle 2.958 1.361 2.173 0.030 19.261 1.336 277.713
agecohortyounger 3.053 1.074 2.843 0.005 21.180 2.582 173.754
educ 0.818 0.760 1.076 0.282 2.265 0.511 10.037
genidenmale -1.677 0.906 -1.851 0.065 0.187 0.032 1.104
genidennonbin/trans 1.266 0.741 1.708 0.088 3.547 0.830 15.160
fit.logit3%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.502 1.150 -4.784 0.000 0.004 0.000 0.039
raceblack -1.710 1.205 -1.419 0.156 0.181 0.017 1.919
racehispanic -1.190 1.030 -1.155 0.249 0.304 0.040 2.293
agecohortmiddle 2.839 1.386 2.049 0.041 17.097 1.130 258.578
agecohortyounger 2.993 1.128 2.653 0.008 19.949 2.186 182.030
educ 0.820 0.727 1.128 0.260 2.270 0.546 9.433
sexualityles/gay -1.139 0.821 -1.387 0.166 0.320 0.064 1.600
sexualityother -1.263 0.686 -1.841 0.066 0.283 0.074 1.085
genidenmale -1.345 0.841 -1.599 0.110 0.261 0.050 1.354
genidennonbin/trans 1.629 0.693 2.350 0.019 5.101 1.311 19.848
fit.logit4%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.336 1.152 -4.634 0.000 0.005 0.001 0.046
raceblack -1.742 1.230 -1.416 0.157 0.175 0.016 1.953
racehispanic -1.219 1.027 -1.186 0.236 0.296 0.039 2.215
agecohortmiddle 2.894 1.403 2.062 0.040 18.061 1.155 282.537
agecohortyounger 3.020 1.134 2.664 0.008 20.493 2.221 189.075
educ 0.821 0.722 1.137 0.256 2.272 0.552 9.352
sexualityles/gay -1.204 0.858 -1.404 0.161 0.300 0.056 1.612
sexualityother -1.316 0.660 -1.996 0.046 0.268 0.074 0.977
genidenmale -1.307 0.854 -1.530 0.127 0.271 0.051 1.444
genidennonbin/trans 1.591 0.666 2.387 0.017 4.909 1.329 18.126
soimp -0.449 0.744 -0.603 0.547 0.639 0.149 2.744
fit.logit5%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.202 1.170 -4.447 0.000 0.006 0.001 0.055
raceblack -1.812 1.273 -1.423 0.155 0.163 0.013 1.980
racehispanic -1.202 1.025 -1.173 0.241 0.300 0.040 2.240
agecohortmiddle 2.972 1.391 2.137 0.033 19.537 1.279 298.396
agecohortyounger 2.998 1.152 2.601 0.010 20.039 2.094 191.784
educ 0.881 0.734 1.200 0.231 2.414 0.572 10.176
sexualityles/gay -1.250 0.866 -1.445 0.149 0.286 0.053 1.562
sexualityother -1.215 0.643 -1.889 0.059 0.297 0.084 1.047
genidenmale -1.345 0.850 -1.582 0.114 0.261 0.049 1.379
genidennonbin/trans 1.484 0.685 2.165 0.031 4.410 1.151 16.897
lgbimp -1.285 0.947 -1.357 0.175 0.277 0.043 1.770
fit.logit6%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -6.938 1.633 -4.248 0.000 0.001 0.000 0.024
raceblack -1.776 1.160 -1.531 0.126 0.169 0.017 1.646
racehispanic -1.281 1.012 -1.266 0.206 0.278 0.038 2.017
agecohortmiddle 3.077 1.383 2.226 0.026 21.700 1.444 326.201
agecohortyounger 2.978 1.145 2.600 0.010 19.642 2.081 185.444
educ 0.714 0.694 1.029 0.304 2.042 0.524 7.957
sexualityles/gay -1.216 0.817 -1.487 0.137 0.296 0.060 1.472
sexualityother -1.355 0.695 -1.950 0.052 0.258 0.066 1.007
genidenmale -1.452 0.884 -1.643 0.101 0.234 0.041 1.324
genidennonbin/trans 1.373 0.708 1.940 0.053 3.948 0.986 15.811
parlgbcom 1.985 1.005 1.975 0.049 7.282 1.015 52.246
fit.logit7%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.918 1.347 -4.394 0.000 0.003 0.000 0.038
raceblack -1.731 1.212 -1.429 0.154 0.177 0.016 1.904
racehispanic -1.153 1.016 -1.135 0.257 0.316 0.043 2.312
agecohortmiddle 2.873 1.394 2.061 0.040 17.698 1.152 271.911
agecohortyounger 2.928 1.125 2.603 0.009 18.694 2.061 169.546
educ 0.809 0.740 1.093 0.275 2.246 0.526 9.587
sexualityles/gay -1.224 0.829 -1.476 0.140 0.294 0.058 1.494
sexualityother -1.331 0.678 -1.963 0.050 0.264 0.070 0.998
genidenmale -1.290 0.852 -1.513 0.131 0.275 0.052 1.463
genidennonbin/trans 1.627 0.702 2.319 0.021 5.088 1.286 20.127
poslgbcom 0.593 0.913 0.649 0.516 1.809 0.302 10.828
fit.logit8%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -9.123 2.112 -4.319 0.000 0.000 0.000 0.007
raceblack -1.737 1.158 -1.500 0.134 0.176 0.018 1.705
racehispanic -1.217 1.021 -1.192 0.234 0.296 0.040 2.190
agecohortmiddle 2.994 1.346 2.224 0.026 19.972 1.427 279.520
agecohortyounger 3.047 1.145 2.662 0.008 21.043 2.233 198.318
educ 0.727 0.679 1.070 0.285 2.068 0.546 7.828
sexualityles/gay -1.083 0.839 -1.291 0.197 0.339 0.065 1.752
sexualityother -1.322 0.698 -1.892 0.059 0.267 0.068 1.048
genidenmale -1.182 0.867 -1.364 0.173 0.307 0.056 1.677
genidennonbin/trans 1.339 0.723 1.851 0.065 3.816 0.924 15.750
bondlgbcom 4.083 1.077 3.791 0.000 59.325 7.186 489.741
fit.logit9%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -5.364 1.578 -3.400 0.001 0.005 0.000 0.103
raceblack -1.684 1.334 -1.262 0.207 0.186 0.014 2.537
racehispanic -1.177 1.035 -1.137 0.256 0.308 0.041 2.344
agecohortmiddle 2.811 1.311 2.145 0.032 16.629 1.274 217.095
agecohortyounger 2.977 1.134 2.624 0.009 19.619 2.123 181.263
educ 0.810 0.734 1.105 0.270 2.249 0.534 9.472
sexualityles/gay -1.124 0.871 -1.291 0.197 0.325 0.059 1.792
sexualityother -1.247 0.696 -1.792 0.074 0.287 0.073 1.124
genidenmale -1.366 0.926 -1.476 0.141 0.255 0.042 1.566
genidennonbin/trans 1.613 0.729 2.211 0.027 5.017 1.201 20.956
proudlgbcom -0.138 1.149 -0.120 0.904 0.871 0.092 8.282
fit.logit10%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -6.297 1.408 -4.471 0.000 0.002 0.000 0.029
raceblack -1.809 1.256 -1.440 0.150 0.164 0.014 1.920
racehispanic -1.097 1.035 -1.060 0.289 0.334 0.044 2.538
agecohortmiddle 3.019 1.469 2.056 0.040 20.469 1.151 364.134
agecohortyounger 2.854 1.171 2.438 0.015 17.359 1.750 172.152
educ 0.903 0.754 1.198 0.231 2.468 0.563 10.821
sexualityles/gay -1.298 0.912 -1.423 0.155 0.273 0.046 1.633
sexualityother -1.325 0.636 -2.084 0.038 0.266 0.076 0.924
genidenmale -1.315 0.845 -1.557 0.120 0.268 0.051 1.406
genidennonbin/trans 1.654 0.686 2.412 0.016 5.226 1.364 20.033
imppolactlgbcom 1.230 0.833 1.477 0.140 3.421 0.669 17.494
fit.logit11%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -8.509 2.368 -3.594 0.000 0.000 0.000 0.021
raceblack -1.698 1.235 -1.375 0.170 0.183 0.016 2.060
racehispanic -1.419 1.266 -1.120 0.263 0.242 0.020 2.896
agecohortmiddle 2.746 1.220 2.250 0.025 15.575 1.424 170.333
agecohortyounger 2.858 1.153 2.479 0.013 17.429 1.819 167.034
educ 0.616 0.825 0.747 0.455 1.852 0.368 9.324
sexualityles/gay -1.169 1.022 -1.144 0.253 0.311 0.042 2.303
sexualityother -1.182 0.739 -1.599 0.110 0.307 0.072 1.306
genidenmale -1.144 0.912 -1.255 0.210 0.318 0.053 1.902
genidennonbin/trans 1.318 0.860 1.533 0.126 3.735 0.693 20.143
soimp 0.467 0.871 0.536 0.592 1.595 0.289 8.801
lgbimp -0.307 1.208 -0.254 0.799 0.735 0.069 7.853
parlgbcom 0.854 1.189 0.718 0.473 2.350 0.228 24.165
poslgbcom -1.275 1.018 -1.252 0.211 0.279 0.038 2.057
bondlgbcom 4.324 1.624 2.663 0.008 75.519 3.132 1820.985
proudlgbcom -1.989 1.316 -1.511 0.131 0.137 0.010 1.806
imppolactlgbcom 1.881 1.079 1.742 0.082 6.557 0.791 54.388
exp(coefficients(fit.logit1))
##      (Intercept)        raceblack     racehispanic  agecohortmiddle 
##      0.005499169      0.192289755      0.285124090     11.310297876 
## agecohortyounger             educ sexualityles/gay   sexualityother 
##     17.142151428      2.116898452      0.198178805      0.502328423
exp(coefficients(fit.logit2))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.002500245         0.181276826         0.262612652        19.261376692 
##    agecohortyounger                educ         genidenmale genidennonbin/trans 
##        21.180147970         2.265038506         0.186944196         3.546880950
exp(coefficients(fit.logit3))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.004077586         0.180884165         0.304335824        17.097423999 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        19.948820804         2.270341945         0.320247934         0.282810915 
##         genidenmale genidennonbin/trans 
##         0.260612630         5.100582827
exp(coefficients(fit.logit4))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.004812983         0.175094643         0.295633263        18.060819923 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        20.493133508         2.271953637         0.299895626         0.268080160 
##         genidenmale genidennonbin/trans               soimp 
##         0.270580416         4.908989491         0.638560570
exp(coefficients(fit.logit5))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.005504497         0.163253493         0.300470595        19.537105739 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        20.039239830         2.413646903         0.286385280         0.296779162 
##         genidenmale genidennonbin/trans              lgbimp 
##         0.260652944         4.409571045         0.276671038
exp(coefficients(fit.logit6))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.000970381         0.169291533         0.277770880        21.700166928 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        19.642257009         2.041780434         0.296437890         0.257885502 
##         genidenmale genidennonbin/trans           parlgbcom 
##         0.234129512         3.947975613         7.281507831
exp(coefficients(fit.logit7))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.002690346         0.177101280         0.315836538        17.697988602 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        18.693643944         2.245994161         0.293956509         0.264283737 
##         genidenmale genidennonbin/trans           poslgbcom 
##         0.275351838         5.088024700         1.809231533
exp(coefficients(fit.logit8))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##        1.091779e-04        1.760524e-01        2.961870e-01        1.997194e+01 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        2.104324e+01        2.068135e+00        3.386045e-01        2.667314e-01 
##         genidenmale genidennonbin/trans          bondlgbcom 
##        3.066091e-01        3.815597e+00        5.932451e+01
exp(coefficients(fit.logit9))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.004681283         0.185586649         0.308158587        16.629342125 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        19.619108889         2.248699426         0.324845296         0.287277070 
##         genidenmale genidennonbin/trans         proudlgbcom 
##         0.255126349         5.017393261         0.870795335
exp(coefficients(fit.logit10))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##         0.001842338         0.163895259         0.333758794        20.468955801 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        17.359035097         2.467869801         0.273066040         0.265820864 
##         genidenmale genidennonbin/trans     imppolactlgbcom 
##         0.268352424         5.226476067         3.421302359
exp(coefficients(fit.logit11))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##        2.015875e-04        1.830522e-01        2.420100e-01        1.557490e+01 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##        1.742860e+01        1.851619e+00        3.105643e-01        3.066897e-01 
##         genidenmale genidennonbin/trans               soimp              lgbimp 
##        3.184028e-01        3.734985e+00        1.594762e+00        7.353544e-01 
##           parlgbcom           poslgbcom          bondlgbcom         proudlgbcom 
##        2.349675e+00        2.794277e-01        7.551870e+01        1.368683e-01 
##     imppolactlgbcom 
##        6.557226e+00
## With survey design "interesting cases" Race and Sexual Identity
rg<-ref_grid(fit.logit3)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "sexuality"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race sexuality prob SE df asymp.LCL asymp.UCL
white bisexual 0.0451 0.0254 Inf 0.0146 0.1306
black bisexual 0.0085 0.0084 Inf 0.0012 0.0567
hispanic bisexual 0.0142 0.0152 Inf 0.0017 0.1089
white les/gay 0.0149 0.0107 Inf 0.0036 0.0592
black les/gay 0.0027 0.0045 Inf 0.0001 0.0657
hispanic les/gay 0.0046 0.0052 Inf 0.0005 0.0409
white other 0.0132 0.0095 Inf 0.0032 0.0529
black other 0.0024 0.0030 Inf 0.0002 0.0269
hispanic other 0.0040 0.0058 Inf 0.0002 0.0629
## With survey design "interesting cases" Race and Gender Identity
rg<-ref_grid(fit.logit3)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "geniden"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race geniden prob SE df asymp.LCL asymp.UCL
white female 0.0189 0.0099 Inf 0.0067 0.0520
black female 0.0035 0.0048 Inf 0.0002 0.0498
hispanic female 0.0058 0.0064 Inf 0.0007 0.0480
white male 0.0050 0.0044 Inf 0.0009 0.0272
black male 0.0009 0.0012 Inf 0.0001 0.0127
hispanic male 0.0015 0.0020 Inf 0.0001 0.0194
white nonbin/trans 0.0895 0.0516 Inf 0.0277 0.2537
black nonbin/trans 0.0175 0.0217 Inf 0.0015 0.1742
hispanic nonbin/trans 0.0291 0.0364 Inf 0.0024 0.2729
## With survey design "interesting cases" Race and Age Cohort
rg<-ref_grid(fit.logit3)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "agecohort"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race agecohort prob SE df asymp.LCL asymp.UCL
white older 0.0030 0.0034 Inf 0.0003 0.0266
black older 0.0005 0.0009 Inf 0.0000 0.0133
hispanic older 0.0009 0.0014 Inf 0.0000 0.0186
white middle 0.0493 0.0390 Inf 0.0101 0.2092
black middle 0.0093 0.0121 Inf 0.0007 0.1088
hispanic middle 0.0155 0.0202 Inf 0.0012 0.1733
white younger 0.0571 0.0238 Inf 0.0248 0.1259
black younger 0.0108 0.0137 Inf 0.0009 0.1186
hispanic younger 0.0181 0.0190 Inf 0.0023 0.1306
options(survey.lonely.psu = "adjust")
des<-svydesign(ids= ~1,
               
               weights= ~wave3weight
               , data = sub )

fit.logit12<-svyglm(plan_death ~ race + agecohort + educ + sexuality,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit13<-svyglm(plan_death ~ race + agecohort + educ + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit14<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit15<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + soimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit16<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + lgbimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit17<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + parlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit18<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + poslgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit19<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + bondlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit20<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + proudlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit21<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit22<-svyglm(plan_death ~ race + agecohort + educ + sexuality + geniden + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom + proudlgbcom + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit12%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.646 0.319 -2.027 0.043 0.524 0.281 0.979
raceblack -0.246 0.406 -0.606 0.545 0.782 0.353 1.732
racehispanic 0.411 0.339 1.211 0.226 1.508 0.776 2.931
agecohortmiddle -0.734 0.369 -1.988 0.047 0.480 0.233 0.990
agecohortyounger 0.049 0.320 0.155 0.877 1.051 0.561 1.966
educ 0.433 0.283 1.530 0.127 1.542 0.885 2.685
sexualityles/gay -1.039 0.313 -3.324 0.001 0.354 0.192 0.653
sexualityother 0.616 0.369 1.668 0.096 1.852 0.898 3.818
fit.logit13%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -1.364 0.243 -5.624 0.000 0.256 0.159 0.411
raceblack -0.293 0.426 -0.689 0.491 0.746 0.323 1.719
racehispanic 0.278 0.327 0.848 0.397 1.320 0.695 2.508
agecohortmiddle -0.194 0.364 -0.534 0.593 0.823 0.404 1.680
agecohortyounger 0.602 0.258 2.330 0.020 1.826 1.100 3.030
educ 0.372 0.277 1.341 0.180 1.450 0.842 2.498
genidenmale -0.301 0.276 -1.094 0.275 0.740 0.431 1.270
genidennonbin/trans 1.125 0.405 2.774 0.006 3.080 1.391 6.819
fit.logit14%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.751 0.329 -2.282 0.023 0.472 0.248 0.899
raceblack -0.307 0.428 -0.717 0.474 0.736 0.318 1.702
racehispanic 0.399 0.332 1.201 0.230 1.490 0.777 2.856
agecohortmiddle -0.688 0.363 -1.895 0.059 0.503 0.247 1.024
agecohortyounger 0.036 0.314 0.115 0.909 1.037 0.560 1.919
educ 0.436 0.281 1.552 0.121 1.547 0.891 2.685
sexualityles/gay -1.138 0.316 -3.604 0.000 0.320 0.173 0.595
sexualityother 0.398 0.393 1.013 0.312 1.489 0.689 3.219
genidenmale 0.242 0.292 0.829 0.407 1.274 0.719 2.256
genidennonbin/trans 0.990 0.413 2.400 0.017 2.692 1.199 6.043
fit.logit15%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.730 0.361 -2.022 0.044 0.482 0.238 0.978
raceblack -0.308 0.428 -0.719 0.472 0.735 0.318 1.701
racehispanic 0.395 0.330 1.196 0.232 1.484 0.777 2.836
agecohortmiddle -0.689 0.362 -1.901 0.058 0.502 0.247 1.022
agecohortyounger 0.035 0.314 0.113 0.910 1.036 0.559 1.919
educ 0.437 0.281 1.556 0.120 1.549 0.893 2.686
sexualityles/gay -1.144 0.321 -3.558 0.000 0.319 0.170 0.598
sexualityother 0.398 0.393 1.012 0.312 1.488 0.689 3.213
genidenmale 0.247 0.295 0.838 0.402 1.281 0.718 2.283
genidennonbin/trans 0.982 0.414 2.374 0.018 2.671 1.187 6.011
soimp -0.044 0.276 -0.160 0.873 0.957 0.557 1.643
fit.logit16%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.697 0.365 -1.910 0.057 0.498 0.243 1.019
raceblack -0.314 0.433 -0.726 0.468 0.730 0.313 1.707
racehispanic 0.399 0.331 1.207 0.228 1.490 0.780 2.849
agecohortmiddle -0.684 0.361 -1.892 0.059 0.505 0.248 1.025
agecohortyounger 0.035 0.315 0.111 0.911 1.036 0.558 1.922
educ 0.441 0.280 1.577 0.115 1.554 0.898 2.688
sexualityles/gay -1.165 0.333 -3.502 0.000 0.312 0.163 0.599
sexualityother 0.394 0.389 1.013 0.312 1.483 0.692 3.180
genidenmale 0.249 0.294 0.848 0.397 1.283 0.721 2.281
genidennonbin/trans 0.965 0.412 2.342 0.020 2.626 1.170 5.891
lgbimp -0.132 0.311 -0.426 0.670 0.876 0.476 1.611
fit.logit17%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.563 0.340 -1.655 0.098 0.570 0.292 1.109
raceblack -0.284 0.436 -0.650 0.516 0.753 0.320 1.770
racehispanic 0.448 0.332 1.347 0.179 1.565 0.816 3.001
agecohortmiddle -0.720 0.367 -1.961 0.050 0.487 0.237 1.000
agecohortyounger 0.032 0.309 0.104 0.918 1.033 0.563 1.893
educ 0.461 0.287 1.604 0.109 1.586 0.903 2.785
sexualityles/gay -1.119 0.318 -3.520 0.000 0.327 0.175 0.609
sexualityother 0.436 0.405 1.076 0.282 1.546 0.699 3.418
genidenmale 0.227 0.294 0.773 0.440 1.255 0.705 2.234
genidennonbin/trans 1.051 0.421 2.498 0.013 2.861 1.254 6.528
parlgbcom -0.348 0.288 -1.208 0.227 0.706 0.401 1.242
fit.logit18%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.308 0.386 -0.798 0.425 0.735 0.345 1.565
raceblack -0.295 0.431 -0.683 0.495 0.745 0.320 1.734
racehispanic 0.481 0.333 1.443 0.150 1.617 0.842 3.107
agecohortmiddle -0.726 0.354 -2.052 0.041 0.484 0.242 0.968
agecohortyounger 0.099 0.313 0.315 0.753 1.104 0.598 2.037
educ 0.426 0.283 1.507 0.132 1.531 0.880 2.664
sexualityles/gay -1.110 0.317 -3.497 0.001 0.330 0.177 0.614
sexualityother 0.464 0.403 1.151 0.250 1.591 0.722 3.507
genidenmale 0.190 0.294 0.645 0.519 1.209 0.679 2.151
genidennonbin/trans 0.990 0.420 2.358 0.019 2.690 1.182 6.125
poslgbcom -0.649 0.321 -2.023 0.043 0.523 0.279 0.980
fit.logit19%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.674 0.353 -1.909 0.057 0.510 0.255 1.018
raceblack -0.297 0.429 -0.692 0.489 0.743 0.320 1.723
racehispanic 0.409 0.332 1.232 0.219 1.505 0.785 2.884
agecohortmiddle -0.706 0.364 -1.938 0.053 0.494 0.242 1.008
agecohortyounger 0.022 0.310 0.071 0.943 1.022 0.556 1.879
educ 0.436 0.282 1.548 0.122 1.547 0.890 2.689
sexualityles/gay -1.143 0.313 -3.653 0.000 0.319 0.173 0.589
sexualityother 0.406 0.395 1.027 0.305 1.500 0.692 3.254
genidenmale 0.233 0.290 0.802 0.423 1.262 0.715 2.228
genidennonbin/trans 1.011 0.418 2.416 0.016 2.748 1.210 6.241
bondlgbcom -0.105 0.282 -0.372 0.710 0.900 0.518 1.565
fit.logit20%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.199 0.479 -0.416 0.677 0.819 0.321 2.093
raceblack -0.218 0.427 -0.509 0.611 0.804 0.348 1.859
racehispanic 0.451 0.331 1.361 0.174 1.569 0.820 3.004
agecohortmiddle -0.747 0.355 -2.104 0.036 0.474 0.236 0.950
agecohortyounger -0.016 0.313 -0.050 0.960 0.985 0.533 1.818
educ 0.427 0.281 1.521 0.129 1.533 0.884 2.657
sexualityles/gay -1.175 0.314 -3.744 0.000 0.309 0.167 0.571
sexualityother 0.394 0.400 0.986 0.325 1.483 0.677 3.249
genidenmale 0.191 0.289 0.662 0.509 1.211 0.687 2.134
genidennonbin/trans 0.982 0.416 2.362 0.018 2.670 1.182 6.031
proudlgbcom -0.579 0.399 -1.451 0.147 0.561 0.257 1.225
fit.logit21%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -0.696 0.348 -1.999 0.046 0.498 0.252 0.987
raceblack -0.300 0.430 -0.699 0.485 0.741 0.319 1.719
racehispanic 0.411 0.330 1.244 0.214 1.508 0.790 2.878
agecohortmiddle -0.694 0.361 -1.921 0.055 0.500 0.246 1.014
agecohortyounger 0.042 0.315 0.133 0.894 1.043 0.562 1.934
educ 0.433 0.281 1.539 0.124 1.541 0.888 2.674
sexualityles/gay -1.133 0.316 -3.590 0.000 0.322 0.174 0.598
sexualityother 0.397 0.395 1.006 0.315 1.488 0.686 3.226
genidenmale 0.234 0.292 0.802 0.423 1.264 0.713 2.241
genidennonbin/trans 0.992 0.413 2.404 0.017 2.697 1.201 6.057
imppolactlgbcom -0.100 0.273 -0.367 0.714 0.905 0.530 1.544
fit.logit22%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) 0.179 0.595 0.301 0.764 1.196 0.372 3.842
raceblack -0.247 0.441 -0.561 0.575 0.781 0.329 1.852
racehispanic 0.540 0.327 1.650 0.099 1.716 0.903 3.261
agecohortmiddle -0.709 0.351 -2.020 0.044 0.492 0.247 0.979
agecohortyounger 0.115 0.314 0.366 0.715 1.122 0.606 2.075
educ 0.473 0.281 1.686 0.092 1.605 0.926 2.782
sexualityles/gay -1.174 0.341 -3.448 0.001 0.309 0.159 0.602
sexualityother 0.469 0.398 1.178 0.239 1.598 0.732 3.487
genidenmale 0.200 0.298 0.671 0.502 1.221 0.681 2.188
genidennonbin/trans 0.899 0.432 2.080 0.038 2.458 1.053 5.736
soimp -0.032 0.318 -0.101 0.919 0.968 0.520 1.804
lgbimp -0.379 0.360 -1.052 0.293 0.685 0.338 1.387
parlgbcom -0.534 0.371 -1.440 0.150 0.586 0.283 1.213
poslgbcom -0.594 0.402 -1.476 0.140 0.552 0.251 1.215
bondlgbcom 0.497 0.375 1.323 0.186 1.643 0.787 3.429
proudlgbcom -0.488 0.453 -1.078 0.282 0.614 0.253 1.491
imppolactlgbcom 0.031 0.317 0.097 0.923 1.031 0.554 1.920
exp(coefficients(fit.logit12))
##      (Intercept)        raceblack     racehispanic  agecohortmiddle 
##        0.5242510        0.7821790        1.5078522        0.4799200 
## agecohortyounger             educ sexualityles/gay   sexualityother 
##        1.0506355        1.5417733        0.3538735        1.8516040
exp(coefficients(fit.logit13))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.2556736           0.7456632           1.3200158           0.8233836 
##    agecohortyounger                educ         genidenmale genidennonbin/trans 
##           1.8258448           1.4503990           0.7397830           3.0800862
exp(coefficients(fit.logit14))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.4718941           0.7359515           1.4899319           0.5027265 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0367100           1.5471783           0.3204104           1.4892836 
##         genidenmale genidennonbin/trans 
##           1.2735672           2.6921217
exp(coefficients(fit.logit15))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.4818757           0.7349503           1.4843132           0.5021612 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0360167           1.5485247           0.3186505           1.4881666 
##         genidenmale genidennonbin/trans               soimp 
##           1.2806169           2.6711200           0.9568336
exp(coefficients(fit.logit16))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.4979958           0.7304185           1.4902361           0.5046742 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0357094           1.5538818           0.3120761           1.4829223 
##         genidenmale genidennonbin/trans              lgbimp 
##           1.2827745           2.6258824           0.8759820
exp(coefficients(fit.logit17))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.5695215           0.7530911           1.5645426           0.4867161 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0325527           1.5855236           0.3267290           1.5459633 
##         genidenmale genidennonbin/trans           parlgbcom 
##           1.2554279           2.8614471           0.7059730
exp(coefficients(fit.logit18))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.7348701           0.7447347           1.6170974           0.4838065 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.1035219           1.5310584           0.3296387           1.5909399 
##         genidenmale genidennonbin/trans           poslgbcom 
##           1.2088617           2.6902937           0.5226908
exp(coefficients(fit.logit19))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.5097530           0.7428186           1.5049816           0.4938386 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0224169           1.5472490           0.3189972           1.5001056 
##         genidenmale genidennonbin/trans          bondlgbcom 
##           1.2620109           2.7483685           0.9003813
exp(coefficients(fit.logit20))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.8193711           0.8044505           1.5694415           0.4737265 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           0.9845538           1.5326392           0.3087767           1.4832254 
##         genidenmale genidennonbin/trans         proudlgbcom 
##           1.2107340           2.6697213           0.5605741
exp(coefficients(fit.logit21))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.4984092           0.7405435           1.5076435           0.4996785 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.0429468           1.5413294           0.3221427           1.4878516 
##         genidenmale genidennonbin/trans     imppolactlgbcom 
##           1.2641041           2.6972851           0.9047796
exp(coefficients(fit.logit22))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           1.1959627           0.7809377           1.7164385           0.4920133 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.1216699           1.6051639           0.3090498           1.5981123 
##         genidenmale genidennonbin/trans               soimp              lgbimp 
##           1.2210942           2.4579355           0.9683607           0.6846082 
##           parlgbcom           poslgbcom          bondlgbcom         proudlgbcom 
##           0.5859641           0.5520720           1.6430004           0.6138251 
##     imppolactlgbcom 
##           1.0312187
## With survey design "interesting cases" Race and Sexual Identity
rg<-ref_grid(fit.logit14)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "sexuality"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race sexuality prob SE df asymp.LCL asymp.UCL
white bisexual 0.4160 0.0662 Inf 0.2946 0.5485
black bisexual 0.3439 0.0998 Inf 0.1805 0.5551
hispanic bisexual 0.5149 0.0962 Inf 0.3328 0.6930
white les/gay 0.1858 0.0386 Inf 0.1215 0.2735
black les/gay 0.1438 0.0518 Inf 0.0686 0.2769
hispanic les/gay 0.2538 0.0621 Inf 0.1517 0.3927
white other 0.5147 0.0842 Inf 0.3540 0.6725
black other 0.4384 0.1243 Inf 0.2249 0.6774
hispanic other 0.6125 0.1095 Inf 0.3902 0.7961
## With survey design "interesting cases" Race and Gender Identity
rg<-ref_grid(fit.logit14)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "geniden"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race geniden prob SE df asymp.LCL asymp.UCL
white female 0.2696 0.0440 Inf 0.1924 0.3639
black female 0.2136 0.0702 Inf 0.1069 0.3813
hispanic female 0.3548 0.0809 Inf 0.2158 0.5236
white male 0.3198 0.0571 Inf 0.2194 0.4401
black male 0.2570 0.0818 Inf 0.1300 0.4447
hispanic male 0.4119 0.0907 Inf 0.2517 0.5933
white nonbin/trans 0.4984 0.0933 Inf 0.3235 0.6738
black nonbin/trans 0.4224 0.1278 Inf 0.2076 0.6712
hispanic nonbin/trans 0.5969 0.1100 Inf 0.3767 0.7839
## With survey design "interesting cases" Race and Age Cohort
rg<-ref_grid(fit.logit14)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "agecohort"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race agecohort prob SE df asymp.LCL asymp.UCL
white older 0.4089 0.0644 Inf 0.2909 0.5383
black older 0.3373 0.1053 Inf 0.1682 0.5617
hispanic older 0.5075 0.1055 Inf 0.3107 0.7020
white middle 0.2580 0.0628 Inf 0.1545 0.3982
black middle 0.2038 0.0739 Inf 0.0948 0.3847
hispanic middle 0.3413 0.0939 Inf 0.1860 0.5402
white younger 0.4176 0.0517 Inf 0.3209 0.5211
black younger 0.3454 0.0929 Inf 0.1909 0.5414
hispanic younger 0.5165 0.0738 Inf 0.3744 0.6560
options(survey.lonely.psu = "adjust")
des<-svydesign(ids= ~1,
               
               weights= ~wave3weight
               , data = sub )

fit.logit23<-svyglm(wish_death ~ race + agecohort + educ + sexuality,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit24<-svyglm(wish_death ~ race + agecohort + educ + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit25<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit26<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + soimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit27<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + lgbimp,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit28<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + parlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit29<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + poslgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit30<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + bondlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit31<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + proudlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit32<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit33<-svyglm(wish_death ~ race + agecohort + educ + sexuality + geniden + soimp + lgbimp + parlgbcom + poslgbcom + bondlgbcom + proudlgbcom + imppolactlgbcom,
                  design = des,
                  family = binomial)
## Warning in eval(family$initialize): non-integer #successes in a binomial glm!
fit.logit23%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.239 0.475 -4.717 0.000 0.107 0.042 0.270
raceblack 0.316 0.515 0.613 0.540 1.371 0.500 3.763
racehispanic 0.261 0.435 0.600 0.549 1.298 0.553 3.047
agecohortmiddle -0.628 0.667 -0.942 0.347 0.534 0.144 1.972
agecohortyounger 0.494 0.479 1.032 0.303 1.639 0.641 4.189
educ 1.161 0.352 3.297 0.001 3.192 1.601 6.365
sexualityles/gay -0.906 0.434 -2.088 0.037 0.404 0.173 0.946
sexualityother -0.193 0.492 -0.393 0.694 0.824 0.314 2.162
fit.logit24%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.927 0.407 -7.185 0.000 0.054 0.024 0.119
raceblack 0.341 0.513 0.664 0.507 1.406 0.514 3.845
racehispanic 0.170 0.449 0.379 0.705 1.186 0.491 2.861
agecohortmiddle -0.229 0.659 -0.347 0.728 0.795 0.219 2.893
agecohortyounger 0.842 0.409 2.056 0.040 2.320 1.040 5.176
educ 1.090 0.343 3.183 0.002 2.975 1.520 5.822
genidenmale -0.166 0.389 -0.428 0.669 0.847 0.395 1.814
genidennonbin/trans 0.808 0.542 1.490 0.137 2.243 0.775 6.491
fit.logit25%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.353 0.471 -5.000 0.000 0.095 0.038 0.239
raceblack 0.239 0.531 0.449 0.653 1.270 0.448 3.596
racehispanic 0.242 0.441 0.548 0.584 1.273 0.536 3.023
agecohortmiddle -0.540 0.643 -0.840 0.401 0.583 0.165 2.055
agecohortyounger 0.499 0.457 1.093 0.275 1.647 0.673 4.031
educ 1.171 0.357 3.278 0.001 3.225 1.601 6.493
sexualityles/gay -0.983 0.468 -2.101 0.036 0.374 0.150 0.936
sexualityother -0.454 0.526 -0.864 0.388 0.635 0.227 1.780
genidenmale 0.173 0.422 0.409 0.682 1.188 0.520 2.716
genidennonbin/trans 0.961 0.557 1.726 0.085 2.615 0.878 7.792
fit.logit26%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.266 0.525 -4.316 0.000 0.104 0.037 0.290
raceblack 0.234 0.523 0.449 0.654 1.264 0.454 3.521
racehispanic 0.224 0.444 0.505 0.614 1.251 0.524 2.988
agecohortmiddle -0.555 0.646 -0.858 0.391 0.574 0.162 2.039
agecohortyounger 0.490 0.459 1.066 0.287 1.632 0.663 4.014
educ 1.173 0.356 3.291 0.001 3.230 1.607 6.495
sexualityles/gay -1.007 0.487 -2.069 0.039 0.365 0.141 0.948
sexualityother -0.453 0.526 -0.861 0.389 0.635 0.226 1.783
genidenmale 0.192 0.432 0.445 0.656 1.212 0.520 2.825
genidennonbin/trans 0.923 0.558 1.654 0.099 2.517 0.843 7.518
soimp -0.164 0.392 -0.418 0.676 0.849 0.393 1.832
fit.logit27%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.326 0.519 -4.479 0.000 0.098 0.035 0.270
raceblack 0.235 0.532 0.443 0.658 1.265 0.446 3.586
racehispanic 0.241 0.443 0.544 0.587 1.273 0.534 3.032
agecohortmiddle -0.540 0.642 -0.841 0.400 0.583 0.166 2.050
agecohortyounger 0.499 0.457 1.093 0.275 1.648 0.673 4.034
educ 1.174 0.359 3.269 0.001 3.234 1.600 6.536
sexualityles/gay -0.997 0.501 -1.989 0.047 0.369 0.138 0.986
sexualityother -0.452 0.525 -0.862 0.389 0.636 0.228 1.779
genidenmale 0.176 0.426 0.413 0.680 1.192 0.517 2.747
genidennonbin/trans 0.944 0.563 1.678 0.094 2.571 0.853 7.747
lgbimp -0.068 0.423 -0.161 0.872 0.934 0.407 2.142
fit.logit28%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.335 0.478 -4.886 0.000 0.097 0.038 0.247
raceblack 0.240 0.534 0.449 0.654 1.271 0.446 3.623
racehispanic 0.246 0.447 0.549 0.583 1.278 0.532 3.073
agecohortmiddle -0.541 0.645 -0.839 0.402 0.582 0.164 2.060
agecohortyounger 0.498 0.454 1.096 0.273 1.646 0.675 4.011
educ 1.173 0.356 3.295 0.001 3.231 1.608 6.489
sexualityles/gay -0.982 0.473 -2.074 0.038 0.375 0.148 0.947
sexualityother -0.451 0.526 -0.857 0.392 0.637 0.227 1.786
genidenmale 0.172 0.422 0.407 0.684 1.187 0.520 2.713
genidennonbin/trans 0.968 0.566 1.711 0.088 2.632 0.868 7.979
parlgbcom -0.032 0.392 -0.081 0.936 0.969 0.449 2.090
fit.logit29%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.070 0.514 -4.030 0.000 0.126 0.046 0.345
raceblack 0.246 0.536 0.460 0.646 1.279 0.448 3.655
racehispanic 0.276 0.442 0.623 0.533 1.317 0.554 3.134
agecohortmiddle -0.535 0.620 -0.863 0.388 0.586 0.174 1.973
agecohortyounger 0.538 0.448 1.200 0.230 1.712 0.712 4.121
educ 1.164 0.357 3.258 0.001 3.201 1.590 6.447
sexualityles/gay -0.953 0.471 -2.022 0.044 0.386 0.153 0.971
sexualityother -0.395 0.526 -0.750 0.454 0.674 0.240 1.891
genidenmale 0.133 0.425 0.314 0.754 1.143 0.497 2.628
genidennonbin/trans 0.955 0.556 1.719 0.086 2.599 0.874 7.728
poslgbcom -0.421 0.436 -0.965 0.335 0.657 0.279 1.543
fit.logit30%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.443 0.514 -4.755 0.000 0.087 0.032 0.238
raceblack 0.232 0.528 0.439 0.661 1.261 0.448 3.550
racehispanic 0.232 0.444 0.523 0.601 1.261 0.528 3.013
agecohortmiddle -0.528 0.642 -0.823 0.411 0.590 0.168 2.074
agecohortyounger 0.516 0.456 1.133 0.258 1.676 0.686 4.095
educ 1.173 0.356 3.294 0.001 3.232 1.608 6.496
sexualityles/gay -0.977 0.467 -2.094 0.037 0.376 0.151 0.939
sexualityother -0.464 0.523 -0.887 0.375 0.629 0.225 1.754
genidenmale 0.184 0.419 0.438 0.662 1.202 0.528 2.732
genidennonbin/trans 0.935 0.573 1.630 0.104 2.547 0.828 7.836
bondlgbcom 0.117 0.388 0.301 0.763 1.124 0.526 2.402
fit.logit31%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -1.742 0.683 -2.551 0.011 0.175 0.046 0.668
raceblack 0.349 0.533 0.656 0.512 1.418 0.499 4.028
racehispanic 0.294 0.442 0.664 0.507 1.341 0.564 3.191
agecohortmiddle -0.629 0.596 -1.056 0.291 0.533 0.166 1.714
agecohortyounger 0.426 0.460 0.927 0.354 1.531 0.622 3.768
educ 1.161 0.356 3.261 0.001 3.194 1.589 6.420
sexualityles/gay -1.020 0.469 -2.177 0.030 0.360 0.144 0.903
sexualityother -0.460 0.529 -0.869 0.385 0.631 0.224 1.781
genidenmale 0.115 0.429 0.268 0.788 1.122 0.484 2.599
genidennonbin/trans 0.958 0.566 1.692 0.091 2.605 0.859 7.899
proudlgbcom -0.635 0.537 -1.183 0.237 0.530 0.185 1.517
fit.logit32%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -2.302 0.478 -4.821 0.000 0.100 0.039 0.255
raceblack 0.241 0.534 0.452 0.651 1.273 0.447 3.622
racehispanic 0.248 0.443 0.560 0.576 1.281 0.538 3.054
agecohortmiddle -0.543 0.638 -0.851 0.395 0.581 0.166 2.029
agecohortyounger 0.506 0.460 1.102 0.271 1.659 0.674 4.084
educ 1.166 0.358 3.257 0.001 3.208 1.591 6.468
sexualityles/gay -0.977 0.473 -2.064 0.039 0.377 0.149 0.952
sexualityother -0.456 0.527 -0.866 0.387 0.634 0.226 1.779
genidenmale 0.163 0.427 0.382 0.703 1.177 0.510 2.715
genidennonbin/trans 0.961 0.559 1.718 0.086 2.614 0.873 7.827
imppolactlgbcom -0.089 0.381 -0.235 0.815 0.914 0.433 1.931
fit.logit33%>%
  tidy()%>%
  mutate(OR = exp(estimate),
         LowerOR_Ci = exp(estimate - 1.96*std.error),
         UpperOR_Ci = exp(estimate + 1.96*std.error))%>%
  knitr::kable(digits = 3)
term estimate std.error statistic p.value OR LowerOR_Ci UpperOR_Ci
(Intercept) -1.569 0.729 -2.151 0.032 0.208 0.050 0.870
raceblack 0.345 0.517 0.668 0.505 1.412 0.513 3.890
racehispanic 0.301 0.443 0.681 0.496 1.352 0.568 3.218
agecohortmiddle -0.590 0.584 -1.010 0.313 0.554 0.177 1.741
agecohortyounger 0.555 0.473 1.174 0.241 1.742 0.690 4.401
educ 1.180 0.349 3.385 0.001 3.253 1.643 6.441
sexualityles/gay -0.986 0.514 -1.916 0.056 0.373 0.136 1.023
sexualityother -0.421 0.530 -0.795 0.427 0.656 0.232 1.854
genidenmale 0.154 0.435 0.353 0.724 1.166 0.497 2.737
genidennonbin/trans 0.798 0.590 1.351 0.177 2.220 0.698 7.063
soimp -0.218 0.462 -0.472 0.637 0.804 0.325 1.988
lgbimp -0.071 0.495 -0.143 0.886 0.932 0.353 2.458
parlgbcom -0.237 0.505 -0.469 0.639 0.789 0.293 2.123
poslgbcom -0.460 0.549 -0.837 0.403 0.631 0.215 1.853
bondlgbcom 0.644 0.532 1.210 0.227 1.905 0.671 5.408
proudlgbcom -0.731 0.636 -1.151 0.250 0.481 0.138 1.672
imppolactlgbcom -0.035 0.449 -0.078 0.937 0.965 0.400 2.328
exp(coefficients(fit.logit23))
##      (Intercept)        raceblack     racehispanic  agecohortmiddle 
##        0.1066083        1.3711815        1.2983644        0.5335280 
## agecohortyounger             educ sexualityles/gay   sexualityother 
##        1.6389247        3.1923544        0.4041753        0.8242058
exp(coefficients(fit.logit24))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##          0.05354379          1.40631782          1.18564840          0.79544579 
##    agecohortyounger                educ         genidenmale genidennonbin/trans 
##          2.32014516          2.97495178          0.84674200          2.24267307
exp(coefficients(fit.logit25))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##          0.09510079          1.26958480          1.27345408          0.58279005 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##          1.64743925          3.22459195          0.37415620          0.63499856 
##         genidenmale genidennonbin/trans 
##          1.18842601          2.61494712
exp(coefficients(fit.logit26))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.1036971           1.2642398           1.2512736           0.5742966 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.6318721           3.2304031           0.3651996           0.6354213 
##         genidenmale genidennonbin/trans               soimp 
##           1.2118452           2.5174742           0.8487625
exp(coefficients(fit.logit27))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##          0.09772084          1.26522242          1.27255652          0.58278562 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##          1.64764325          3.23375962          0.36912092          0.63624006 
##         genidenmale genidennonbin/trans              lgbimp 
##          1.19209672          2.57066180          0.93425324
exp(coefficients(fit.logit28))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##          0.09684085          1.27105832          1.27833342          0.58196018 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##          1.64570708          3.23053852          0.37468236          0.63697731 
##         genidenmale genidennonbin/trans           parlgbcom 
##          1.18744573          2.63225354          0.96889421
exp(coefficients(fit.logit29))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.1262421           1.2791412           1.3174422           0.5856883 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.7124114           3.2013414           0.3856404           0.6738684 
##         genidenmale genidennonbin/trans           poslgbcom 
##           1.1425669           2.5994633           0.6565795
exp(coefficients(fit.logit30))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##          0.08691664          1.26095952          1.26144744          0.58977584 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##          1.67608690          3.23222321          0.37647451          0.62850721 
##         genidenmale genidennonbin/trans          bondlgbcom 
##          1.20153022          2.54697625          1.12380152
exp(coefficients(fit.logit31))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.1752223           1.4178877           1.3414009           0.5330439 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.5309927           3.1943235           0.3604531           0.6313805 
##         genidenmale genidennonbin/trans         proudlgbcom 
##           1.1219336           2.6053608           0.5299168
exp(coefficients(fit.logit32))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.1000428           1.2727199           1.2813740           0.5811388 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.6593353           3.2076015           0.3765643           0.6336171 
##         genidenmale genidennonbin/trans     imppolactlgbcom 
##           1.1768996           2.6142976           0.9144296
exp(coefficients(fit.logit33))
##         (Intercept)           raceblack        racehispanic     agecohortmiddle 
##           0.2082381           1.4121339           1.3517810           0.5543825 
##    agecohortyounger                educ    sexualityles/gay      sexualityother 
##           1.7422447           3.2532038           0.3732416           0.6561397 
##         genidenmale genidennonbin/trans               soimp              lgbimp 
##           1.1662693           2.2199877           0.8040028           0.9317544 
##           parlgbcom           poslgbcom          bondlgbcom         proudlgbcom 
##           0.7892645           0.6313818           1.9045017           0.4812440 
##     imppolactlgbcom 
##           0.9653622
## With survey design "interesting cases" Race and Sexual Identity
rg<-ref_grid(fit.logit25)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "sexuality"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race sexuality prob SE df asymp.LCL asymp.UCL
white bisexual 0.1973 0.0665 Inf 0.0974 0.3589
black bisexual 0.2379 0.0899 Inf 0.1056 0.4521
hispanic bisexual 0.2384 0.0998 Inf 0.0963 0.4790
white les/gay 0.0842 0.0292 Inf 0.0419 0.1621
black les/gay 0.1046 0.0523 Inf 0.0376 0.2585
hispanic les/gay 0.1049 0.0432 Inf 0.0454 0.2239
white other 0.1350 0.0559 Inf 0.0576 0.2852
black other 0.1654 0.0853 Inf 0.0558 0.3994
hispanic other 0.1658 0.0850 Inf 0.0563 0.3986
## With survey design "interesting cases" Race and Gender Identity
rg<-ref_grid(fit.logit25)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "geniden"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race geniden prob SE df asymp.LCL asymp.UCL
white female 0.0945 0.0283 Inf 0.0517 0.1664
black female 0.1170 0.0508 Inf 0.0481 0.2577
hispanic female 0.1173 0.0467 Inf 0.0521 0.2433
white male 0.1103 0.0376 Inf 0.0553 0.2082
black male 0.1360 0.0660 Inf 0.0498 0.3212
hispanic male 0.1364 0.0602 Inf 0.0548 0.3006
white nonbin/trans 0.2144 0.0921 Inf 0.0854 0.4435
black nonbin/trans 0.2573 0.1191 Inf 0.0927 0.5403
hispanic nonbin/trans 0.2579 0.1260 Inf 0.0873 0.5580
## With survey design "interesting cases" Race and Age Cohort
rg<-ref_grid(fit.logit25)
marg_logit<-emmeans(object = rg,
              specs = c( "race",  "agecohort"),
             type="response" ,
              data=sub)
knitr::kable(marg_logit,  digits = 4)
race agecohort prob SE df asymp.LCL asymp.UCL
white older 0.1337 0.0474 Inf 0.0647 0.2561
black older 0.1639 0.0803 Inf 0.0585 0.3819
hispanic older 0.1643 0.0847 Inf 0.0554 0.3972
white middle 0.0825 0.0450 Inf 0.0273 0.2238
black middle 0.1025 0.0560 Inf 0.0335 0.2736
hispanic middle 0.1028 0.0578 Inf 0.0324 0.2814
white younger 0.2027 0.0413 Inf 0.1336 0.2955
black younger 0.2440 0.0943 Inf 0.1060 0.4679
hispanic younger 0.2446 0.0724 Inf 0.1306 0.4111