vignettes/chronic.R

## ----knitr_init, echo=FALSE, cache=FALSE, warning=FALSE, message=FALSE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
options(knitr.table.format = "html")
options(max.print="75", scipen=999, width = 800)
knitr::opts_chunk$set(echo=FALSE,
	             cache=FALSE,
               prompt=FALSE,
               tidy=TRUE,
               root.dir = "..",
               fig.height = 4,
               fig.width = 10,
               comment=NA,
               message=FALSE,
               warning=FALSE)
knitr::opts_knit$set(width=100, figr.prefix = T, figr.link = T)
knitr::knit_hooks$set(inline = function(x) {
  prettyNum(x, big.mark=",")
})

## ----loadData, cache=TRUE-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
load("../data/brfss2013.RData")
load("../R/sysdata.rda")

## ----loadFunctions------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::read_chunk("../R/getMode.R")
knitr::read_chunk("../R/estimateSampleSize.R")
knitr::read_chunk("../R/preProcessData.R")
knitr::read_chunk("../R/analyzeUnivariate.R")
knitr::read_chunk("../R/analyzeRq1.R")
knitr::read_chunk("../R/analyzeRq2.R")
knitr::read_chunk("../R/analyzeRq3.R")
knitr::read_chunk("../R/analyzeRq4.R")

source("../R/getMode.R")
source("../R/estimateSampleSize.R")
source("../R/preProcessData.R")
source("../R/analyzeUnivariate.R")
source("../R/analyzeRq1.R")
source("../R/analyzeRq2.R")
source("../R/analyzeRq3.R")
source("../R/analyzeRq4.R")

## ----preprocessData, echo = F, cache = T--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
brfss <- preProcessData(brfss2013)

## ----univariateAnalysis, echo = F, cache = T----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate <- analyzeUnivariate(brfss)

## ----analyzeRq1, echo = F, cache = T------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq1 <- analyzeRq1(brfss)

## ----rq2, include=T, echo = F, cache = T--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq2 <- analyzeRq2(brfss)  

## ----analyzeRq3, echo = F, cache = T------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3 <- analyzeRq3(brfss)

## ----analyzeRq4, echo = F, cache = T------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4 <- analyzeRq4(brfss)

## ----chronicTbl, echo = F, message = FALSE, warning=FALSE---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(chronic) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----variableTbl, echo = F, message = FALSE, warning=FALSE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(variables) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----powerTbl, include=T, echo = F, results='html'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
power <- estimateSampleSize()
knitr::kable(power, digits = 2) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = T, position = "center")

## ----inferentials, echo = F, message = FALSE, warning=FALSE-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(inferential[,1:7]) %>%  kableExtra::add_header_above(c(" ", " ", "Research Question" = 4, " ")) %>%
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----categorical, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$categorical, digits = 2) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = T, position = "center")

## ----analyzeDepressionPlot, include=T, echo = F, results='html'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$depression$plot

## ----analyzeDepressionTbl, include=T, echo = F, results='html'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$depression$table, digits = 1) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----analyzeChronicPlot, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$chronic$plot

## ----analyzeChronicTbl, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$chronic$table, digits = 1) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----analyzeIncomePlot, include=T, echo = F, results='html', fig.height = 8---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$income$plot

## ----analyzeIncomeTbl, include=T, echo = F, results='html', fig.height=8------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$income$table, digits = 1) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----analyzeEducationPlot, include=T, echo = F, results='html', fig.height=10-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$education$plot

## ----analyzeEducationTbl, include=T, echo = F, results='html', fig.height=10--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$education$table, digits = 1) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----sickDaysStats, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$sickDays$stats1, digits = c(0,0,0,0,1,0,0,0,2,0,3,0,0,2,3,2,2)) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----sickDaysHist1, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$sickDays$hist1

## ----sickDaysHist2, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$sickDays$hist2

## ----visitsStats, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(univariate$visits$stats, digits = c(0,0,0,0,0,0,0,0,2,0,3,0,0,2,3,2,2)) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----visitsHist, include=T, echo = F, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
univariate$visits$hist

## ----rq1IncomeFreqTable, echo = F, results='asis'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$incomeFreq, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq1IncomePropTable, echo = F, results='asis'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$incomeProp, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq1IncomePlots, include=T, echo = F, results='html'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq1$plots$incomeFreq, rq1$plots$incomeProp, ncol = 2)

## ----rq1IncomeMosaic, include=T, fig.height=10, fig.width=14, echo = F, results='html'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  vcd::mosaic(rq1$tables$incomeTable, shade = TRUE, legend = TRUE,
         labeling= vcd::labeling_border(rot_labels = c(0,0,0,0), 
                                   varnames = c(FALSE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 10),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right")))

## ----rq1IncomeOdds, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$incomeOdds, digits = 2) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = T, position = "center")

## ----rq1EducationFreqTable, include=T, echo = F, results='asis'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$educationFreq, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq1EducationPropTable, include=T, echo = F, results='asis'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$educationProp, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq1EducationPlots, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq1$plots$educationFreq, rq1$plots$educationProp, ncol = 2, top = "Distribution of Diagnoses of Depression")

## ----rq1EducationMosaic, include=T, fig.height=10, fig.width=14, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  vcd::mosaic(rq1$tables$educationTable, shade = TRUE, legend = TRUE,
         labeling= vcd::labeling_border(rot_labels = c(0,0,0,0), 
                                   varnames = c(FALSE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 15),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right")))

## ----rq1EducationOdds, include=T, echo = F, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$educationOdds, digits = 2) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = T, position = "center")

## ----rq1InteractionPlots, include=T, echo = F, fig.height=10, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq1$plots$conditionalProp[[1]], rq1$plots$conditionalProp[[2]],
             rq1$plots$conditionalProp[[3]], rq1$plots$conditionalProp[[4]], ncol = 2, top = "Proportional Distribution of Depression by Income and Education")

## ----rq1ConditionalMosaic, include=T, fig.height=6, fig.width=10, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lnames <- list(Income = c("< 15k", "< 25k", "< 35k", "< 50k", "50k +"),
               Education = c("Did not graduate high school", "Graduated high school",
                             "Some College", "Graduated College"))
  vcd::mosaic(rq1$tables$freq, shade = TRUE, legend = TRUE,
         labeling= vcd::labeling_border(rot_labels = c(0,0,0,0), 
                                   varnames = c(FALSE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 10),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right"),
                                   set_labels = lnames))

## ----rq1CMH1, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$tests$condInd[[1]]$df, digits = c(0,0,0,0,4), caption = 'Cochran–Mantel–Haenszel for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Did not graduate high school' = 5))

## ----rq1CMH2, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$tests$condInd[[2]]$df, digits = c(0,0,0,0,4), caption = 'Cochran–Mantel–Haenszel for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Graduated high school' = 5))

## ----rq1CMH3, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$tests$condInd[[3]]$df, digits = c(0,0,0,0,4), caption = 'Cochran–Mantel–Haenszel for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Attended college or technical school' = 5))

## ----rq1CMH4, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$tests$condInd[[4]]$df, digits = c(0,0,0,0,4), caption = 'Cochran–Mantel–Haenszel for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Graduated college or technical school' = 5))

## ----rq1ConditionalOdds1, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$conditionalOdds[[1]]$df, digits = 2, caption = 'Conditional Odds Ratios for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Did not graduate high school' = 2))

## ----rq1ConditionalOdds2, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$conditionalOdds[[2]]$df, digits = 2, caption = 'Conditional Odds Ratios for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Graduated high school' = 2))

## ----rq1ConditionalOdds3, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$conditionalOdds[[3]]$df, digits = 2, caption = 'Conditional Odds Ratios for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Attended college or technical school' = 2))

## ----rq1ConditionalOdds4, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$conditionalOdds[[4]]$df, digits = 2, caption = 'Conditional Odds Ratios for Depression by Income') %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c('Stratum: Graduated college or technical school' = 2))

## ----rq1InteractionFreqTable, include=T, echo = F, results='asis'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$jointFreq, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq1InteractionPropTable, include=T, echo = F, results='asis'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq1$tables$jointProp, quote = FALSE, justify = "right", big.mark = ",", digits = 3),  type = 'html')

## ----rq1InteractionMosaic, include=T, fig.height=16, fig.width=18, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
lnames <- list(IncomeEducation = c("No High School (<15k)",
                                   "No High School (<25k)",
                                   "No High School (<35k)",
                                   "No High School (<50k)",
                                   "No High School (50k+)",
                                   "High School (<15k)",
                                   "High School (<25k)",
                                   "High School (<35k)",
                                   "High School (<50k)",
                                   "High School (50k+)",
                                   "Some College(<15k)",
                                   "Some College (<25k)",
                                   "Some College (<35k)",
                                   "Some College (<50k)",
                                   "Some College (50k+)",
                                   "College Graduage(<15k)",
                                   "College Graduage(<25k)",
                                   "College Graduage(<35k)",
                                   "College Graduage(<50k)",
                                   "College Graduage(50k+)"))
  vcd::mosaic(rq1$tables$interactionTable, shade = TRUE, legend = TRUE,
         labeling= vcd::labeling_border(rot_labels = c(0,0,0,0), 
                                   varnames = c(FALSE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 10),
                                   gp_varnames = grid::gpar(fontsize = 20),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right"),
                                   set_labels = lnames))

## ----rq1JointOdds, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq1$analysis$interactionOdds %>% select(Income, Odds), digits = 2) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::group_rows("Did not graduate high school/Yes:No",1,5) %>%
  kableExtra::group_rows("Graduate high school/Yes:No",6,10) %>%
  kableExtra::group_rows("Attended college or technical school/Yes:No",11,15) %>%
  kableExtra::group_rows("Graduated college or technical school/Yes:No",16,19)

## ----rq2FreqTbl, include=T, echo = F, results='asis'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq2$tables$freq, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq2PropTbl, include=T, echo = F, results='asis'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq2$tables$prop, quote = FALSE, digits = 2, justify = "right", big.mark = ","), type = 'html')

## ----rq2Plots, include=T, echo = F, results='html'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq2$plots$freq, rq2$plots$prop, ncol = 2, top = "Depression and Chronic Illness")

## ----rq2Mosaic, include=T, fig.height=8, fig.width=10, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  vcd::mosaic(rq2$tables$r2, shade = TRUE, legend = TRUE,
         labeling = vcd::labeling_border(rot_labels = c(0,0,0,0),
                                   offset_labels = c(0,0,0,0), 
                                   varnames = c(TRUE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 10),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right")))

## ----rq3DepressionStats, echo = F, message = FALSE, warning=FALSE-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq3$stats$depression) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = T, position = "center")

## ----rq3DepressionBar, include=T, echo = F, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq3$plots$depressionFreqBar, rq3$plots$depressionPropBar, ncol = 2, top = 'Depression and Reports of One or More Sick Days')

## ----rq3DepressionBox, include=T, echo = F, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq3$plots$depressionViolin, rq3$plots$depressionBox, ncol = 2, top = "Distribution Summary of Reports of Sick Days by Diagnosis of Chronic Illness")

## ----rq3DepressionHist1, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$depressionHist1

## ----rq3DepressionHist2, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$depressionHist2

## ----rq3ChronicStats, echo = F, message = FALSE, warning=FALSE----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq3$stats$chronic) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----rq3ChronicBar, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq3$plots$chronicFreqBar, rq3$plots$chronicPropBar, ncol = 2, top = 'Chronic Illness and Reports of One or More Sick Days')

## ----rq3ChronicBox, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq3$plots$chronicViolin, rq3$plots$chronicBox, ncol = 2, top = "Distribution Summary of Reports of Sick Days by Diagnosis of Chronic Illness")

## ----rq3ChronicHist1, include=T, echo = F, results='html'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$chronicHist1

## ----rq3ChronicHist2, include=T, echo = F, results='html'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$chronicHist2

## ----rq3InteractionFreqTbl, include=T, echo = F, results='asis'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq3$tables$interactionFreqTbl, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq3InteractionPropTbl, include=T, echo = F, results='asis'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
stargazer::stargazer(format(rq3$tables$interactionPropTbl, quote = FALSE, justify = "right", big.mark = ","), type = 'html')

## ----rq3Mosaic, include=T, fig.height=6, fig.width=10, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  vcd::mosaic(rq3$tables$interactionTbl, shade = TRUE, legend = TRUE,
         labeling= vcd::labeling_border(rot_labels = c(0,0,0,0), 
                                   varnames = c(TRUE, TRUE),
                                   gp_labels = grid::gpar(fontsize = 10),
                                   just_labels = c("left", 
                                                   "center", 
                                                   "center", 
                                                   "right")))

## ----rq3InteractionStats, echo = F, message = FALSE, warning=FALSE------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq3$stats$interaction) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----rq3InteractionBox, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq3$plots$interactionViolin, rq3$plots$interactionBox, ncol = 2, top = "Depression and Chronic Illness and Summary of Distribution of Sick Days")

## ----rq3InteractionHist1, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$interactionHist1

## ----rq3InteractionHist2, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq3$plots$interactionHist2

## ----rq3InteractionPlot, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  interactionPlot <- plot(effects::allEffects(rq3$tests$interactionModel), multiline=TRUE, ci.style="bars")

## ----rq3Pairwise, echo = F, message = FALSE, warning=FALSE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq3$tests$pairwise) %>% 
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c(" " = 1, "Group A" = 2, "Group B" = 2, " " = 6))

## ----rq3AllChronicPlot, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  rq3$plots$allChronic

## ----rq4DepressionStats, echo = F, message = FALSE, warning=FALSE-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq4$stats$depression) %>% 
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----rq4DepressionBox, include=T, echo = F, results='html'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq4$plots$depressionViolin, rq4$plots$depressionBox, ncol = 2, top = "Depression and Summary Distribution of Dr. Visits")

## ----rq4DepressionHist1, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$depressionHist1

## ----rq4DepressionHist2, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$depressionHist2

## ----rq4ChronicStats, echo = F, message = FALSE, warning=FALSE----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq4$stats$chronic) %>% 
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") 

## ----rq4ChronicBox, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq4$plots$chronicViolin, rq4$plots$chronicBox, ncol = 2, top = "Chronic Illness and Summary Distribution of Dr. Visits")

## ----rq4ChronicHist1, include=T, echo = F, results='html'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$chronicHist1

## ----rq4ChronicHist2, include=T, echo = F, results='html'---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$chronicHist2

## ----rq4InteractionStats, echo = F, message = FALSE, warning=FALSE------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq4$stats$interaction) %>%  
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center")

## ----rq4InteractionBox, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
gridExtra::grid.arrange(rq4$plots$interactionViolin, rq4$plots$interactionBox, ncol = 2, top = "Depression and Chronic Illness and Summary of Distribution of Dr. Visits")

## ----rq4InteractionHist1, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$interactionHist1

## ----rq4InteractionHist2, include=T, echo = F, results='html'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
rq4$plots$interactionHist2

## ----rq4InteractionPlot, include=T, echo = F, results='html'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  interactionPlot <- plot(effects::allEffects(rq4$tests$interactionModel), multiline=TRUE, ci.style="bars")

## ----rq4Pairwise, echo = F, message = FALSE, warning=FALSE--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
knitr::kable(rq4$tests$pairwise) %>% 
  kableExtra::kable_styling(bootstrap_options = c("hover", "condensed", "responsive"), full_width = F, position = "center") %>%
  kableExtra::add_header_above(c(" " = 1, "Group A" = 2, "Group B" = 2, " " = 6))

## ----rq4AllChronicPlot, include=T, echo = F, results='html'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  rq4$plots$allChronic
DataScienceSalon/chronic documentation built on May 8, 2019, 11:47 a.m.