tableone 使用事项(持续更行)

print.TableOne: Format and print TableOne class objects

参考print.TableOne function -tableone 使用

# S3 method for TableOne
print(
  x,
  catDigits = 1,
  contDigits = 2,
  pDigits = 3,
  quote = FALSE,
  missing = FALSE,
  explain = TRUE,
  printToggle = TRUE,
  test = TRUE,
  smd = FALSE,
  noSpaces = FALSE,
  padColnames = FALSE,
  varLabels = FALSE,
  format = c("fp", "f", "p", "pf")[1],
  showAllLevels = FALSE,
  cramVars = NULL,
  dropEqual = FALSE,
  exact = NULL,
  nonnormal = NULL,
  minMax = FALSE,
  formatOptions = list(scientific = FALSE),
  ...
)

Arguments

x

Object returned by CreateTableOne function.

catDigits

Number of digits to print for proportions. Default 1.

contDigits

Number of digits to print for continuous variables. Default 2.

pDigits

Number of digits to print for p-values (also used for standardized mean differences). Default 3.

quote

Whether to show everything in quotes. The default is FALSE. If TRUE, everything including the row and column names are quoted so that you can copy it to Excel easily.

missing

Whether to show missing data information.

explain

Whether to add explanation to the variable names, i.e., (%) is added to the variable names when percentage is shown.

printToggle

Whether to print the output. If FALSE, no output is created, and a matrix is invisibly returned.

test

Whether to show p-values. TRUE by default. If FALSE, only the numerical summaries are shown.

smd

Whether to show standardized mean differences. FALSE by default. If there are more than one contrasts, the average of all possible standardized mean differences is shown. For individual contrasts, use summary.

noSpaces

Whether to remove spaces added for alignment. Use this option if you prefer to align numbers yourself in other software.

padColnames

Whether to pad column names with spaces to center justify. The default is FALSE. It is not conducted if noSpaces = TRUE.

varLabels

Whether to replace variable names with variable labels obtained from labelled::var_label() function.

format

The default is "fp" frequency (percentage). You can also choose from "f" frequency only, "p" percentage only, and "pf" percentage (frequency).

showAllLevels

Whether to show all levels. FALSE by default, i.e., for 2-level categorical variables, only the higher level is shown to avoid redundant information.

cramVars

A character vector to specify the two-level categorical variables, for which both levels should be shown in one row.

dropEqual

Whether to drop " = second level name" description indicating which level is shown for two-level categorical variables.

exact

A character vector to specify the variables for which the p-values should be those of exact tests. By default all p-values are from large sample approximation tests (chisq.test).

nonnormal

A character vector to specify the variables for which the p-values should be those of nonparametric tests. By default all p-values are from normal assumption-based tests (oneway.test).

minMax

Whether to use [min,max] instead of [p25,p75] for nonnormal variables. The default is FALSE.

formatOptions

A list of options, which will be passed to format. Can be used to modify the big.markdecimal.markbig.interval etc. The default is list(scientific = FALSE). The options digits, nsmall, justify and trim are not available. (Experimental)

...

For compatibility with generic. Ignored.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值