This takes a set of categorical variables and a continuous dependent variable and produces a table that shows the distribution of data across the levels of the categorical variables, as well as the mean of the dependent variable for each level and the significance of pairwise comparisons between these means.

report_cat_vars(
  data,
  dv,
  ...,
  var_names = NULL,
  level_names = NULL,
  p_adjust = p.adjust.methods,
  alpha_level = 0.05,
  filename = NULL,
  notes = list(),
  dv_name = NULL,
  bold_vars = TRUE,
  apa_style = TRUE,
  css_tags = list(),
  na.rm = TRUE,
  exclude_na = FALSE
)

Arguments

data

Dataframe containing the variables specified

dv

The continuous dependent variable to be presented alongside the levels of categorical variables. Set to NULL to just show the distribution of the categorical variables.

...

Categorical variables to be included

var_names

Tibble of old and new variable names, if variables are to be renamed for display. See get_rename_tribbles() for required format

level_names

Tibble of old and new level names, if levels are to be renamed for display. See get_rename_tribbles() for required format

p_adjust

One of p_adjust.methods, defaults to Holm

alpha_level

The level of significance for the pairwise comparisons (after p.adjust). Defaults to .05

filename

If provided, the table will be saved as an HTML file with this name.

notes

List of notes to append to bottom of table.

dv_name

Optional. A different name to use for the dependent variable in the automatic table footnote explaining the M(SD) column. Defaults to dv.

bold_vars

Should rows with variable names be bold. Defaults to TRUE

apa_style

Logical, should APA-style formatting be applied

css_tags

List of css tags to be added, each named with the class that the tag should be added to.

na.rm

Should missing values be dropped in the dv when summary statistics are calculated?

exclude_na

Should cases that are NA on a categorical variable be dropped from that section?

Value

A list including a tibble of descriptive statistics (descr), the gt-table (tab) and the HTML code (html_code) with css_tags added

Examples


report_cat_vars(iris, Sepal.Length, Species)
#> <!DOCTYPE html>
#> <html lang="en">
#> <head>
#> <meta charset="utf-8"/>
#> <style>body{background-color:white;}</style>
#> 
#> 
#> </head>
#> <body>
#> <div id="qsoukwhtsk" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
#>   <style>#qsoukwhtsk table {
#>   font-family: times, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
#>   -webkit-font-smoothing: antialiased;
#>   -moz-osx-font-smoothing: grayscale;
#> }
#> 
#> #qsoukwhtsk thead, #qsoukwhtsk tbody, #qsoukwhtsk tfoot, #qsoukwhtsk tr, #qsoukwhtsk td, #qsoukwhtsk th {
#>   border-style: none;
#> }
#> 
#> #qsoukwhtsk p {
#>   margin: 0;
#>   padding: 0;
#> }
#> 
#> #qsoukwhtsk .gt_table {
#>   display: table;
#>   border-collapse: collapse;
#>   line-height: normal;
#>   margin-left: auto;
#>   margin-right: auto;
#>   color: #333333;
#>   font-size: 12px;
#>   font-weight: normal;
#>   font-style: none;
#>   background-color: #FFFFFF;
#>   width: auto;
#>   border-top-style: none;
#>   border-top-width: 2px;
#>   border-top-color: #FFFFFF;
#>   border-right-style: none;
#>   border-right-width: 2px;
#>   border-right-color: #D3D3D3;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #A8A8A8;
#>   border-left-style: none;
#>   border-left-width: 2px;
#>   border-left-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_caption {
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#> }
#> 
#> #qsoukwhtsk .gt_title {
#>   color: #333333;
#>   font-size: 12px;
#>   font-weight: initial;
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   border-bottom-color: #FFFFFF;
#>   border-bottom-width: 0;
#> }
#> 
#> #qsoukwhtsk .gt_subtitle {
#>   color: #333333;
#>   font-size: 12px;
#>   font-weight: initial;
#>   padding-top: 3px;
#>   padding-bottom: 5px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   border-top-color: #FFFFFF;
#>   border-top-width: 0;
#> }
#> 
#> #qsoukwhtsk .gt_heading {
#>   background-color: #FFFFFF;
#>   text-align: center;
#>   border-bottom-color: #FFFFFF;
#>   border-left-style: none;
#>   border-left-width: 1px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 1px;
#>   border-right-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_bottom_border {
#>   border-bottom-style: solid;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #000000;
#> }
#> 
#> #qsoukwhtsk .gt_col_headings {
#>   border-top-style: none;
#>   border-top-width: 2px;
#>   border-top-color: #D3D3D3;
#>   border-bottom-style: solid;
#>   border-bottom-width: 1px;
#>   border-bottom-color: #000000;
#>   border-left-style: none;
#>   border-left-width: 1px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 1px;
#>   border-right-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_col_heading {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: normal;
#>   text-transform: inherit;
#>   border-left-style: none;
#>   border-left-width: 1px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 1px;
#>   border-right-color: #D3D3D3;
#>   vertical-align: bottom;
#>   padding-top: 5px;
#>   padding-bottom: 6px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   overflow-x: hidden;
#> }
#> 
#> #qsoukwhtsk .gt_column_spanner_outer {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: normal;
#>   text-transform: inherit;
#>   padding-top: 0;
#>   padding-bottom: 0;
#>   padding-left: 4px;
#>   padding-right: 4px;
#> }
#> 
#> #qsoukwhtsk .gt_column_spanner_outer:first-child {
#>   padding-left: 0;
#> }
#> 
#> #qsoukwhtsk .gt_column_spanner_outer:last-child {
#>   padding-right: 0;
#> }
#> 
#> #qsoukwhtsk .gt_column_spanner {
#>   border-bottom-style: solid;
#>   border-bottom-width: 1px;
#>   border-bottom-color: #000000;
#>   vertical-align: bottom;
#>   padding-top: 5px;
#>   padding-bottom: 5px;
#>   overflow-x: hidden;
#>   display: inline-block;
#>   width: 100%;
#> }
#> 
#> #qsoukwhtsk .gt_spanner_row {
#>   border-bottom-style: hidden;
#> }
#> 
#> #qsoukwhtsk .gt_group_heading {
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: initial;
#>   text-transform: inherit;
#>   border-top-style: none;
#>   border-top-width: 2px;
#>   border-top-color: #D3D3D3;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #D3D3D3;
#>   border-left-style: none;
#>   border-left-width: 1px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 1px;
#>   border-right-color: #D3D3D3;
#>   vertical-align: middle;
#>   text-align: left;
#> }
#> 
#> #qsoukwhtsk .gt_empty_group_heading {
#>   padding: 0.5px;
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: initial;
#>   border-top-style: none;
#>   border-top-width: 2px;
#>   border-top-color: #D3D3D3;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #D3D3D3;
#>   vertical-align: middle;
#> }
#> 
#> #qsoukwhtsk .gt_from_md > :first-child {
#>   margin-top: 0;
#> }
#> 
#> #qsoukwhtsk .gt_from_md > :last-child {
#>   margin-bottom: 0;
#> }
#> 
#> #qsoukwhtsk .gt_row {
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   margin: 10px;
#>   border-top-style: none;
#>   border-top-width: 1px;
#>   border-top-color: #FFFFFF;
#>   border-left-style: none;
#>   border-left-width: 1px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 1px;
#>   border-right-color: #D3D3D3;
#>   vertical-align: middle;
#>   overflow-x: hidden;
#> }
#> 
#> #qsoukwhtsk .gt_stub {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: initial;
#>   text-transform: inherit;
#>   border-right-style: none;
#>   border-right-width: 2px;
#>   border-right-color: #D3D3D3;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_stub_row_group {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   font-size: 100%;
#>   font-weight: initial;
#>   text-transform: inherit;
#>   border-right-style: none;
#>   border-right-width: 2px;
#>   border-right-color: #D3D3D3;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   vertical-align: top;
#> }
#> 
#> #qsoukwhtsk .gt_row_group_first td {
#>   border-top-width: 2px;
#> }
#> 
#> #qsoukwhtsk .gt_row_group_first th {
#>   border-top-width: 2px;
#> }
#> 
#> #qsoukwhtsk .gt_summary_row {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   text-transform: inherit;
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_first_summary_row {
#>   border-top-style: none;
#>   border-top-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_first_summary_row.thick {
#>   border-top-width: 2px;
#> }
#> 
#> #qsoukwhtsk .gt_last_summary_row {
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_grand_summary_row {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   text-transform: inherit;
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_first_grand_summary_row {
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   border-top-style: none;
#>   border-top-width: 6px;
#>   border-top-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_last_grand_summary_row_top {
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#>   border-bottom-style: none;
#>   border-bottom-width: 6px;
#>   border-bottom-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_striped {
#>   background-color: rgba(128, 128, 128, 0.05);
#> }
#> 
#> #qsoukwhtsk .gt_table_body {
#>   border-top-style: solid;
#>   border-top-width: 1px;
#>   border-top-color: #000000;
#>   border-bottom-style: solid;
#>   border-bottom-width: 1px;
#>   border-bottom-color: #000000;
#> }
#> 
#> #qsoukwhtsk .gt_footnotes {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #D3D3D3;
#>   border-left-style: none;
#>   border-left-width: 2px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 2px;
#>   border-right-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_footnote {
#>   margin: 0px;
#>   font-size: 90%;
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_sourcenotes {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   border-bottom-style: none;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #D3D3D3;
#>   border-left-style: none;
#>   border-left-width: 2px;
#>   border-left-color: #D3D3D3;
#>   border-right-style: none;
#>   border-right-width: 2px;
#>   border-right-color: #D3D3D3;
#> }
#> 
#> #qsoukwhtsk .gt_sourcenote {
#>   font-size: 90%;
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_left {
#>   text-align: left;
#> }
#> 
#> #qsoukwhtsk .gt_center {
#>   text-align: center;
#> }
#> 
#> #qsoukwhtsk .gt_right {
#>   text-align: right;
#>   font-variant-numeric: tabular-nums;
#> }
#> 
#> #qsoukwhtsk .gt_font_normal {
#>   font-weight: normal;
#> }
#> 
#> #qsoukwhtsk .gt_font_bold {
#>   font-weight: bold;
#> }
#> 
#> #qsoukwhtsk .gt_font_italic {
#>   font-style: italic;
#> }
#> 
#> #qsoukwhtsk .gt_super {
#>   font-size: 65%;
#> }
#> 
#> #qsoukwhtsk .gt_footnote_marks {
#>   font-size: 75%;
#>   vertical-align: 0.4em;
#>   position: initial;
#> }
#> 
#> #qsoukwhtsk .gt_asterisk {
#>   font-size: 100%;
#>   vertical-align: 0;
#> }
#> 
#> #qsoukwhtsk .gt_indent_1 {
#>   text-indent: 5px;
#> }
#> 
#> #qsoukwhtsk .gt_indent_2 {
#>   text-indent: 10px;
#> }
#> 
#> #qsoukwhtsk .gt_indent_3 {
#>   text-indent: 15px;
#> }
#> 
#> #qsoukwhtsk .gt_indent_4 {
#>   text-indent: 20px;
#> }
#> 
#> #qsoukwhtsk .gt_indent_5 {
#>   text-indent: 25px;
#> }
#> 
#> #qsoukwhtsk .katex-display {
#>   display: inline-flex !important;
#>   margin-bottom: 0.75em !important;
#> }
#> 
#> #qsoukwhtsk div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
#>   height: 0px !important;
#> }
#> </style>
#>   <table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
#>   <thead>
#>     <tr class="gt_col_headings">
#>       <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id=""></th>
#>       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;N&lt;/span&gt;"><span class='gt_from_md'>N</span></th>
#>       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;Share&lt;/span&gt;"><span class='gt_from_md'>Share</span></th>
#>       <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;&lt;em&gt;M (SD)&lt;/em&gt;&lt;/span&gt;"><span class='gt_from_md'><em>M (SD)</em></span></th>
#>     </tr>
#>   </thead>
#>   <tbody class="gt_table_body">
#>     <tr class="gt_group_heading_row">
#>       <th colspan="4" class="gt_group_heading" style="font-weight: bold; background-color: #E0E0E0;" scope="colgroup" id="Species">Species</th>
#>     </tr>
#>     <tr class="gt_row_group_first"><th id="stub_1_1" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>setosa</span></th>
#> <td headers="Species stub_1_1 N" class="gt_row gt_right"><span class='gt_from_md'>50</span></td>
#> <td headers="Species stub_1_1 Share" class="gt_row gt_right">33.3%</td>
#> <td headers="Species stub_1_1 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>5.01 (0.35) <sup>a</sup></span></td></tr>
#>     <tr><th id="stub_1_2" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>versicolor</span></th>
#> <td headers="Species stub_1_2 N" class="gt_row gt_right"><span class='gt_from_md'>50</span></td>
#> <td headers="Species stub_1_2 Share" class="gt_row gt_right">33.3%</td>
#> <td headers="Species stub_1_2 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>5.94 (0.52) <sup>b</sup></span></td></tr>
#>     <tr><th id="stub_1_3" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>virginica</span></th>
#> <td headers="Species stub_1_3 N" class="gt_row gt_right"><span class='gt_from_md'>50</span></td>
#> <td headers="Species stub_1_3 Share" class="gt_row gt_right">33.3%</td>
#> <td headers="Species stub_1_3 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>6.59 (0.64) <sup>c</sup></span></td></tr>
#>   </tbody>
#>   <tfoot class="gt_sourcenotes">
#>     <tr>
#>       <td class="gt_sourcenote" colspan="4"><span class='gt_from_md'><em>M</em> and <em>SD</em> are used to represent mean and standard deviation for Sepal.Length for that group, respectively.<br></span></td>
#>     </tr>
#>     <tr>
#>       <td class="gt_sourcenote" colspan="4"><span class='gt_from_md'>Within each variable, the means of groups with different superscripts differ with <em>p</em> &lt; .05 <br> (<em>p</em>-values were adjusted using the Holm-method.)</span></td>
#>     </tr>
#>   </tfoot>
#>   
#> </table>
#> </div>
#> </body>
#> </html>
#> 



N Share M (SD)
Species
setosa 50 33.3% 5.01 (0.35) a
versicolor 50 33.3% 5.94 (0.52) b
virginica 50 33.3% 6.59 (0.64) c
M and SD are used to represent mean and standard deviation for Sepal.Length for that group, respectively.
Within each variable, the means of groups with different superscripts differ with p < .05
(p-values were adjusted using the Holm-method.)
# You can rename variables and levels reasonably easily # Use get_rename_tribbles() to get the basis of these tibbles var_renames <- tibble::tribble( ~old, ~new, "gndr", "Gender", "cntry", "Country" ) level_renames <- tibble::tribble( ~var, ~level_old, ~level_new, "gndr", "1", "male", "gndr", "2", "female", "cntry", "DE", "Germany", "cntry", "FR", "France", "cntry", "GB", "UK" ) report_cat_vars(ess_health, health, gndr, cntry, var_names = var_renames, level_names = level_renames) #> <!DOCTYPE html> #> <html lang="en"> #> <head> #> <meta charset="utf-8"/> #> <style>body{background-color:white;}</style> #> #> #> </head> #> <body> #> <div id="pwavemcbyz" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;"> #> <style>#pwavemcbyz table { #> font-family: times, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; #> -webkit-font-smoothing: antialiased; #> -moz-osx-font-smoothing: grayscale; #> } #> #> #pwavemcbyz thead, #pwavemcbyz tbody, #pwavemcbyz tfoot, #pwavemcbyz tr, #pwavemcbyz td, #pwavemcbyz th { #> border-style: none; #> } #> #> #pwavemcbyz p { #> margin: 0; #> padding: 0; #> } #> #> #pwavemcbyz .gt_table { #> display: table; #> border-collapse: collapse; #> line-height: normal; #> margin-left: auto; #> margin-right: auto; #> color: #333333; #> font-size: 12px; #> font-weight: normal; #> font-style: none; #> background-color: #FFFFFF; #> width: auto; #> border-top-style: none; #> border-top-width: 2px; #> border-top-color: #FFFFFF; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #A8A8A8; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_caption { #> padding-top: 4px; #> padding-bottom: 4px; #> } #> #> #pwavemcbyz .gt_title { #> color: #333333; #> font-size: 12px; #> font-weight: initial; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-color: #FFFFFF; #> border-bottom-width: 0; #> } #> #> #pwavemcbyz .gt_subtitle { #> color: #333333; #> font-size: 12px; #> font-weight: initial; #> padding-top: 3px; #> padding-bottom: 5px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-color: #FFFFFF; #> border-top-width: 0; #> } #> #> #pwavemcbyz .gt_heading { #> background-color: #FFFFFF; #> text-align: center; #> border-bottom-color: #FFFFFF; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #000000; #> } #> #> #pwavemcbyz .gt_col_headings { #> border-top-style: none; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: solid; #> border-bottom-width: 1px; #> border-bottom-color: #000000; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_col_heading { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: normal; #> text-transform: inherit; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: bottom; #> padding-top: 5px; #> padding-bottom: 6px; #> padding-left: 5px; #> padding-right: 5px; #> overflow-x: hidden; #> } #> #> #pwavemcbyz .gt_column_spanner_outer { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: normal; #> text-transform: inherit; #> padding-top: 0; #> padding-bottom: 0; #> padding-left: 4px; #> padding-right: 4px; #> } #> #> #pwavemcbyz .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> #> #pwavemcbyz .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> #> #pwavemcbyz .gt_column_spanner { #> border-bottom-style: solid; #> border-bottom-width: 1px; #> border-bottom-color: #000000; #> vertical-align: bottom; #> padding-top: 5px; #> padding-bottom: 5px; #> overflow-x: hidden; #> display: inline-block; #> width: 100%; #> } #> #> #pwavemcbyz .gt_spanner_row { #> border-bottom-style: hidden; #> } #> #> #pwavemcbyz .gt_group_heading { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-top-style: none; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: middle; #> text-align: left; #> } #> #> #pwavemcbyz .gt_empty_group_heading { #> padding: 0.5px; #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> border-top-style: none; #> border-top-width: 2px; #> border-top-color: #D3D3D3; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> vertical-align: middle; #> } #> #> #pwavemcbyz .gt_from_md > :first-child { #> margin-top: 0; #> } #> #> #pwavemcbyz .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> #> #pwavemcbyz .gt_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> margin: 10px; #> border-top-style: none; #> border-top-width: 1px; #> border-top-color: #FFFFFF; #> border-left-style: none; #> border-left-width: 1px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 1px; #> border-right-color: #D3D3D3; #> vertical-align: middle; #> overflow-x: hidden; #> } #> #> #pwavemcbyz .gt_stub { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #pwavemcbyz .gt_stub_row_group { #> color: #333333; #> background-color: #FFFFFF; #> font-size: 100%; #> font-weight: initial; #> text-transform: inherit; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> padding-left: 5px; #> padding-right: 5px; #> vertical-align: top; #> } #> #> #pwavemcbyz .gt_row_group_first td { #> border-top-width: 2px; #> } #> #> #pwavemcbyz .gt_row_group_first th { #> border-top-width: 2px; #> } #> #> #pwavemcbyz .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #pwavemcbyz .gt_first_summary_row { #> border-top-style: none; #> border-top-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_first_summary_row.thick { #> border-top-width: 2px; #> } #> #> #pwavemcbyz .gt_last_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #pwavemcbyz .gt_first_grand_summary_row { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-top-style: none; #> border-top-width: 6px; #> border-top-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_last_grand_summary_row_top { #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> border-bottom-style: none; #> border-bottom-width: 6px; #> border-bottom-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> #> #pwavemcbyz .gt_table_body { #> border-top-style: solid; #> border-top-width: 1px; #> border-top-color: #000000; #> border-bottom-style: solid; #> border-bottom-width: 1px; #> border-bottom-color: #000000; #> } #> #> #pwavemcbyz .gt_footnotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #pwavemcbyz .gt_sourcenotes { #> color: #333333; #> background-color: #FFFFFF; #> border-bottom-style: none; #> border-bottom-width: 2px; #> border-bottom-color: #D3D3D3; #> border-left-style: none; #> border-left-width: 2px; #> border-left-color: #D3D3D3; #> border-right-style: none; #> border-right-width: 2px; #> border-right-color: #D3D3D3; #> } #> #> #pwavemcbyz .gt_sourcenote { #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #pwavemcbyz .gt_left { #> text-align: left; #> } #> #> #pwavemcbyz .gt_center { #> text-align: center; #> } #> #> #pwavemcbyz .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> #> #pwavemcbyz .gt_font_normal { #> font-weight: normal; #> } #> #> #pwavemcbyz .gt_font_bold { #> font-weight: bold; #> } #> #> #pwavemcbyz .gt_font_italic { #> font-style: italic; #> } #> #> #pwavemcbyz .gt_super { #> font-size: 65%; #> } #> #> #pwavemcbyz .gt_footnote_marks { #> font-size: 75%; #> vertical-align: 0.4em; #> position: initial; #> } #> #> #pwavemcbyz .gt_asterisk { #> font-size: 100%; #> vertical-align: 0; #> } #> #> #pwavemcbyz .gt_indent_1 { #> text-indent: 5px; #> } #> #> #pwavemcbyz .gt_indent_2 { #> text-indent: 10px; #> } #> #> #pwavemcbyz .gt_indent_3 { #> text-indent: 15px; #> } #> #> #pwavemcbyz .gt_indent_4 { #> text-indent: 20px; #> } #> #> #pwavemcbyz .gt_indent_5 { #> text-indent: 25px; #> } #> #> #pwavemcbyz .katex-display { #> display: inline-flex !important; #> margin-bottom: 0.75em !important; #> } #> #> #pwavemcbyz div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after { #> height: 0px !important; #> } #> </style> #> <table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false"> #> <thead> #> <tr class="gt_col_headings"> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id=""></th> #> <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;N&lt;/span&gt;"><span class='gt_from_md'>N</span></th> #> <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;Share&lt;/span&gt;"><span class='gt_from_md'>Share</span></th> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="&lt;span class='gt_from_md'&gt;&lt;em&gt;M (SD)&lt;/em&gt;&lt;/span&gt;"><span class='gt_from_md'><em>M (SD)</em></span></th> #> </tr> #> </thead> #> <tbody class="gt_table_body"> #> <tr class="gt_group_heading_row"> #> <th colspan="4" class="gt_group_heading" style="font-weight: bold; background-color: #E0E0E0;" scope="colgroup" id="Gender">Gender</th> #> </tr> #> <tr class="gt_row_group_first"><th id="stub_1_1" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>male</span></th> #> <td headers="Gender stub_1_1 N" class="gt_row gt_right"><span class='gt_from_md'>3482</span></td> #> <td headers="Gender stub_1_1 Share" class="gt_row gt_right">48.2%</td> #> <td headers="Gender stub_1_1 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>2.23 (0.90) <sup>a</sup></span></td></tr> #> <tr><th id="stub_1_2" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>female</span></th> #> <td headers="Gender stub_1_2 N" class="gt_row gt_right"><span class='gt_from_md'>3744</span></td> #> <td headers="Gender stub_1_2 Share" class="gt_row gt_right">51.8%</td> #> <td headers="Gender stub_1_2 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>2.30 (0.93) <sup>b</sup></span></td></tr> #> <tr class="gt_group_heading_row"> #> <th colspan="4" class="gt_group_heading" style="font-weight: bold; background-color: #E0E0E0;" scope="colgroup" id="Country">Country</th> #> </tr> #> <tr class="gt_row_group_first"><th id="stub_1_3" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>Germany</span></th> #> <td headers="Country stub_1_3 N" class="gt_row gt_right"><span class='gt_from_md'>3045</span></td> #> <td headers="Country stub_1_3 Share" class="gt_row gt_right">42.1%</td> #> <td headers="Country stub_1_3 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>2.34 (0.88) <sup>a</sup></span></td></tr> #> <tr><th id="stub_1_4" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>France</span></th> #> <td headers="Country stub_1_4 N" class="gt_row gt_right"><span class='gt_from_md'>1917</span></td> #> <td headers="Country stub_1_4 Share" class="gt_row gt_right">26.5%</td> #> <td headers="Country stub_1_4 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>2.29 (0.89) <sup>a</sup></span></td></tr> #> <tr><th id="stub_1_5" scope="row" class="gt_row gt_left gt_stub"><span class='gt_from_md'>UK</span></th> #> <td headers="Country stub_1_5 N" class="gt_row gt_right"><span class='gt_from_md'>2264</span></td> #> <td headers="Country stub_1_5 Share" class="gt_row gt_right">31.3%</td> #> <td headers="Country stub_1_5 *M (SD)*" class="gt_row gt_left"><span class='gt_from_md'>2.14 (0.97) <sup>b</sup></span></td></tr> #> </tbody> #> <tfoot class="gt_sourcenotes"> #> <tr> #> <td class="gt_sourcenote" colspan="4"><span class='gt_from_md'><em>M</em> and <em>SD</em> are used to represent mean and standard deviation for health for that group, respectively.<br></span></td> #> </tr> #> <tr> #> <td class="gt_sourcenote" colspan="4"><span class='gt_from_md'>Within each variable, the means of groups with different superscripts differ with <em>p</em> &lt; .05 <br> (<em>p</em>-values were adjusted using the Holm-method.)</span></td> #> </tr> #> </tfoot> #> #> </table> #> </div> #> </body> #> </html> #>
N Share M (SD)
Gender
male 3482 48.2% 2.23 (0.90) a
female 3744 51.8% 2.30 (0.93) b
Country
Germany 3045 42.1% 2.34 (0.88) a
France 1917 26.5% 2.29 (0.89) a
UK 2264 31.3% 2.14 (0.97) b
M and SD are used to represent mean and standard deviation for health for that group, respectively.
Within each variable, the means of groups with different superscripts differ with p < .05
(p-values were adjusted using the Holm-method.)