7 Combining tables

Tables can be nested with the nestTable() function

cohortA <- rm_uvsum(data=subset(pembrolizumab,cohort=='A'), 
                     response = 'pdl1',
                     covs=c('age','sex'),
                     tableOnly = T)
cohortA$Cohort <- 'Cohort A'
cohortE <- rm_uvsum(data=subset(pembrolizumab,cohort=='E'), 
                     response = 'pdl1',
                     covs=c('age','sex'),
                     tableOnly = T)
cohortE$Cohort <- 'Cohort E'
nestTable(rbind(cohortA,cohortE),head_col = 'Cohort',to_col = 'Covariate')
Estimate(95%CI) p-value N
Cohort A
age 2.94 (-0.70, 6.58) 0.10 15
sex 0.14 15
Female Reference 3
Male -40.25 (-96.25, 15.75) 12
Cohort E
age -0.44 (-1.02, 0.15) 0.14 30
sex 0.10 30
Female Reference 12
Male -14.86 (-32.57, 2.85) 18