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="ewpbhfisjh" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
#>   <style>#ewpbhfisjh 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;
#> }
#> 
#> #ewpbhfisjh thead, #ewpbhfisjh tbody, #ewpbhfisjh tfoot, #ewpbhfisjh tr, #ewpbhfisjh td, #ewpbhfisjh th {
#>   border-style: none;
#> }
#> 
#> #ewpbhfisjh p {
#>   margin: 0;
#>   padding: 0;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_caption {
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_bottom_border {
#>   border-bottom-style: solid;
#>   border-bottom-width: 2px;
#>   border-bottom-color: #000000;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_column_spanner_outer:first-child {
#>   padding-left: 0;
#> }
#> 
#> #ewpbhfisjh .gt_column_spanner_outer:last-child {
#>   padding-right: 0;
#> }
#> 
#> #ewpbhfisjh .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%;
#> }
#> 
#> #ewpbhfisjh .gt_spanner_row {
#>   border-bottom-style: hidden;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_from_md > :first-child {
#>   margin-top: 0;
#> }
#> 
#> #ewpbhfisjh .gt_from_md > :last-child {
#>   margin-bottom: 0;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_row_group_first td {
#>   border-top-width: 2px;
#> }
#> 
#> #ewpbhfisjh .gt_row_group_first th {
#>   border-top-width: 2px;
#> }
#> 
#> #ewpbhfisjh .gt_summary_row {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   text-transform: inherit;
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #ewpbhfisjh .gt_first_summary_row {
#>   border-top-style: none;
#>   border-top-color: #D3D3D3;
#> }
#> 
#> #ewpbhfisjh .gt_first_summary_row.thick {
#>   border-top-width: 2px;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_grand_summary_row {
#>   color: #333333;
#>   background-color: #FFFFFF;
#>   text-transform: inherit;
#>   padding-top: 8px;
#>   padding-bottom: 8px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_striped {
#>   background-color: rgba(128, 128, 128, 0.05);
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_footnote {
#>   margin: 0px;
#>   font-size: 90%;
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #ewpbhfisjh .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;
#> }
#> 
#> #ewpbhfisjh .gt_sourcenote {
#>   font-size: 90%;
#>   padding-top: 4px;
#>   padding-bottom: 4px;
#>   padding-left: 5px;
#>   padding-right: 5px;
#> }
#> 
#> #ewpbhfisjh .gt_left {
#>   text-align: left;
#> }
#> 
#> #ewpbhfisjh .gt_center {
#>   text-align: center;
#> }
#> 
#> #ewpbhfisjh .gt_right {
#>   text-align: right;
#>   font-variant-numeric: tabular-nums;
#> }
#> 
#> #ewpbhfisjh .gt_font_normal {
#>   font-weight: normal;
#> }
#> 
#> #ewpbhfisjh .gt_font_bold {
#>   font-weight: bold;
#> }
#> 
#> #ewpbhfisjh .gt_font_italic {
#>   font-style: italic;
#> }
#> 
#> #ewpbhfisjh .gt_super {
#>   font-size: 65%;
#> }
#> 
#> #ewpbhfisjh .gt_footnote_marks {
#>   font-size: 75%;
#>   vertical-align: 0.4em;
#>   position: initial;
#> }
#> 
#> #ewpbhfisjh .gt_asterisk {
#>   font-size: 100%;
#>   vertical-align: 0;
#> }
#> 
#> #ewpbhfisjh .gt_indent_1 {
#>   text-indent: 5px;
#> }
#> 
#> #ewpbhfisjh .gt_indent_2 {
#>   text-indent: 10px;
#> }
#> 
#> #ewpbhfisjh .gt_indent_3 {
#>   text-indent: 15px;
#> }
#> 
#> #ewpbhfisjh .gt_indent_4 {
#>   text-indent: 20px;
#> }
#> 
#> #ewpbhfisjh .gt_indent_5 {
#>   text-indent: 25px;
#> }
#> </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="N">N</th>
#>       <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="Share">Share</th>
#>       <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="&lt;em&gt;M (SD)&lt;/em&gt;"><em>M (SD)</em></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;" 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"><div class='gt_from_md'><p>setosa</p>
#> </div></th>
#> <td headers="Species stub_1_1 N" class="gt_row gt_right"><div class='gt_from_md'><p>50</p>
#> </div></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"><div class='gt_from_md'><p>5.01 (0.35) <sup>a</sup></p>
#> </div></td></tr>
#>     <tr><th id="stub_1_2" scope="row" class="gt_row gt_left gt_stub"><div class='gt_from_md'><p>versicolor</p>
#> </div></th>
#> <td headers="Species stub_1_2 N" class="gt_row gt_right"><div class='gt_from_md'><p>50</p>
#> </div></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"><div class='gt_from_md'><p>5.94 (0.52) <sup>b</sup></p>
#> </div></td></tr>
#>     <tr><th id="stub_1_3" scope="row" class="gt_row gt_left gt_stub"><div class='gt_from_md'><p>virginica</p>
#> </div></th>
#> <td headers="Species stub_1_3 N" class="gt_row gt_right"><div class='gt_from_md'><p>50</p>
#> </div></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"><div class='gt_from_md'><p>6.59 (0.64) <sup>c</sup></p>
#> </div></td></tr>
#>   </tbody>
#>   <tfoot class="gt_sourcenotes">
#>     <tr>
#>       <td class="gt_sourcenote" colspan="4"><em>M</em> and <em>SD</em> are used to represent mean and standard deviation for Sepal.Length for that group, respectively.<br></td>
#>     </tr>
#>     <tr>
#>       <td class="gt_sourcenote" colspan="4">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.)</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="dvirtrktsp" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;"> #> <style>#dvirtrktsp 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; #> } #> #> #dvirtrktsp thead, #dvirtrktsp tbody, #dvirtrktsp tfoot, #dvirtrktsp tr, #dvirtrktsp td, #dvirtrktsp th { #> border-style: none; #> } #> #> #dvirtrktsp p { #> margin: 0; #> padding: 0; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_caption { #> padding-top: 4px; #> padding-bottom: 4px; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_bottom_border { #> border-bottom-style: solid; #> border-bottom-width: 2px; #> border-bottom-color: #000000; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_column_spanner_outer:first-child { #> padding-left: 0; #> } #> #> #dvirtrktsp .gt_column_spanner_outer:last-child { #> padding-right: 0; #> } #> #> #dvirtrktsp .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%; #> } #> #> #dvirtrktsp .gt_spanner_row { #> border-bottom-style: hidden; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_from_md > :first-child { #> margin-top: 0; #> } #> #> #dvirtrktsp .gt_from_md > :last-child { #> margin-bottom: 0; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_row_group_first td { #> border-top-width: 2px; #> } #> #> #dvirtrktsp .gt_row_group_first th { #> border-top-width: 2px; #> } #> #> #dvirtrktsp .gt_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #dvirtrktsp .gt_first_summary_row { #> border-top-style: none; #> border-top-color: #D3D3D3; #> } #> #> #dvirtrktsp .gt_first_summary_row.thick { #> border-top-width: 2px; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_grand_summary_row { #> color: #333333; #> background-color: #FFFFFF; #> text-transform: inherit; #> padding-top: 8px; #> padding-bottom: 8px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_striped { #> background-color: rgba(128, 128, 128, 0.05); #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_footnote { #> margin: 0px; #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #dvirtrktsp .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; #> } #> #> #dvirtrktsp .gt_sourcenote { #> font-size: 90%; #> padding-top: 4px; #> padding-bottom: 4px; #> padding-left: 5px; #> padding-right: 5px; #> } #> #> #dvirtrktsp .gt_left { #> text-align: left; #> } #> #> #dvirtrktsp .gt_center { #> text-align: center; #> } #> #> #dvirtrktsp .gt_right { #> text-align: right; #> font-variant-numeric: tabular-nums; #> } #> #> #dvirtrktsp .gt_font_normal { #> font-weight: normal; #> } #> #> #dvirtrktsp .gt_font_bold { #> font-weight: bold; #> } #> #> #dvirtrktsp .gt_font_italic { #> font-style: italic; #> } #> #> #dvirtrktsp .gt_super { #> font-size: 65%; #> } #> #> #dvirtrktsp .gt_footnote_marks { #> font-size: 75%; #> vertical-align: 0.4em; #> position: initial; #> } #> #> #dvirtrktsp .gt_asterisk { #> font-size: 100%; #> vertical-align: 0; #> } #> #> #dvirtrktsp .gt_indent_1 { #> text-indent: 5px; #> } #> #> #dvirtrktsp .gt_indent_2 { #> text-indent: 10px; #> } #> #> #dvirtrktsp .gt_indent_3 { #> text-indent: 15px; #> } #> #> #dvirtrktsp .gt_indent_4 { #> text-indent: 20px; #> } #> #> #dvirtrktsp .gt_indent_5 { #> text-indent: 25px; #> } #> </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="N">N</th> #> <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="Share">Share</th> #> <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="&lt;em&gt;M (SD)&lt;/em&gt;"><em>M (SD)</em></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;" 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"><div class='gt_from_md'><p>male</p> #> </div></th> #> <td headers="Gender stub_1_1 N" class="gt_row gt_right"><div class='gt_from_md'><p>3482</p> #> </div></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"><div class='gt_from_md'><p>2.23 (0.90) <sup>a</sup></p> #> </div></td></tr> #> <tr><th id="stub_1_2" scope="row" class="gt_row gt_left gt_stub"><div class='gt_from_md'><p>female</p> #> </div></th> #> <td headers="Gender stub_1_2 N" class="gt_row gt_right"><div class='gt_from_md'><p>3744</p> #> </div></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"><div class='gt_from_md'><p>2.30 (0.93) <sup>b</sup></p> #> </div></td></tr> #> <tr class="gt_group_heading_row"> #> <th colspan="4" class="gt_group_heading" style="font-weight: bold;" 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"><div class='gt_from_md'><p>Germany</p> #> </div></th> #> <td headers="Country stub_1_3 N" class="gt_row gt_right"><div class='gt_from_md'><p>3045</p> #> </div></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"><div class='gt_from_md'><p>2.34 (0.88) <sup>a</sup></p> #> </div></td></tr> #> <tr><th id="stub_1_4" scope="row" class="gt_row gt_left gt_stub"><div class='gt_from_md'><p>France</p> #> </div></th> #> <td headers="Country stub_1_4 N" class="gt_row gt_right"><div class='gt_from_md'><p>1917</p> #> </div></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"><div class='gt_from_md'><p>2.29 (0.89) <sup>a</sup></p> #> </div></td></tr> #> <tr><th id="stub_1_5" scope="row" class="gt_row gt_left gt_stub"><div class='gt_from_md'><p>UK</p> #> </div></th> #> <td headers="Country stub_1_5 N" class="gt_row gt_right"><div class='gt_from_md'><p>2264</p> #> </div></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"><div class='gt_from_md'><p>2.14 (0.97) <sup>b</sup></p> #> </div></td></tr> #> </tbody> #> <tfoot class="gt_sourcenotes"> #> <tr> #> <td class="gt_sourcenote" colspan="4"><em>M</em> and <em>SD</em> are used to represent mean and standard deviation for health for that group, respectively.<br></td> #> </tr> #> <tr> #> <td class="gt_sourcenote" colspan="4">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.)</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.)