Read in Data

  • Upload our data
  • Transform Data so that all checked variables = 1 and unchecked = 0
  • Record ID 312 being omitted because sex = NA
Omarallergy<- as.data.frame(read.csv("AdultFoodAllergyCorr-ShellfishTrueAllergy_DATA_LABELS_2024-05-30_0822.csv"))


Omarallergy$Race..ethnicity..choice.otherRace. <- Omarallergy$Race..ethnicity..choice.other.
Omarallergy$Race..ethnicity..choice.other. <- NULL


##changing the variable names for ease
names(Omarallergy)<- gsub("Race..ethnicity..choice.", "", names(Omarallergy))

names(Omarallergy)<- gsub("shellfish.that.the.patient.reacted.to..or.suspected.reacted.to...choice.", "", names(Omarallergy))

Omarallergy[][Omarallergy[] == "Checked"] <- 1

Omarallergy[][Omarallergy[] == "Unchecked"] <- 0

First step, make race categories, categorize everyone as either white, black, or other

col_names <- colnames(Omarallergy)
duplicate_cols <- col_names[duplicated(col_names)]

Omarallergy <- mutate(Omarallergy, pdemrace = ifelse(White. == 1, "1", ifelse(Black.or.African.American. == 1, "2", ifelse(American.Indian.or.Alaska.Native. == 1, "3", ifelse(Asian. == 1, "3", ifelse(Native.Hawaiian.or.Other.Pacific.Islander. == 1, "3", ifelse(not.documented. == 1, "3", 
                                                                        ifelse(otherRace. == 1, "3", 
                                                                               ifelse(not.documented..1 == 1, 3, "")))))))))

                                                                        
# table(Omarallergy$pdemrace) 

filtered_data <- Omarallergy %>%
  filter(pdemrace != 3)


z <- table(filtered_data$pdemrace)
rownames(z) <- c( "White","Black")


kbl(z) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
Var1 Freq
White 93
Black 102

Categories of allergy

No Difference in Age by Race

  • Black and white individuals are not different for Age (W = 5154.5, p = .296)
filtered_data$race <- dplyr::recode(filtered_data$pdemrace, "1" = "White", "2" = "Black")

View(filtered_data)
filtered_data$pdemrace <- as.factor(filtered_data$pdemrace)
# anova(lm(age.in.years~ pdemrace, data=filtered_data))


wilcox.test(age.in.years ~ pdemrace, data = filtered_data, 
        exact = FALSE, alternative = "two.sided")
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  age.in.years by pdemrace
## W = 5154.5, p-value = 0.2963
## alternative hypothesis: true location shift is not equal to 0
filtered_data %>%
  group_by(race) %>%
  get_summary_stats(age.in.years, type = "common") 
ggboxplot(filtered_data, x = "race", y = "age.in.years", 
          color ="race", palette = c("#00AFBB", "#E7B800"),
          ylab = "age (years)", xlab = "Race") + theme(legend.position = "none") + ggtitle("Figure 1. No Difference in Age in \nYears by Race") +   theme(title  = element_text(face="bold", size = 15))

No Difference in Age of Onset by Race

  • Black and white individuals do not have different age of onsets for shellfish allergy (W = 1041.5, p = .296)
# anova(lm(shellfish.age.of.allergy.onset ~ pdemrace, data=filtered_data))

wilcox.test(shellfish.age.of.allergy.onset ~ pdemrace, data = filtered_data, 
        exact = FALSE, alternative = "two.sided")
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  shellfish.age.of.allergy.onset by pdemrace
## W = 1041.5, p-value = 0.2967
## alternative hypothesis: true location shift is not equal to 0
filtered_data %>%
  group_by(race) %>%
  get_summary_stats(shellfish.age.of.allergy.onset, type = "common") 
ggboxplot(filtered_data, x = "race", y = "shellfish.age.of.allergy.onset", 
          color ="race", palette = c("#00AFBB", "#E7B800"),
          ylab = "age of onset of allergy (years)", xlab = "Race") + theme(legend.position = "none") + ggtitle("Figure 2. No Racial differences \nin SF Allergy Onset Age") + theme(title  = element_text(face="bold", size = 15))

compare black and white patients on roach and mites, and symptoms, for eahc of the seven symtpoms, compare on sex, age, and age of onset of the allergy

Difference in Sex by Race

  • proportion of females differs by sex (i.e., more black females) at greater than chance levels (χ² =7.5132, p = .006 )
filtered_data$Sex <- dplyr::recode(filtered_data$Sex, female = "0", male = "1", na.action = "na.omit")


filtered_data$Sex <- as.factor(filtered_data$Sex)

# table(filtered_data$Sex)

cont_tablesex <- table(filtered_data$pdemrace, filtered_data$Sex)
chi_squaredsex <- chisq.test(cont_tablesex)




rownames(cont_tablesex) <- c( "White","Black")
colnames(cont_tablesex) <- c( "Female","Male")

chi_squaredsex
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_tablesex
## X-squared = 7.5132, df = 1, p-value = 0.006125
kbl(cont_tablesex) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
Female Male
White 53 40
Black 78 24

No Difference in Roach by Race

  • (χ² = 4.9651e-05, p = .99; fisher’s exact test, p = .88)
filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach. <- as.factor(filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.)



df1 = filtered_data %>% 
  count(race, rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))


cont_table <- table(filtered_data$pdemrace, filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.)
chi_squared <- chisq.test(cont_table)
fisher_result <- fisher.test(cont_table)



rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "Not","Sensitized")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
Not Sensitized
White 63 30
Black 68 34
chi_squared
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 4.9651e-05, df = 1, p-value = 0.9944
fisher_result
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table
## p-value = 0.88
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.552748 1.999211
## sample estimates:
## odds ratio 
##   1.049763
ggplot(df1, aes(race, fill = rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "Roach Sensitization", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 3. No Racial differences in \n Roach Sensitization") + theme(title  = element_text(face="bold", size = 15))

No Difference in Mites by Race

  • (χ² = 1.3362, p = 0.2477; fisher’s exact test, p = .199)
filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite. <- as.factor(filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.)



df1 = filtered_data %>% 
  count(race, rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))



cont_table <- table(filtered_data$pdemrace, filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.)
chi_squared <- chisq.test(cont_table)
fisher_result <- fisher.test(cont_table)



rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "Not","Sensitized")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
Not Sensitized
White 46 47
Black 41 61
chi_squared
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 1.3362, df = 1, p-value = 0.2477
fisher_result 
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table
## p-value = 0.1987
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.7941506 2.6713774
## sample estimates:
## odds ratio 
##   1.453293
ggplot(df1, aes(race, fill = rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "Dust Mite Sensitization", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 4. No Racial differences in \n Dust Mite  Sensitization") + theme(title  = element_text(face="bold", size = 15))

Difference in Symptoms

Hives/angioedema - marginal difference by race

  • non-significant difference in hives; black individuals >> white individuals
filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema.. <- as.factor(filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..)

cont_table <- table(filtered_data$pdemrace, filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..)
chi_squared <- chisq.test(cont_table)
fisher_result <- fisher.test(cont_table)



rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "No","Yes")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 31 62
Black 21 81
chi_squared
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 3.4153, df = 1, p-value = 0.06459
fisher_result
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table
## p-value = 0.05228
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.9649947 3.8888905
## sample estimates:
## odds ratio 
##   1.922028
df1 = filtered_data %>% 
  count(race, shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "SkinSymptom", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 6. Marginal Diff in  Skin Symptoms") + theme(title  = element_text(face="bold", size = 15))

GI, Emesis/Diarrhea - no diff by race

filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea.. <- as.factor(filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..)


cont_table <- table(filtered_data$pdemrace, filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..)
chi_squared <- chisq.test(cont_table)
fisher_result <- fisher.test(cont_table)



rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "No","Yes")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 71 22
Black 83 19
chi_squared
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 0.46889, df = 1, p-value = 0.4935
fisher_result
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table
## p-value = 0.482
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.347849 1.561518
## sample estimates:
## odds ratio 
##  0.7399337
df1 = filtered_data %>% 
  count(race, shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "GI", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 7. GI Symptoms") + theme(title  = element_text(face="bold", size = 15))

Respiratory - No Racial differences by race

filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Respiratory..wheezing..stridor..voice.change..or.shortness.of.breath.. <- as.factor(filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Respiratory..wheezing..stridor..voice.change..or.shortness.of.breath..)

filtered_data$respiratory <- as.factor(filtered_data$shellfish.symptoms.with.any.prior.reaction..choice.Respiratory..wheezing..stridor..voice.change..or.shortness.of.breath..)


cont_table <- table(filtered_data$pdemrace, filtered_data$respiratory)
chi_squared <- chisq.test(cont_table)
fisher_result <- fisher.test(cont_table)



rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "No","Yes")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 46 47
Black 56 46
chi_squared
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 0.37954, df = 1, p-value = 0.5378
fisher_result
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table
## p-value = 0.4753
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.4402826 1.4675397
## sample estimates:
## odds ratio 
##  0.8048606
df1 = filtered_data %>% 
  count(race, respiratory) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = respiratory))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "respiratory", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 8. Respiratory Symptoms") + theme(title  = element_text(face="bold", size = 15))

Medical Comorbidities

Allergic Rhinitis - no difference in Race

cont_table_medcomorbidAR <- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.allergic.rhinitis)



chisq.test(cont_table_medcomorbidAR)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidAR
## X-squared = 0.75331, df = 1, p-value = 0.3854
fisher.test(cont_table_medcomorbidAR)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidAR
## p-value = 0.322
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.6970152 2.8681325
## sample estimates:
## odds ratio 
##   1.408603
rownames(cont_table) <- c( "White","Black")
colnames(cont_table) <- c( "No","Yes")


kbl(cont_table) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 46 47
Black 56 46

Asthma - no difference in Race

cont_table_medcomorbid <- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.asthma)



chisq.test(cont_table_medcomorbid)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbid
## X-squared = 2.3469, df = 1, p-value = 0.1255
fisher.test(cont_table_medcomorbid)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbid
## p-value = 0.1076
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.8830289 3.0678121
## sample estimates:
## odds ratio 
##   1.638614
rownames(cont_table_medcomorbid) <- c( "White","Black")
colnames(cont_table_medcomorbid) <- c( "No","Yes")


kbl(cont_table_medcomorbid) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 62 31
Black 56 46

Eczema - no difference in Race

cont_table_medcomorbidEC<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.eczema)
chisq.test(cont_table_medcomorbidEC)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidEC
## X-squared = 2.9762e-31, df = 1, p-value = 1
fisher.test(cont_table_medcomorbidEC)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidEC
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.3896333 2.5146574
## sample estimates:
## odds ratio 
##  0.9860244
rownames(cont_table_medcomorbidEC) <- c( "White","Black")
colnames(cont_table_medcomorbidEC) <- c( "No","Yes")


kbl(cont_table_medcomorbidEC) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 81 12
Black 89 13

Contact Derm - no difference in Race

cont_table_medcomorbidCD<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.contact.dermatitis)
fisher.test(cont_table_medcomorbidCD)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidCD
## p-value = 0.4274
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.03950996 3.20252303
## sample estimates:
## odds ratio 
##  0.4467991
rownames(cont_table_medcomorbidCD) <- c( "White","Black")
colnames(cont_table_medcomorbidCD) <- c( "No","Yes")


kbl(cont_table_medcomorbidCD) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 89 4
Black 100 2

Oral Allergy Syndrome - no difference in Race

cont_table_medcomorbidOAS<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.oral.allergy.syndrome)
fisher.test(cont_table_medcomorbidOAS)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidOAS
## p-value = 0.121
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##    0.6727025 266.9661642
## sample estimates:
## odds ratio 
##   5.708437
rownames(cont_table_medcomorbidOAS) <- c( "White","Black")
colnames(cont_table_medcomorbidOAS) <- c( "No","Yes")


kbl(cont_table_medcomorbidOAS) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 92 1
Black 96 6

Anxiety - no difference in Race

cont_table_medcomorbidANXS<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.anxiety)
chisq.test(cont_table_medcomorbidANXS)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidANXS
## X-squared = 0.80343, df = 1, p-value = 0.3701
fisher.test(cont_table_medcomorbidANXS)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidANXS
## p-value = 0.2837
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.2304729 1.5833503
## sample estimates:
## odds ratio 
##  0.6149051
rownames(cont_table_medcomorbidANXS) <- c( "White","Black")
colnames(cont_table_medcomorbidANXS) <- c( "No","Yes")


kbl(cont_table_medcomorbidANXS) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 79 14
Black 92 10

Other Psych - White individuals >> Black Individuals

filtered_data$otherpsych <- as.factor(filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.other.psychological.diagnosis..depression..bipolar..schizophrenia..etc.)




cont_table_medcomorbidPSY<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.other.psychological.diagnosis..depression..bipolar..schizophrenia..etc.)
chisq.test(cont_table_medcomorbidPSY)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidPSY
## X-squared = 7.2221, df = 1, p-value = 0.007201
fisher.test(cont_table_medcomorbidPSY)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidPSY
## p-value = 0.004599
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.1060983 0.7386840
## sample estimates:
## odds ratio 
##  0.2936171
rownames(cont_table_medcomorbidPSY) <- c( "White","Black")
colnames(cont_table_medcomorbidPSY) <- c( "No","Yes")


kbl(cont_table_medcomorbidPSY) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 72 21
Black 94 8
df1 = filtered_data %>% 
  count(race, otherpsych) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = otherpsych))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "other psych", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 9. Other Psych DX") + theme(title  = element_text(face="bold", size = 15))

Cardiac - No Racial differences

cont_table_medcomorbidhypertension<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.cardiac..hypertension..coronary.artery.dz..etc.)
chisq.test(cont_table_medcomorbidhypertension)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidhypertension
## X-squared = 1.9437, df = 1, p-value = 0.1633
fisher.test(cont_table_medcomorbidhypertension)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_medcomorbidhypertension
## p-value = 0.145
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.8338467 3.3820097
## sample estimates:
## odds ratio 
##   1.664177
rownames(cont_table_medcomorbidhypertension) <- c( "White","Black")
colnames(cont_table_medcomorbidhypertension) <- c( "No","Yes")


kbl(cont_table_medcomorbidhypertension) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 73 20
Black 70 32

GI - No Racial differences

cont_table_GI<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.gastrointestinal)
chisq.test(cont_table_GI)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_GI
## X-squared = 0.028037, df = 1, p-value = 0.867
fisher.test(cont_table_GI)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_GI
## p-value = 0.7616
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.5790866 2.1087649
## sample estimates:
## odds ratio 
##   1.102891
rownames(cont_table_GI) <- c( "White","Black")
colnames(cont_table_GI) <- c( "No","Yes")


kbl(cont_table_GI) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 64 29
Black 68 34

Alpha Gal - No Racial differences

cont_table_alphagal<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.alpha.gal.allergy)
fisher.test(cont_table_alphagal)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_alphagal
## p-value = 0.04999
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.000000 1.361982
## sample estimates:
## odds ratio 
##          0
rownames(cont_table_alphagal) <- c( "White","Black")
colnames(cont_table_alphagal) <- c( "No","Yes")


kbl(cont_table_alphagal) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 89 4
Black 102 0

Other Food Allergy - No Racial differences

cont_table_otherfoodallergy<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.other.food.allergy)
chisq.test(cont_table_otherfoodallergy)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_otherfoodallergy
## X-squared = 0.19538, df = 1, p-value = 0.6585
fisher.test(cont_table_otherfoodallergy)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_otherfoodallergy
## p-value = 0.6231
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.6094929 2.4638628
## sample estimates:
## odds ratio 
##   1.219878
rownames(cont_table_otherfoodallergy) <- c( "White","Black")
colnames(cont_table_otherfoodallergy) <- c( "No","Yes")

kbl(cont_table_otherfoodallergy) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 71 22
Black 74 28

Drug Allergy - racial differences

filtered_data$drugallergy <- as.factor(filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.drug.allergy)


cont_table_otherdrugallergy<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.drug.allergy)
chisq.test(cont_table_otherdrugallergy)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_otherdrugallergy
## X-squared = 4.0853, df = 1, p-value = 0.04326
fisher.test(cont_table_otherdrugallergy)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_otherdrugallergy
## p-value = 0.03195
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.2891080 0.9819947
## sample estimates:
## odds ratio 
##    0.53491
rownames(cont_table_otherdrugallergy) <- c( "White","Black")
colnames(cont_table_otherdrugallergy) <- c( "No","Yes")


kbl(cont_table_otherdrugallergy) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 44 49
Black 64 38
df1 = filtered_data %>% 
  count(race, drugallergy) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = drugallergy))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "drug allergy", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 10. Drug Allergy Greater in White Individuals") + theme(title  = element_text(face="bold", size = 15))

Insect Allergy - racial differences

filtered_data$insectallergy <- as.factor(filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.stinging.insect.allergy..hymenoptera.)


cont_table_insectallergy<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.stinging.insect.allergy..hymenoptera.)
chisq.test(cont_table_insectallergy)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_insectallergy
## X-squared = 4.0889, df = 1, p-value = 0.04317
fisher.test(cont_table_insectallergy)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  cont_table_insectallergy
## p-value = 0.02745
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.01927547 0.94409617
## sample estimates:
## odds ratio 
##  0.1880703
rownames(cont_table_insectallergy) <- c( "White","Black")
colnames(cont_table_insectallergy) <- c( "No","Yes")


kbl(cont_table_insectallergy) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 84 9
Black 100 2
df1 = filtered_data %>% 
  count(race, insectallergy) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = insectallergy))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "insect allergy", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 11. Insect Allergy") + theme(title  = element_text(face="bold", size = 15))

Medications at Time of DX

PPI - No Racial differences

PPI <- table(filtered_data$pdemrace, filtered_data$medications.prescribed.at.time.of.food.allergy.diagnosis..choice.proton.pump.inhibitor.)
chisq.test(PPI)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  PPI
## X-squared = 0.45953, df = 1, p-value = 0.4978
fisher.test(PPI)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  PPI
## p-value = 0.4655
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.3323381 1.5928631
## sample estimates:
## odds ratio 
##  0.7311916

Beta Blockers - No Racial differences

BB <- table(filtered_data$pdemrace, filtered_data$medications.prescribed.at.time.of.food.allergy.diagnosis..choice.beta.blocker.)
fisher.test(BB)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  BB
## p-value = 0.6199
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.435641 4.324629
## sample estimates:
## odds ratio 
##   1.333438

ACE/ARB - No Racial differences

AceArb <- table(filtered_data$pdemrace, filtered_data$medications.prescribed.at.time.of.food.allergy.diagnosis..choice.ACE.ARB.)
fisher.test(AceArb)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  AceArb
## p-value = 0.2204
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.7255089 4.5721512
## sample estimates:
## odds ratio 
##   1.773398

NSAID - No Racial differences

NSAID <- table(filtered_data$pdemrace, filtered_data$medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.NSAID..prescribed.or.documented.in.note..)
fisher.test(NSAID)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  NSAID
## p-value = 0.08581
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.8814582 4.9878702
## sample estimates:
## odds ratio 
##   2.042624

Sulfasalazine - noone taking it

Sulfasalazine <- table(filtered_data$pdemrace, filtered_data$medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.sulfasalazine..azulfidine..or.mesalamine..5.ASA..)

Immune modulator - No Racial differences

ImmuneMod <- table(filtered_data$pdemrace, filtered_data$medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.immune.modulator..immune.suppressant..biologic..cyclophsophamide..MMF..calcineurin.inhibitor..mTOR.inhibitor..methotrexate..azathioprene..)
fisher.test(ImmuneMod)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  ImmuneMod
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.2689808 4.7249200
## sample estimates:
## odds ratio 
##   1.099444

Oral steroid - No Racial differences

oralsteroid <- table(filtered_data$pdemrace, filtered_data$medications.prescribed.at.time.of.food.allergy.diagnosis..choice.daily.oral.steroid.)
fisher.test(oralsteroid)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  oralsteroid
## p-value = 0.7232
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##   0.2906562 10.2230425
## sample estimates:
## odds ratio 
##   1.543004

Shellfish allergy severity

No difference in antihistamine only or undocumented any prior reaction

notxantihisonly <- table(filtered_data$pdemrace, filtered_data$shellfish.severity.of.any.prior.reaction..choice.no.treatment.or.antihistamine.only)
fisher.test(notxantihisonly)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  notxantihisonly
## p-value = 0.8809
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.5044299 1.8033134
## sample estimates:
## odds ratio 
##  0.9533317
notdocument <- table(filtered_data$pdemrace, filtered_data$shellfish.severity.of.any.prior.reaction..choice.not.documented)
fisher.test(notdocument)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  notdocument
## p-value = 0.1987
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.3738865 1.2546803
## sample estimates:
## odds ratio 
##  0.6864614

Severity, Requiring ED and/or EPI, Black individuals >> White Individuals

filtered_data$epied <- as.factor(filtered_data$shellfish.severity.of.any.prior.reaction..choice.presented.to.ED.and..or.epinephrine.use)



EDepinephrine <- table(filtered_data$pdemrace, filtered_data$shellfish.severity.of.any.prior.reaction..choice.presented.to.ED.and..or.epinephrine.use)
fisher.test(EDepinephrine)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  EDepinephrine
## p-value = 0.03521
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  1.023373 6.042139
## sample estimates:
## odds ratio 
##   2.405833
df1 = filtered_data %>% 
  count(race, epied) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = epied))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "Epi-ED", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 12. Reaction presenting to ED \n Epi Use") + theme(title  = element_text(face="bold", size = 15))

Prescribed EPI at Time of DX - No Racial differences by Race

EPIDX <- table(filtered_data$pdemrace, filtered_data$prescribed.epinephrine.at.time.of.food.allergy.diagnosis)
fisher.test(EPIDX)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  EPIDX
## p-value = 0.3569
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.4856944 9.5813046
## sample estimates:
## odds ratio 
##   1.987209
chisq.test(EPIDX)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  EPIDX
## X-squared = 0.60715, df = 1, p-value = 0.4359

Shellfish that patient is allergic to

No diff in clam, crab, lobster, scallops, or shrimp

clam <- table(filtered_data$pdemrace, filtered_data$clam.)
fisher.test(clam)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  clam
## p-value = 0.1049
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.003653862 1.611823791
## sample estimates:
## odds ratio 
##  0.1756135
crab <- table(filtered_data$pdemrace, filtered_data$crab.)
fisher.test(crab)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  crab
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.5155848 2.1391279
## sample estimates:
## odds ratio 
##   1.047585
chisq.test(crab)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  crab
## X-squared = 1.0765e-30, df = 1, p-value = 1
lobster <- table(filtered_data$pdemrace, filtered_data$lobster.)
fisher.test(lobster)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  lobster
## p-value = 0.4359
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.3031279 1.6503377
## sample estimates:
## odds ratio 
##  0.7124862
chisq.test(lobster)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  lobster
## X-squared = 0.45242, df = 1, p-value = 0.5012
scallops <- table(filtered_data$pdemrace, filtered_data$scallops.)
fisher.test(scallops)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  scallops
## p-value = 0.3922
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.1360041 1.9888490
## sample estimates:
## odds ratio 
##   0.549369
chisq.test(scallops)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  scallops
## X-squared = 0.55833, df = 1, p-value = 0.4549
shrimp <- table(filtered_data$pdemrace, filtered_data$shrimp.)
fisher.test(shrimp)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  shrimp
## p-value = 0.3176
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.7310606 2.4542388
## sample estimates:
## odds ratio 
##   1.337252
chisq.test(shrimp)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  shrimp
## X-squared = 0.75257, df = 1, p-value = 0.3857

Oyster - more white individuals allergic

oyster <- table(filtered_data$pdemrace, filtered_data$oyster.)
fisher.test(oyster)
## 
##  Fisher's Exact Test for Count Data
## 
## data:  oyster
## p-value = 0.02329
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
##  0.0000000 0.9731435
## sample estimates:
## odds ratio 
##          0
rownames(oyster) <- c( "White","Black")
colnames(oyster) <- c( "No","Yes")


kbl(oyster) %>%
  kable_paper(full_width = F) %>% kable_styling(bootstrap_options = "striped", font_size = 15)
No Yes
White 88 5
Black 102 0
filtered_data$oysteral <- as.factor(filtered_data$oyster.)

df1 = filtered_data %>% 
  count(race, oysteral) %>% 
  group_by(race) %>% 
  mutate(prop=prop.table(n))

ggplot(df1, aes(race, fill = oysteral))+
geom_bar(aes(y = prop*100),
    position = "dodge", stat = "identity") + scale_fill_discrete(name = "oyster allergy", labels = c("No", "Yes"),type=c("cornflowerblue","red")) +theme_classic() + ylab("Proportion (%)") + xlab("Race") + ggtitle("Figure 13. Oyster Allergy") + theme(title  = element_text(face="bold", size = 15))