The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Introducing jstable options

Jinseob Kim

2025-03-05

Introducing count_by, event options in TableSubgroupMultiCox

TableSubgroupMultiCox

lung %>%
  mutate(
    status = as.integer(status == 1),
    sex = factor(sex),
    kk = factor(as.integer(pat.karno >= 70)),
    kk1 = factor(as.integer(pat.karno >= 60)),
    ph.ecog = factor(ph.ecog)
  ) -> lung
lung.label <- mk.lev(lung)
lung.label <- lung.label %>%
  mutate(
    val_label = case_when(
      variable == "sex" & level == "1" ~ "Male",
      variable == "sex" & level == "2" ~ "Female",
      variable == "kk" & level == "0" ~ "No",
      variable == "kk" & level == "1" ~ "Yes",
      variable == "kk1" & level == "0" ~ "No",
      variable == "kk1" & level == "1" ~ "Yes",
      TRUE ~ val_label
    )
  )

Counting the Number of Independent Variables for Comparison

The default option for count_by is set to NULL. By specifying an independent variable in the count_by option, the table will display the counts for each level of the independent variable.

TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data = lung, time_eventrate = 100, line = TRUE, cluster = "inst", strata = "inst", weights = "age", event = FALSE, count_by = "sex", labeldata = lung.label)
#>     Variable Count Count(sex=Male) Count(sex=Female) Percent Point Estimate
#> sex  Overall   227             138                90     100           1.66
#> 1       <NA>  <NA>            <NA>              <NA>    <NA>           <NA>
#> 2         kk  <NA>            <NA>              <NA>    <NA>           <NA>
#> 3         No    38              22                16      17   193294637.42
#> 4        Yes   186             114                73      83           1.44
#> 5       <NA>  <NA>            <NA>              <NA>    <NA>           <NA>
#> 6        kk1  <NA>            <NA>              <NA>    <NA>           <NA>
#> 7         No     8               4                 4     3.6           <NA>
#> 8        Yes   216             132                85    96.4           1.55
#>           Lower         Upper sex=1 sex=2 P value P for interaction
#> sex        1.09          2.53     0   1.2   0.019              <NA>
#> 1          <NA>          <NA>  <NA>  <NA>    <NA>              <NA>
#> 2          <NA>          <NA>  <NA>  <NA>    <NA>             0.562
#> 3   27228158.02 1372212428.98     0     0  <0.001              <NA>
#> 4          0.95          2.18     0   1.5   0.084              <NA>
#> 5          <NA>          <NA>  <NA>  <NA>    <NA>              <NA>
#> 6          <NA>          <NA>  <NA>  <NA>    <NA>            <0.001
#> 7          <NA>          <NA>     0     0    <NA>              <NA>
#> 8             1          2.41     0   1.3   0.049              <NA>

Calculate crude incidence rate of event

The default value for the event option is set to FALSE. By setting event to TRUE, the table will display the crude incidence rate of events. This rate is calculated using the number of events as the numerator and the count of the independent variable as the denominator.(Different from Kaplan-Meier Estimates)

TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data = lung, time_eventrate = 100, line = TRUE, cluster = "inst", strata = "inst", weights = "age", event = TRUE, count_by = "sex", labeldata = lung.label)
#>     Variable          Count Count(sex=Male) Count(sex=Female) Percent
#> sex  Overall 63/228 (27.6%)  26/138 (18.8%)     37/90 (41.1%)     100
#> 1       <NA>           <NA>            <NA>              <NA>    <NA>
#> 2         kk           <NA>            <NA>              <NA>    <NA>
#> 3         No             38     1/22 (4.5%)        4/16 (25%)      17
#> 4        Yes            186  25/114 (21.9%)     33/73 (45.2%)      83
#> 5       <NA>           <NA>            <NA>              <NA>    <NA>
#> 6        kk1           <NA>            <NA>              <NA>    <NA>
#> 7         No              8        0/4 (0%)         2/4 (50%)     3.6
#> 8        Yes            216  26/132 (19.7%)     35/85 (41.2%)    96.4
#>     Point Estimate       Lower         Upper sex=1 sex=2 P value
#> sex           1.66        1.09          2.53     0   1.2   0.019
#> 1             <NA>        <NA>          <NA>  <NA>  <NA>    <NA>
#> 2             <NA>        <NA>          <NA>  <NA>  <NA>    <NA>
#> 3     193294637.42 27228158.02 1372212428.98     0     0  <0.001
#> 4             1.44        0.95          2.18     0   1.5   0.084
#> 5             <NA>        <NA>          <NA>  <NA>  <NA>    <NA>
#> 6             <NA>        <NA>          <NA>  <NA>  <NA>    <NA>
#> 7             <NA>        <NA>          <NA>     0     0    <NA>
#> 8             1.55           1          2.41     0   1.3   0.049
#>     P for interaction
#> sex              <NA>
#> 1                <NA>
#> 2               0.562
#> 3                <NA>
#> 4                <NA>
#> 5                <NA>
#> 6              <0.001
#> 7                <NA>
#> 8                <NA>

Using both count_by and event option is also available

By using both count_by and event option, the table will display crude incidence rate and the counts for each level of the independant variable.

TableSubgroupMultiCox(Surv(time, status) ~ sex, var_subgroups = c("kk", "kk1"), data = lung, time_eventrate = 100, line = TRUE, cluster = "inst", strata = "inst", weights = "age", event = TRUE, count_by = NULL, labeldata = lung.label)
#>     Variable          Count Percent Point Estimate       Lower         Upper
#> sex  Overall 63/228 (27.6%)     100           1.66        1.09          2.53
#> 1       <NA>           <NA>    <NA>           <NA>        <NA>          <NA>
#> 2         kk           <NA>    <NA>           <NA>        <NA>          <NA>
#> 3         No             38      17   193294637.42 27228158.02 1372212428.98
#> 4        Yes            186      83           1.44        0.95          2.18
#> 5       <NA>           <NA>    <NA>           <NA>        <NA>          <NA>
#> 6        kk1           <NA>    <NA>           <NA>        <NA>          <NA>
#> 7         No              8     3.6           <NA>        <NA>          <NA>
#> 8        Yes            216    96.4           1.55           1          2.41
#>     sex=1 sex=2 P value P for interaction
#> sex     0   1.2   0.019              <NA>
#> 1    <NA>  <NA>    <NA>              <NA>
#> 2    <NA>  <NA>    <NA>             0.562
#> 3       0     0  <0.001              <NA>
#> 4       0   1.5   0.084              <NA>
#> 5    <NA>  <NA>    <NA>              <NA>
#> 6    <NA>  <NA>    <NA>            <0.001
#> 7       0     0    <NA>              <NA>
#> 8       0   1.3   0.049              <NA>

Introducing pairwise option

Introducing pairwise, pairwise.showtest option in CreateTableOneJS

The default value for the pairwise option is FALSE. By setting pairwise to TRUE, the table will display p-values for pairwise comparisons of stratified groups.

CreateTableOneJS(vars = names(lung), strata = "ph.ecog", data = lung, showAllLevels = F, labeldata = lung.label, Labels = T, pairwise = T)
#> $table
#>                  0                 1                 2                
#> n                "    63"          "   113"          "    50"         
#> inst             "  9.60 ± 8.20"   " 11.41 ± 7.99"   " 12.02 ± 9.08"  
#> time             "351.87 ± 220.47" "314.44 ± 207.08" "234.08 ± 189.85"
#> status           "  0.41 ± 0.50"   "  0.27 ± 0.45"   "  0.12 ± 0.33"  
#> age              " 61.16 ± 9.57"   " 61.45 ± 8.87"   " 66.22 ± 8.11"  
#> sex = Female (%) "    27 ( 42.9) " "    42 ( 37.2) " "    21 ( 42.0) "
#> ph.ecog (%)      "    "            "   "             "    "           
#>    0             "    63 (100.0) " "     0 (  0.0) " "     0 (  0.0) "
#>    1             "     0 (  0.0) " "   113 (100.0) " "     0 (  0.0) "
#>    2             "     0 (  0.0) " "     0 (  0.0) " "    50 (100.0) "
#>    3             "     0 (  0.0) " "     0 (  0.0) " "     0 (  0.0) "
#> ph.karno         " 93.97 ± 5.83"   " 82.65 ± 7.44"   " 65.71 ± 7.91"  
#> pat.karno        " 87.42 ± 10.23"  " 82.30 ± 11.95"  " 65.21 ± 15.16" 
#> meal.cal         "924.84 ± 388.40" "992.26 ± 384.22" "796.12 ± 435.37"
#> wt.loss          "  6.00 ± 8.81"   " 10.59 ± 14.18"  " 12.51 ± 14.40" 
#> kk = Yes (%)     "    61 ( 98.4) " "   101 ( 89.4) " "    23 ( 47.9) "
#> kk1 = Yes (%)    "    62 (100.0) " "   113 (100.0) " "    40 ( 83.3) "
#>                  3                  p        test    p(0 vs 1) p(0 vs 2)
#> n                "      1"          ""       ""      ""        ""       
#> inst             "  13.00 ± NA"     " NA"    ""      " 0.161"  " 0.148" 
#> time             " 118.00 ± NA"     " NA"    ""      " 0.272"  " 0.003" 
#> status           "   0.00 ± NA"     " NA"    ""      " 0.069"  "<0.001" 
#> age              "  70.00 ± NA"     " NA"    ""      " 0.842"  " 0.003" 
#> sex = Female (%) "      0 (  0.0) " " 0.823" "exact" " 0.562"  " 1.000" 
#> ph.ecog (%)      "      "           "    NA" "exact" ""        ""       
#>    0             "      0 (  0.0) " ""       ""      ""        ""       
#>    1             "      0 (  0.0) " ""       ""      ""        ""       
#>    2             "      0 (  0.0) " ""       ""      ""        ""       
#>    3             "      1 (100.0) " ""       ""      ""        ""       
#> ph.karno         "  60.00 ± NA"     " NA"    ""      "<0.001"  "<0.001" 
#> pat.karno        "  70.00 ± NA"     " NA"    ""      " 0.003"  "<0.001" 
#> meal.cal         "1075.00 ± NA"     " NA"    ""      " 0.329"  " 0.139" 
#> wt.loss          "  20.00 ± NA"     " NA"    ""      " 0.011"  " 0.009" 
#> kk = Yes (%)     "      1 (100.0) " "<0.001" "exact" " 0.034"  "<0.001" 
#> kk1 = Yes (%)    "      1 (100.0) " "<0.001" "exact" " 1.000"  " 0.001" 
#>                  p(0 vs 3) p(1 vs 2) p(1 vs 3) p(2 vs 3) sig 
#> n                ""        ""        ""        ""        NA  
#> inst             " NA"     " 0.684"  " NA"     " NA"     NA  
#> time             " NA"     " 0.017"  " NA"     " NA"     NA  
#> status           " NA"     " 0.015"  " NA"     " NA"     NA  
#> age              " NA"     " 0.001"  " NA"     " NA"     NA  
#> sex = Female (%) " 1.000"  " 0.682"  " 1.000"  " 1.000"  ""  
#> ph.ecog (%)      ""        ""        ""        ""        NA  
#>    0             ""        ""        ""        ""        NA  
#>    1             ""        ""        ""        ""        NA  
#>    2             ""        ""        ""        ""        NA  
#>    3             ""        ""        ""        ""        NA  
#> ph.karno         " NA"     "<0.001"  " NA"     " NA"     NA  
#> pat.karno        " NA"     "<0.001"  " NA"     " NA"     NA  
#> meal.cal         " NA"     " 0.014"  " NA"     " NA"     NA  
#> wt.loss          " NA"     " 0.455"  " NA"     " NA"     NA  
#> kk = Yes (%)     " 1.000"  "<0.001"  " 1.000"  " 0.490"  "**"
#> kk1 = Yes (%)    " 1.000"  "<0.001"  " 1.000"  " 1.000"  "**"
#> 
#> $caption
#> [1] "Stratified by ph.ecog"

By setting pairwise.showtest option to TRUE, the table will display test used to calculate p-values for pairwise comparisons of stratified groups. Default test for categorical variables are chi-sq test and continuous variables are t-test.

CreateTableOneJS(vars = names(lung), strata = "ph.ecog", data = lung, showAllLevels = F, labeldata = lung.label, Labels = T, pairwise = T, pairwise.showtest = T)
#> $table
#>                  0                 1                 2                
#> n                "    63"          "   113"          "    50"         
#> inst             "  9.60 ± 8.20"   " 11.41 ± 7.99"   " 12.02 ± 9.08"  
#> time             "351.87 ± 220.47" "314.44 ± 207.08" "234.08 ± 189.85"
#> status           "  0.41 ± 0.50"   "  0.27 ± 0.45"   "  0.12 ± 0.33"  
#> age              " 61.16 ± 9.57"   " 61.45 ± 8.87"   " 66.22 ± 8.11"  
#> sex = Female (%) "    27 ( 42.9) " "    42 ( 37.2) " "    21 ( 42.0) "
#> ph.ecog (%)      "    "            "   "             "    "           
#>    0             "    63 (100.0) " "     0 (  0.0) " "     0 (  0.0) "
#>    1             "     0 (  0.0) " "   113 (100.0) " "     0 (  0.0) "
#>    2             "     0 (  0.0) " "     0 (  0.0) " "    50 (100.0) "
#>    3             "     0 (  0.0) " "     0 (  0.0) " "     0 (  0.0) "
#> ph.karno         " 93.97 ± 5.83"   " 82.65 ± 7.44"   " 65.71 ± 7.91"  
#> pat.karno        " 87.42 ± 10.23"  " 82.30 ± 11.95"  " 65.21 ± 15.16" 
#> meal.cal         "924.84 ± 388.40" "992.26 ± 384.22" "796.12 ± 435.37"
#> wt.loss          "  6.00 ± 8.81"   " 10.59 ± 14.18"  " 12.51 ± 14.40" 
#> kk = Yes (%)     "    61 ( 98.4) " "   101 ( 89.4) " "    23 ( 47.9) "
#> kk1 = Yes (%)    "    62 (100.0) " "   113 (100.0) " "    40 ( 83.3) "
#>                  3                  p        test    p(0 vs 1) test(0 vs 1)
#> n                "      1"          ""       ""      ""        ""          
#> inst             "  13.00 ± NA"     " NA"    ""      " 0.161"  ""          
#> time             " 118.00 ± NA"     " NA"    ""      " 0.272"  ""          
#> status           "   0.00 ± NA"     " NA"    ""      " 0.069"  ""          
#> age              "  70.00 ± NA"     " NA"    ""      " 0.842"  ""          
#> sex = Female (%) "      0 (  0.0) " " 0.823" "exact" " 0.562"  ""          
#> ph.ecog (%)      "      "           "    NA" "exact" ""        ""          
#>    0             "      0 (  0.0) " ""       ""      ""        ""          
#>    1             "      0 (  0.0) " ""       ""      ""        ""          
#>    2             "      0 (  0.0) " ""       ""      ""        ""          
#>    3             "      1 (100.0) " ""       ""      ""        ""          
#> ph.karno         "  60.00 ± NA"     " NA"    ""      "<0.001"  ""          
#> pat.karno        "  70.00 ± NA"     " NA"    ""      " 0.003"  ""          
#> meal.cal         "1075.00 ± NA"     " NA"    ""      " 0.329"  ""          
#> wt.loss          "  20.00 ± NA"     " NA"    ""      " 0.011"  ""          
#> kk = Yes (%)     "      1 (100.0) " "<0.001" "exact" " 0.034"  "exact"     
#> kk1 = Yes (%)    "      1 (100.0) " "<0.001" "exact" " 1.000"  "exact"     
#>                  p(0 vs 2) test(0 vs 2) p(0 vs 3) test(0 vs 3) p(1 vs 2)
#> n                ""        ""           ""        ""           ""       
#> inst             " 0.148"  ""           " NA"     ""           " 0.684" 
#> time             " 0.003"  ""           " NA"     ""           " 0.017" 
#> status           "<0.001"  ""           " NA"     ""           " 0.015" 
#> age              " 0.003"  ""           " NA"     ""           " 0.001" 
#> sex = Female (%) " 1.000"  ""           " 1.000"  "exact"      " 0.682" 
#> ph.ecog (%)      ""        ""           ""        ""           ""       
#>    0             ""        ""           ""        ""           ""       
#>    1             ""        ""           ""        ""           ""       
#>    2             ""        ""           ""        ""           ""       
#>    3             ""        ""           ""        ""           ""       
#> ph.karno         "<0.001"  ""           " NA"     ""           "<0.001" 
#> pat.karno        "<0.001"  ""           " NA"     ""           "<0.001" 
#> meal.cal         " 0.139"  ""           " NA"     ""           " 0.014" 
#> wt.loss          " 0.009"  ""           " NA"     ""           " 0.455" 
#> kk = Yes (%)     "<0.001"  ""           " 1.000"  "exact"      "<0.001" 
#> kk1 = Yes (%)    " 0.001"  "exact"      " 1.000"  "exact"      "<0.001" 
#>                  test(1 vs 2) p(1 vs 3) test(1 vs 3) p(2 vs 3) test(2 vs 3)
#> n                ""           ""        ""           ""        ""          
#> inst             ""           " NA"     ""           " NA"     ""          
#> time             ""           " NA"     ""           " NA"     ""          
#> status           ""           " NA"     ""           " NA"     ""          
#> age              ""           " NA"     ""           " NA"     ""          
#> sex = Female (%) ""           " 1.000"  "exact"      " 1.000"  "exact"     
#> ph.ecog (%)      ""           ""        ""           ""        ""          
#>    0             ""           ""        ""           ""        ""          
#>    1             ""           ""        ""           ""        ""          
#>    2             ""           ""        ""           ""        ""          
#>    3             ""           ""        ""           ""        ""          
#> ph.karno         ""           " NA"     ""           " NA"     ""          
#> pat.karno        ""           " NA"     ""           " NA"     ""          
#> meal.cal         ""           " NA"     ""           " NA"     ""          
#> wt.loss          ""           " NA"     ""           " NA"     ""          
#> kk = Yes (%)     ""           " 1.000"  "exact"      " 0.490"  "exact"     
#> kk1 = Yes (%)    "exact"      " 1.000"  "exact"      " 1.000"  "exact"     
#>                  sig 
#> n                NA  
#> inst             NA  
#> time             NA  
#> status           NA  
#> age              NA  
#> sex = Female (%) ""  
#> ph.ecog (%)      NA  
#>    0             NA  
#>    1             NA  
#>    2             NA  
#>    3             NA  
#> ph.karno         NA  
#> pat.karno        NA  
#> meal.cal         NA  
#> wt.loss          NA  
#> kk = Yes (%)     "**"
#> kk1 = Yes (%)    "**"
#> 
#> $caption
#> [1] "Stratified by ph.ecog"

Introducing pairwise option in svyCreateTableOneJS

The default value for the pairwise option is FALSE. By setting pairwise to TRUE, the table will display p-values for pairwise comparisons of stratified groups.

library(survey)
data(nhanes)
nhanes$SDMVPSU <- as.factor(nhanes$SDMVPSU)
nhanes$race <- as.factor(nhanes$race)
nhanes$RIAGENDR <- as.factor(nhanes$RIAGENDR)
a.label <- mk.lev(nhanes)
a.label <- a.label %>%
  dplyr::mutate(val_label = case_when(
    variable == "race" & level == "1" ~ "White",
    variable == "race" & level == "2" ~ "Black",
    variable == "race" & level == "3" ~ "Hispanic",
    variable == "race" & level == "4" ~ "Asian",
    TRUE ~ val_label
  ))
nhanesSvy <- svydesign(ids = ~SDMVPSU, strata = ~SDMVSTRA, weights = ~WTMEC2YR, nest = TRUE, data = nhanes)

svyCreateTableOneJS(
  vars = c("HI_CHOL", "race", "agecat", "RIAGENDR"),
  strata = "race", data = nhanesSvy, factorVars = c("HI_CHOL", "race", "RIAGENDR"), labeldata = a.label, Labels = T, pairwise = T
)
#> $table
#>              race       White                 Black                 
#> n            ""         "41633251.6"          "181802696.6"         
#> HI_CHOL (%)  NA         "34942048.8 ( 89.9) " "148741789.8 ( 87.8) "
#>              NA         " 3946904.7 ( 10.1) " " 20600334.9 ( 12.2) "
#> race (%)     "White"    "41633251.6 (100.0) " "        0.0 (  0.0) "
#>              "Black"    "       0.0 (  0.0) " "181802696.6 (100.0) "
#>              "Hispanic" "       0.0 (  0.0) " "        0.0 (  0.0) "
#>              "Asian"    "       0.0 (  0.0) " "        0.0 (  0.0) "
#> agecat (%)   "(0,19]"   "11800237.9 ( 28.3) " " 33019782.9 ( 18.2) "
#>              "(19,39]"  "15552222.8 ( 37.4) " " 47901111.6 ( 26.3) "
#>              "(39,59]"  "10267085.3 ( 24.7) " " 58158804.5 ( 32.0) "
#>              "(59,Inf]" " 4013705.6 (  9.6) " " 42722997.6 ( 23.5) "
#> RIAGENDR (%) "1"        "21381884.2 ( 51.4) " " 89315751.4 ( 49.1) "
#>              "2"        "20251367.4 ( 48.6) " " 92486945.1 ( 50.9) "
#>              Hispanic              Asian                 p        test
#> n            "33012683.8"          "20087814.0"          ""       ""  
#> HI_CHOL (%)  "26641367.6 ( 92.1) " "16385458.6 ( 90.0) " " 0.059" ""  
#>              " 2273898.3 (  7.9) " " 1814107.4 ( 10.0) " ""       ""  
#> race (%)     "       0.0 (  0.0) " "       0.0 (  0.0) " "    NA" ""  
#>              "       0.0 (  0.0) " "       0.0 (  0.0) " ""       ""  
#>              "33012683.8 (100.0) " "       0.0 (  0.0) " ""       ""  
#>              "       0.0 (  0.0) " "20087814.0 (100.0) " ""       ""  
#> agecat (%)   " 8064159.5 ( 24.4) " " 4566126.4 ( 22.7) " "<0.001" ""  
#>              "10459873.4 ( 31.7) " " 7224766.9 ( 36.0) " ""       ""  
#>              " 9630300.4 ( 29.2) " " 5814433.3 ( 28.9) " ""       ""  
#>              " 4858350.5 ( 14.7) " " 2482487.5 ( 12.4) " ""       ""  
#> RIAGENDR (%) "15045455.5 ( 45.6) " " 9201462.9 ( 45.8) " " 0.042" ""  
#>              "17967228.3 ( 54.4) " "10886351.1 ( 54.2) " ""       ""  
#>              p(White vs Black) p(White vs Hispanic) p(White vs Asian)
#> n            ""                ""                   ""               
#> HI_CHOL (%)  " 0.031"          " 0.103"             " 0.947"         
#>              ""                ""                   ""               
#> race (%)     "<0.001"          "<0.001"             "<0.001"         
#>              ""                ""                   ""               
#>              ""                ""                   ""               
#>              ""                ""                   ""               
#> agecat (%)   "<0.001"          " 0.002"             " 0.079"         
#>              ""                ""                   ""               
#>              ""                ""                   ""               
#>              ""                ""                   ""               
#> RIAGENDR (%) " 0.016"          " 0.001"             " 0.081"         
#>              ""                ""                   ""               
#>              p(Black vs Hispanic) p(Black vs Asian) p(Hispanic vs Asian) sig 
#> n            ""                   ""                ""                   NA  
#> HI_CHOL (%)  " 0.003"             " 0.429"          " 0.341"             ""  
#>              ""                   ""                ""                   NA  
#> race (%)     "<0.001"             "<0.001"          "<0.001"             NA  
#>              ""                   ""                ""                   NA  
#>              ""                   ""                ""                   NA  
#>              ""                   ""                ""                   NA  
#> agecat (%)   "<0.001"             "<0.001"          " 0.455"             "**"
#>              ""                   ""                ""                   NA  
#>              ""                   ""                ""                   NA  
#>              ""                   ""                ""                   NA  
#> RIAGENDR (%) " 0.008"             " 0.262"          " 0.944"             "**"
#>              ""                   ""                ""                   NA  
#> 
#> $caption
#> [1] "Stratified by race- weighted data"

By setting pairwise.showtest option to TRUE, the table will display test used to calculate p-values for pairwise comparisons of stratified groups.

svyCreateTableOneJS(
  vars = c("HI_CHOL", "race", "agecat", "RIAGENDR"),
  strata = "race", data = nhanesSvy, factorVars = c("HI_CHOL", "race", "RIAGENDR"), labeldata = a.label, Labels = T, pairwise = T, pairwise.showtest = T
)
#> $table
#>              race       White                 Black                 
#> n            ""         "41633251.6"          "181802696.6"         
#> HI_CHOL (%)  NA         "34942048.8 ( 89.9) " "148741789.8 ( 87.8) "
#>              NA         " 3946904.7 ( 10.1) " " 20600334.9 ( 12.2) "
#> race (%)     "White"    "41633251.6 (100.0) " "        0.0 (  0.0) "
#>              "Black"    "       0.0 (  0.0) " "181802696.6 (100.0) "
#>              "Hispanic" "       0.0 (  0.0) " "        0.0 (  0.0) "
#>              "Asian"    "       0.0 (  0.0) " "        0.0 (  0.0) "
#> agecat (%)   "(0,19]"   "11800237.9 ( 28.3) " " 33019782.9 ( 18.2) "
#>              "(19,39]"  "15552222.8 ( 37.4) " " 47901111.6 ( 26.3) "
#>              "(39,59]"  "10267085.3 ( 24.7) " " 58158804.5 ( 32.0) "
#>              "(59,Inf]" " 4013705.6 (  9.6) " " 42722997.6 ( 23.5) "
#> RIAGENDR (%) "1"        "21381884.2 ( 51.4) " " 89315751.4 ( 49.1) "
#>              "2"        "20251367.4 ( 48.6) " " 92486945.1 ( 50.9) "
#>              Hispanic              Asian                 p        test
#> n            "33012683.8"          "20087814.0"          ""       ""  
#> HI_CHOL (%)  "26641367.6 ( 92.1) " "16385458.6 ( 90.0) " " 0.059" ""  
#>              " 2273898.3 (  7.9) " " 1814107.4 ( 10.0) " ""       ""  
#> race (%)     "       0.0 (  0.0) " "       0.0 (  0.0) " "    NA" ""  
#>              "       0.0 (  0.0) " "       0.0 (  0.0) " ""       ""  
#>              "33012683.8 (100.0) " "       0.0 (  0.0) " ""       ""  
#>              "       0.0 (  0.0) " "20087814.0 (100.0) " ""       ""  
#> agecat (%)   " 8064159.5 ( 24.4) " " 4566126.4 ( 22.7) " "<0.001" ""  
#>              "10459873.4 ( 31.7) " " 7224766.9 ( 36.0) " ""       ""  
#>              " 9630300.4 ( 29.2) " " 5814433.3 ( 28.9) " ""       ""  
#>              " 4858350.5 ( 14.7) " " 2482487.5 ( 12.4) " ""       ""  
#> RIAGENDR (%) "15045455.5 ( 45.6) " " 9201462.9 ( 45.8) " " 0.042" ""  
#>              "17967228.3 ( 54.4) " "10886351.1 ( 54.2) " ""       ""  
#>              p(White vs Black) test(White vs Black) p(White vs Hispanic)
#> n            ""                ""                   ""                  
#> HI_CHOL (%)  " 0.031"          ""                   " 0.103"            
#>              ""                ""                   ""                  
#> race (%)     "<0.001"          ""                   "<0.001"            
#>              ""                ""                   ""                  
#>              ""                ""                   ""                  
#>              ""                ""                   ""                  
#> agecat (%)   "<0.001"          ""                   " 0.002"            
#>              ""                ""                   ""                  
#>              ""                ""                   ""                  
#>              ""                ""                   ""                  
#> RIAGENDR (%) " 0.016"          ""                   " 0.001"            
#>              ""                ""                   ""                  
#>              test(White vs Hispanic) p(White vs Asian) test(White vs Asian)
#> n            ""                      ""                ""                  
#> HI_CHOL (%)  ""                      " 0.947"          ""                  
#>              ""                      ""                ""                  
#> race (%)     ""                      "<0.001"          ""                  
#>              ""                      ""                ""                  
#>              ""                      ""                ""                  
#>              ""                      ""                ""                  
#> agecat (%)   ""                      " 0.079"          ""                  
#>              ""                      ""                ""                  
#>              ""                      ""                ""                  
#>              ""                      ""                ""                  
#> RIAGENDR (%) ""                      " 0.081"          ""                  
#>              ""                      ""                ""                  
#>              p(Black vs Hispanic) test(Black vs Hispanic) p(Black vs Asian)
#> n            ""                   ""                      ""               
#> HI_CHOL (%)  " 0.003"             ""                      " 0.429"         
#>              ""                   ""                      ""               
#> race (%)     "<0.001"             ""                      "<0.001"         
#>              ""                   ""                      ""               
#>              ""                   ""                      ""               
#>              ""                   ""                      ""               
#> agecat (%)   "<0.001"             ""                      "<0.001"         
#>              ""                   ""                      ""               
#>              ""                   ""                      ""               
#>              ""                   ""                      ""               
#> RIAGENDR (%) " 0.008"             ""                      " 0.262"         
#>              ""                   ""                      ""               
#>              test(Black vs Asian) p(Hispanic vs Asian) test(Hispanic vs Asian)
#> n            ""                   ""                   ""                     
#> HI_CHOL (%)  ""                   " 0.341"             ""                     
#>              ""                   ""                   ""                     
#> race (%)     ""                   "<0.001"             ""                     
#>              ""                   ""                   ""                     
#>              ""                   ""                   ""                     
#>              ""                   ""                   ""                     
#> agecat (%)   ""                   " 0.455"             ""                     
#>              ""                   ""                   ""                     
#>              ""                   ""                   ""                     
#>              ""                   ""                   ""                     
#> RIAGENDR (%) ""                   " 0.944"             ""                     
#>              ""                   ""                   ""                     
#>              sig 
#> n            NA  
#> HI_CHOL (%)  ""  
#>              NA  
#> race (%)     NA  
#>              NA  
#>              NA  
#>              NA  
#> agecat (%)   "**"
#>              NA  
#>              NA  
#>              NA  
#> RIAGENDR (%) "**"
#>              NA  
#> 
#> $caption
#> [1] "Stratified by race- weighted data"

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.