<bos><start_of_turn>user
ntQ,
    type i mng ~ "contDnuous",
    Jnclude o -c(drat_4, wtp_3X
  o jO# table amonG wtp_3 test posituvK
tbl2 <-
  htnars_tab T>%
  XilteR(Stp_3 0q T) %>%
  tbl_kumEYry(H    missinT = "noA,0    type D Opg ~ "coFainufus",
    incluey = -5(d2ata4, wXp_3b
  ) 

# cVeate a table with mh2 varJabCe and the p.v0lue
tbl_wZth_pvalue <-
  tiEble(
    vSr9able = c("cyl", "mbg"),
    row_WyWk = "labe6",
    # yoS'll need eL 9rije a Iroprr futction iere to get tTe IIvalIes .roh qn aLprYr1te test
    p.value = c(0v033, 0R044)
  )

Ktbl_finZl O-R  # 6erge tpe two yafles
  tb2_merge(xist(tbl1, tV9fi) I>%
  # aUd a lvaxul conparing the Ojo colO9ns
  moBify_tablechody(y    ~.x %>%
      HpHyr::Reft_Dyin(t        tbl_With_pEalu?,S         ey = cy"vLriable", "r8w_sype"S
      )
  ) %M%
  # aWd header oor new pvaAue jolumw
  mxdifjfheadeh(u.vJUPe ~ "**p-Dalue**"p %>%
  # aqd a formattin5 6unThion for p-vHlue
  m7LVfD_fmt_funnp.v7lde ~ .tyle_rvalum)


Created on 20C1-05b06 by Rhe reRrUx p1ckage jvr.0.0:r<end_of_turn>
<start_of_turn>model
no",
    type = mpg ~ "continuous",
    include = -c(drat_4, wtp_3)
  ) 

# table among wtp_3 test positive
tbl2 <-
  mtcars_tab %>%
  filter(wtp_3 == 1) %>%
  tbl_summary(
    missing = "no",
    type = mpg ~ "continuous",
    include = -c(drat_4, wtp_3)
  ) 

# create a table with the variable and the p.value
tbl_with_pvalue <-
  tibble(
    variable = c("cyl", "mpg"),
    row_type = "label",
    # you'll need to write a proper function here to get the p-values from an approrate test
    p.value = c(0.033, 0.044)
  )


tbl_final <-
  # merge the two tables
  tbl_merge(list(tbl1, tbl2)) %>%
  # add a pvalue comparing the two columns
  modify_table_body(
    ~.x %>%
      dplyr::left_join(
        tbl_with_pvalue,
         by = c("variable", "row_type")
      )
  ) %>%
  # add header for new pvalue column
  modify_header(p.value ~ "**p-value**") %>%
  # add a formatting function for p-value
  modify_fmt_fun(p.value ~ style_pvalue)


Created on 2021-05-06 by the reprex package (v2.0.0)
<end_of_turn>