print_diff_bygroup: Print regression results in table

View source: R/print_diff_bygroup.R

print_diff_bygroupR Documentation

Print regression results in table

Description

New function ready for revision / rewrite

Usage

print_diff_bygroup(meas, var, group, adj, data, dec = 2)

Arguments

meas

outcome measure variable name in data-data.frame as a string. Can be numeric or factor. Result is calculated accordingly.

var

binary exposure variable to compare against (active vs placebo). As string. Horisontal.

group

binary stratum to compare, as string. Vertical.

adj

variables to adjust for, as string.

data

dataframe to subset from.

dec

decimals for results, standard is set to 2. Mean and sd is dec-1. pval has 3 decimals.

Details

Printable table of two dimensional regression analysis of group vs variable for outcome measure. By group. Includes p-value Group and variable has to be dichotomous factor.

Examples

  data('mtcars')
  mtcars$vs<-factor(mtcars$vs)
  mtcars$am<-factor(mtcars$am)
  print_diff_bygroup(meas="mpg",var="vs",group = "am",adj=c("disp","wt"),data=mtcars)

agdamsbo/daDoctoR documentation built on Aug. 30, 2022, 4:29 p.m.