Record ID 312 being omitted because sex = NA

Read in Data

  • Upload our data
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

Descriptives of all variables

#describe(Omarallergy)

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

#Omit individuals who are not black or white

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) 
## 
##   1   2   3 
##  93 102  12
filtered_data <- Omarallergy %>%
  filter(pdemrace != 3)

table(filtered_data$pdemrace) 
## 
##   1   2 
##  93 102
  • 93 white, 102 black # Categories of allergy

sensitized : positive testing ORRRRRRRR serum IgE > 0 AND no symptoms symptomatic: negative testing + symptoms, allergic: positive testing + symptoms

# names(Omarallergy)


IgE_columns <- Omarallergy[, grepl("IgE", names(Omarallergy))]
IgE_columns <- IgE_columns[2:7]
psych::describe(Omarallergy)
targe_colname <- c("clam.IgE", "crab.IgE", "lobster.IgE", "oyster.IgE", "scallops.IgE", "shrimp.IgE")
col_numbers <- which(colnames(Omarallergy) %in% targe_colname)

Omarallergy$result <- ifelse(Omarallergy[, col_numbers] > 0, 1, 0)




skintesting <- Omarallergy[, grepl(".skin.test.interpretation", names(Omarallergy))]

# names(skintesting)


col_numbers <- which(colnames(Omarallergy) %in% targe_colname)


write.csv(Omarallergy, 'omarai.csv')
Omarallergy <- read.csv('omarai.csv')


# names(Omarallergy)

columns_to_check <- c("result.clam.IgE", "result.crab.IgE", "result.lobster.IgE",
                      "result.oyster.IgE", "result.scallops.IgE", "result.shrimp.IgE")

Omarallergy$totalIGE <- rowSums(Omarallergy[, columns_to_check],na.rm = TRUE)

table(Omarallergy$totalIGE)
## 
##   0   1   2   3   4   5   6 
## 105  30  15  27   8   7  15
Omarallergy <- mutate(Omarallergy, IGEpos = ifelse(totalIGE >= 1, 1,0))

table(Omarallergy$IGEpos)                                      
## 
##   0   1 
## 105 102

skin testing

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

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

Omarallergy[][Omarallergy[] == "unable to interpret"] <- 0


targe_colname <- c("clam.skin.test.interpretation", "crab.skin.test.interpretation", "lobster.skin.test.interpretation", "oyster.skin.test.interpretation", "scallops.skin.test.interpretation", "shrimp.skin.test.interpretation")
 
Omarallergy$clam.skin.test.interpretation <- as.numeric(Omarallergy$clam.skin.test.interpretation)
Omarallergy$crab.skin.test.interpretation <- as.numeric(Omarallergy$crab.skin.test.interpretation)
Omarallergy$lobster.skin.test.interpretation <- as.numeric(Omarallergy$lobster.skin.test.interpretation)
Omarallergy$oyster.skin.test.interpretation <- as.numeric(Omarallergy$oyster.skin.test.interpretation)
Omarallergy$scallops.skin.test.interpretation <- as.numeric(Omarallergy$scallops.skin.test.interpretation)
Omarallergy$shrimp.skin.test.interpretation <- as.numeric(Omarallergy$shrimp.skin.test.interpretation)


Omarallergy$totalskinpos <- rowSums(Omarallergy[, targe_colname],na.rm = TRUE)

Omarallergy <- mutate(Omarallergy, skinpos = ifelse(totalskinpos >= 1, 1,0))
targe_colname <- c("skinpos","IGEpos")
Omarallergy$skinpos <- as.numeric(Omarallergy$skinpos)
Omarallergy$IGEpos <- as.numeric(Omarallergy$IGEpos)

Omarallergy$allergy <- NULL

Omarallergy$allergy<- rowSums(Omarallergy[, targe_colname],na.rm = TRUE)

table(Omarallergy$allergy)
## 
##   1   2 
## 170  37
# write.csv(Omarallergy, Omarallergy.csv)

Difference in Age

library(ggpubr)
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(pdemrace) %>%
  get_summary_stats(age.in.years, type = "mean_sd")
ggboxplot(filtered_data, x = "pdemrace", y = "age.in.years", 
          color ="pdemrace", palette = c("#00AFBB", "#E7B800"),
          order = c(1, 2),
          ylab = "age(years)", xlab = "Race")

Difference in Age of onset

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(pdemrace) %>%
  get_summary_stats(shellfish.age.of.allergy.onset, type = "mean_sd")
ggboxplot(filtered_data, x = "pdemrace", y = "shellfish.age.of.allergy.onset", 
          color = "pdemrace", palette = c("#00AFBB", "#E7B800"),
          order = c(1, 2),
          ylab = "age  of onset (years)", xlab = "Race")
## Warning: Removed 97 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

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

Omit individuals whose sex is not male or female

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)
## 
##   0   1 
## 131  64
cont_table <- table(filtered_data$pdemrace, filtered_data$Sex)
chi_squared <- chisq.test(cont_table)
print(chi_squared) 
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table
## X-squared = 7.5132, df = 1, p-value = 0.006125

Difference in roach

df1 = filtered_data %>% 
  count(pdemrace, rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

filtered_data$pdemrace <- as.factor(filtered_data$pdemrace)
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.)

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.)



cont_table <- table(filtered_data$pdemrace, filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.)
chi_squared <- chisq.test(cont_table)
print(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
df1 = filtered_data %>% 
  count(pdemrace, rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach.))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

## Difference in mites

cont_table <- table(filtered_data$pdemrace, filtered_data$rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.)
chisq.test(cont_table)
## 
##  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.test(cont_table)




df1 = filtered_data %>% 
  count(pdemrace, rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite.))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

Difference in Symptoms

symptoms <- Omarallergy[, grepl("symptoms", names(Omarallergy))]
targetcolnames <- names(symptoms)



for (var in targetcolnames) {
  cat(sprintf("Chi-square test between %s and pdemrace:\n", var))
  contingency_table <- table(filtered_data[[var]], filtered_data$pdemrace)
  chi_square_result <- chisq.test(contingency_table)
  print(chi_square_result)
  cat("\n")
}
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema.. and pdemrace:
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 3.4153, df = 1, p-value = 0.06459
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea.. and pdemrace:
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 0.46889, df = 1, p-value = 0.4935
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.Respiratory..wheezing..stridor..voice.change..or.shortness.of.breath.. and pdemrace:
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 0.37954, df = 1, p-value = 0.5378
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.Cardiovascular..hypotension..syncope..lightheartedness.. and pdemrace:
## Warning in chisq.test(contingency_table): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 0.020142, df = 1, p-value = 0.8871
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.Neurologic..headache..parasthesias.. and pdemrace:
## Warning in chisq.test(contingency_table): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 1.8505, df = 1, p-value = 0.1737
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.Other. and pdemrace:
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  contingency_table
## X-squared = 2.2621, df = 1, p-value = 0.1326
## 
## 
## Chi-square test between shellfish.symptoms.with.any.prior.reaction..choice.not.documented. and pdemrace:
## 
##  Chi-squared test for given probabilities
## 
## data:  contingency_table
## X-squared = 0.41538, df = 1, p-value = 0.5192
# Assuming targetcolnames contains the names of variables you want to iterate over




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..)



df1 = filtered_data %>% 
  count(pdemrace, shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema..))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

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..)



df1 = filtered_data %>% 
  count(pdemrace, shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

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..)



df1 = filtered_data %>% 
  count(pdemrace, shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..) %>% 
  group_by(pdemrace) %>% 
  mutate(prop=prop.table(n))
df1
ggplot(df1, aes(pdemrace, prop, fill = shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea..))+
  geom_col() +
  geom_text(aes(label = scales::percent(prop)),
            position = position_stack(vjust = 0.5)) +
  scale_y_continuous(labels = scales::percent)

##medical comorbidities

names(Omarallergy)
##   [1] "X"                                                                                                                                                                                                                                                                          
##   [2] "Record.ID"                                                                                                                                                                                                                                                                  
##   [3] "age.in.years"                                                                                                                                                                                                                                                               
##   [4] "Sex"                                                                                                                                                                                                                                                                        
##   [5] "White."                                                                                                                                                                                                                                                                     
##   [6] "Black.or.African.American."                                                                                                                                                                                                                                                 
##   [7] "American.Indian.or.Alaska.Native."                                                                                                                                                                                                                                          
##   [8] "Asian."                                                                                                                                                                                                                                                                     
##   [9] "Native.Hawaiian.or.Other.Pacific.Islander."                                                                                                                                                                                                                                 
##  [10] "not.documented."                                                                                                                                                                                                                                                            
##  [11] "not.documented..1"                                                                                                                                                                                                                                                          
##  [12] "clam."                                                                                                                                                                                                                                                                      
##  [13] "crab."                                                                                                                                                                                                                                                                      
##  [14] "lobster."                                                                                                                                                                                                                                                                   
##  [15] "oyster."                                                                                                                                                                                                                                                                    
##  [16] "scallops."                                                                                                                                                                                                                                                                  
##  [17] "shrimp."                                                                                                                                                                                                                                                                    
##  [18] "unknown."                                                                                                                                                                                                                                                                   
##  [19] "other."                                                                                                                                                                                                                                                                     
##  [20] "name.of.other.shellfish.reacted.to.and.serum.IgE.level..name..0.00."                                                                                                                                                                                                        
##  [21] "clam.IgE"                                                                                                                                                                                                                                                                   
##  [22] "clam.skin.test.wheal.size.average"                                                                                                                                                                                                                                          
##  [23] "clam.skin.test.interpretation"                                                                                                                                                                                                                                              
##  [24] "crab.IgE"                                                                                                                                                                                                                                                                   
##  [25] "crab.skin.test.wheal.size.average"                                                                                                                                                                                                                                          
##  [26] "crab.skin.test.interpretation"                                                                                                                                                                                                                                              
##  [27] "lobster.IgE"                                                                                                                                                                                                                                                                
##  [28] "lobster.skin.test.wheal.size.average"                                                                                                                                                                                                                                       
##  [29] "lobster.skin.test.interpretation"                                                                                                                                                                                                                                           
##  [30] "oyster.IgE"                                                                                                                                                                                                                                                                 
##  [31] "oyster.skin.test.wheal.size.average"                                                                                                                                                                                                                                        
##  [32] "oyster.skin.test.interpretation"                                                                                                                                                                                                                                            
##  [33] "scallops.IgE"                                                                                                                                                                                                                                                               
##  [34] "scallops.skin.test.wheal.size.average"                                                                                                                                                                                                                                      
##  [35] "scallops.skin.test.interpretation"                                                                                                                                                                                                                                          
##  [36] "shrimp.IgE"                                                                                                                                                                                                                                                                 
##  [37] "shrimp.skin.prick.test.wheal.size.average"                                                                                                                                                                                                                                  
##  [38] "shrimp.skin.test.interpretation"                                                                                                                                                                                                                                            
##  [39] "shellfish.symptoms.with.any.prior.reaction..choice.Skin..hives.or.angioedema.."                                                                                                                                                                                             
##  [40] "shellfish.symptoms.with.any.prior.reaction..choice.GI..nausea..vomiting..or.diarrhea.."                                                                                                                                                                                     
##  [41] "shellfish.symptoms.with.any.prior.reaction..choice.Respiratory..wheezing..stridor..voice.change..or.shortness.of.breath.."                                                                                                                                                  
##  [42] "shellfish.symptoms.with.any.prior.reaction..choice.Cardiovascular..hypotension..syncope..lightheartedness.."                                                                                                                                                                
##  [43] "shellfish.symptoms.with.any.prior.reaction..choice.Neurologic..headache..parasthesias.."                                                                                                                                                                                    
##  [44] "shellfish.symptoms.with.any.prior.reaction..choice.Other."                                                                                                                                                                                                                  
##  [45] "shellfish.symptoms.with.any.prior.reaction..choice.not.documented."                                                                                                                                                                                                         
##  [46] "shellfish.other.symptom.description"                                                                                                                                                                                                                                        
##  [47] "shellfish.severity.of.any.prior.reaction..choice.no.treatment.or.antihistamine.only."                                                                                                                                                                                       
##  [48] "shellfish.severity.of.any.prior.reaction..choice.presented.to.ED.and..or.epinephrine.use."                                                                                                                                                                                  
##  [49] "shellfish.severity.of.any.prior.reaction..choice.not.documented."                                                                                                                                                                                                           
##  [50] "shellfish.age.of.allergy.onset"                                                                                                                                                                                                                                             
##  [51] "shellfish.clinical.course"                                                                                                                                                                                                                                                  
##  [52] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.allergic.rhinitis."                                                                                                                                                                                     
##  [53] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.asthma."                                                                                                                                                                                                
##  [54] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.eczema."                                                                                                                                                                                                
##  [55] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.contact.dermatitis."                                                                                                                                                                                    
##  [56] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.oral.allergy.syndrome."                                                                                                                                                                                 
##  [57] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.anxiety."                                                                                                                                                                                               
##  [58] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.other.psychological.diagnosis..depression..bipolar..schizophrenia..etc.."                                                                                                                               
##  [59] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.cardiac..hypertension..coronary.artery.dz..etc.."                                                                                                                                                       
##  [60] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.gastrointestinal."                                                                                                                                                                                      
##  [61] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.alpha.gal.allergy."                                                                                                                                                                                     
##  [62] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.other.food.allergy."                                                                                                                                                                                    
##  [63] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.drug.allergy."                                                                                                                                                                                          
##  [64] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.stinging.insect.allergy..hymenoptera.."                                                                                                                                                                 
##  [65] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.none.of.the.above."                                                                                                                                                                                     
##  [66] "medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.not.documented."                                                                                                                                                                                        
##  [67] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.allergic.rhinitis."                                                                                                           
##  [68] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.asthma."                                                                                                                      
##  [69] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.eczema."                                                                                                                      
##  [70] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.contact.dermatitis."                                                                                                          
##  [71] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.oral.allergy.syndrome."                                                                                                       
##  [72] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.anxiety."                                                                                                                     
##  [73] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.other.psychological.diagnosis..depression..bipolar..schizophrenia..etc.."                                                     
##  [74] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.cardiac..hypertension..coronary.artery.dz..etc.."                                                                             
##  [75] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.gastrointestinal."                                                                                                            
##  [76] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.alpha.gal.allergy."                                                                                                           
##  [77] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.other.food.allergy."                                                                                                          
##  [78] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.drug.allergy."                                                                                                                
##  [79] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.stinging.insect.allergy..hymenoptera.."                                                                                       
##  [80] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.none.of.the.above."                                                                                                           
##  [81] "medical.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.not.documented."                                                                                                              
##  [82] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.birch."                                                                                                                                                                                                    
##  [83] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.other.trees."                                                                                                                                                                                              
##  [84] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.grass."                                                                                                                                                                                                    
##  [85] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.weeds."                                                                                                                                                                                                    
##  [86] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite."                                                                                                                                                                                                
##  [87] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.mold."                                                                                                                                                                                                     
##  [88] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.no.testing.performed..information.not.available."                                                                                                                                                          
##  [89] "rhinitis.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach."                                                                                                                                                                                                
##  [90] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.birch."                                                                                                                                                                                       
##  [91] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.other.trees."                                                                                                                                                                                 
##  [92] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.grass."                                                                                                                                                                                       
##  [93] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.weeds."                                                                                                                                                                                       
##  [94] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.dust.mite."                                                                                                                                                                                   
##  [95] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.mold."                                                                                                                                                                                        
##  [96] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.no.testing.performed..information.not.available."                                                                                                                                             
##  [97] "oral.allergy.syndrome.specific.sensitization..skin.test.or.serum.IgE...choice.cockroach."                                                                                                                                                                                   
##  [98] "gastrointestinal.comorbidities..choice.IBD..crohns..ulcerative.colitis.."                                                                                                                                                                                                   
##  [99] "gastrointestinal.comorbidities..choice.irritable.bowel.syndrome."                                                                                                                                                                                                           
## [100] "gastrointestinal.comorbidities..choice.GERD."                                                                                                                                                                                                                               
## [101] "gastrointestinal.comorbidities..choice.eosinophilic.gastrointestinal.disorders..ie..EoE.."                                                                                                                                                                                  
## [102] "gastrointestinal.comorbidities..choice.Hx.of.abdominal.surgery."                                                                                                                                                                                                            
## [103] "gastrointestinal.comorbidities..choice.another.GI.diagnosis.not.otherwise.specified."                                                                                                                                                                                       
## [104] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.IBD..crohns..ulcerative.colitis.."                                                                                   
## [105] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.irritable.bowel.syndrome."                                                                                           
## [106] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.GERD."                                                                                                               
## [107] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.eosinophilic.gastrointestinal.disorders..ie..EoE.."                                                                  
## [108] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.Hx.of.abdominal.surgery."                                                                                            
## [109] "gastrointestinal.comorbidities.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.comorbidities.question...choice.another.GI.diagnosis.not.otherwise.specified."                                                                       
## [110] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.proton.pump.inhibitor."                                                                                                                                                                                    
## [111] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.beta.blocker."                                                                                                                                                                                             
## [112] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.ACE.ARB."                                                                                                                                                                                                  
## [113] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.NSAID..prescribed.or.documented.in.note.."                                                                                                                                                                 
## [114] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.sulfasalazine..azulfidine..or.mesalamine..5.ASA.."                                                                                                                                                         
## [115] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.immune.modulator..immune.suppressant..biologic..cyclophsophamide..MMF..calcineurin.inhibitor..mTOR.inhibitor..methotrexate..azathioprene.."                                                                
## [116] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.daily.oral.steroid."                                                                                                                                                                                       
## [117] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.none.of.the.above."                                                                                                                                                                                        
## [118] "medications.prescribed.at.time.of.food.allergy.diagnosis..choice.not.documented."                                                                                                                                                                                           
## [119] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.proton.pump.inhibitor."                                                                                                                    
## [120] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.beta.blocker."                                                                                                                             
## [121] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.ACE.ARB."                                                                                                                                  
## [122] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.NSAID..prescribed.or.documented.in.note.."                                                                                                 
## [123] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.sulfasalazine..azulfidine..or.mesalamine..5.ASA.."                                                                                         
## [124] "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.."
## [125] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.daily.oral.steroid."                                                                                                                       
## [126] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.none.of.the.above."                                                                                                                        
## [127] "medications.documented.at.the.time.of.chart.review..PMHx.section...not.already.included.in.previous.medication.question...choice.not.documented."                                                                                                                           
## [128] "prescribed.epinephrine.at.time.of.food.allergy.diagnosis"                                                                                                                                                                                                                   
## [129] "history.of.repeated.tick.bites"                                                                                                                                                                                                                                             
## [130] "works.in.food.service.or.other.occupational.food.handling..chef..catering..fast.food..butcher..fishmonger..etc.."                                                                                                                                                           
## [131] "Complete."                                                                                                                                                                                                                                                                  
## [132] "otherRace."                                                                                                                                                                                                                                                                 
## [133] "pdemrace"                                                                                                                                                                                                                                                                   
## [134] "result.clam.IgE"                                                                                                                                                                                                                                                            
## [135] "result.crab.IgE"                                                                                                                                                                                                                                                            
## [136] "result.lobster.IgE"                                                                                                                                                                                                                                                         
## [137] "result.oyster.IgE"                                                                                                                                                                                                                                                          
## [138] "result.scallops.IgE"                                                                                                                                                                                                                                                        
## [139] "result.shrimp.IgE"                                                                                                                                                                                                                                                          
## [140] "totalIGE"                                                                                                                                                                                                                                                                   
## [141] "IGEpos"                                                                                                                                                                                                                                                                     
## [142] "totalskinpos"                                                                                                                                                                                                                                                               
## [143] "skinpos"                                                                                                                                                                                                                                                                    
## [144] "allergy"

diff in med comorbidities

  • contact derm
  • eczema
  • atopic, allergic rhininitis, asthma, eczema, contact derm, and OAS
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_result <- fisher.test(cont_table_medcomorbidAR)


cont_table_medcomorbidAAT<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.asthma)
chisq.test(cont_table_medcomorbidAAT)
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidAAT
## X-squared = 2.3469, df = 1, p-value = 0.1255
fisher_resultAT <- fisher.test(cont_table_medcomorbidAAT)



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_resultEC <- fisher.test(cont_table_medcomorbidEC)


cont_table_medcomorbidCD<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.contact.dermatitis)
chisq.test(cont_table_medcomorbidCD)
## Warning in chisq.test(cont_table_medcomorbidCD): Chi-squared approximation may
## be incorrect
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidCD
## X-squared = 0.28098, df = 1, p-value = 0.5961
fisher_resultEC <- fisher.test(cont_table_medcomorbidCD)


cont_table_medcomorbidOAS<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.oral.allergy.syndrome)
chisq.test(cont_table_medcomorbidOAS)
## Warning in chisq.test(cont_table_medcomorbidOAS): Chi-squared approximation may
## be incorrect
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_medcomorbidOAS
## X-squared = 2.0076, df = 1, p-value = 0.1565
fisher_resultOAS <- fisher.test(cont_table_medcomorbidOAS)


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_resultANX <- fisher.test(cont_table_medcomorbidANXS)



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
fisherpsyc <- fisher.test(cont_table_medcomorbidPSY)



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
fisherhypertension <- fisher.test(cont_table_medcomorbidhypertension)

     
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
fisherGI <- fisher.test(cont_table_GI)

     

     
cont_table_alphagal<- table(filtered_data$pdemrace, filtered_data$medical.comorbidities.at.the.time.of.food.allergy.diagnosis..choice.alpha.gal.allergy)
chisq.test(cont_table_alphagal)
## Warning in chisq.test(cont_table_alphagal): Chi-squared approximation may be
## incorrect
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  cont_table_alphagal
## X-squared = 2.5941, df = 1, p-value = 0.1073
fisheralpha <- fisher.test(cont_table_alphagal)
                      
                      
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
fisherotherfoodllergy <- fisher.test(cont_table_otherfoodallergy)
                      


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
fisherotherdrugallergy <- fisher.test(cont_table_otherdrugallergy)

       
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
fisherotherinsectallergy<- fisher.test(cont_table_insectallergy)

#diff in medications at time of DX

shellfish.severity.of.any.prior.reaction..choice.no.treatment.or.antihistamine.only
shellfish.severity.of.any.prior.reaction..choice.presented.to.ED.and..or.epinephrine.use
shellfish.severity.of.any.prior.reaction..choice.not.documented

Omarallergy$shellfish.severity.of.any.prior.reaction..choice.no.treatment.or.antihistamine.only.
##   [1] 0 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 0 0 0 1 0 1
##  [38] 0 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 0 0 0 0 0 0
##  [75] 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1
## [112] 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0
## [149] 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0
## [186] 0 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1
Omarallergy$shellfish.severity.of.any.prior.reaction..choice.presented.to.ED.and..or.epinephrine.use.
##   [1] 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
##  [38] 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 0 0 0
##  [75] 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0
## [112] 0 0 0 1 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0
## [149] 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [186] 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0

#shellfish that patient is allergic to

##prescribed epinephrine at tm of dx