rm_uvsum | R Documentation |
#'A table with the model parameters from running separate univariate models on each covariate. For factors with more than two levels a Global p-value is returned.
A table with the model parameters from running separate univariate models on each covariate. For factors with more than two levels a Global p-value is returned.
rm_uvsum(
response,
covs,
data,
digits = getOption("reportRmd.digits", 2),
covTitle = "",
caption = NULL,
tableOnly = FALSE,
removeInf = FALSE,
p.adjust = "none",
unformattedp = FALSE,
whichp = c("levels", "global", "both"),
chunk_label,
gee = FALSE,
id = NULL,
corstr = NULL,
family = NULL,
type = NULL,
offset = NULL,
strata = 1,
nicenames = TRUE,
showN = TRUE,
showEvent = TRUE,
CIwidth = 0.95,
reflevel = NULL,
returnModels = FALSE,
fontsize,
forceWald = FALSE
)
rm_uvsum(
response,
covs,
data,
digits = getOption("reportRmd.digits", 2),
covTitle = "",
caption = NULL,
tableOnly = FALSE,
removeInf = FALSE,
p.adjust = "none",
unformattedp = FALSE,
whichp = c("levels", "global", "both"),
chunk_label,
gee = FALSE,
id = NULL,
corstr = NULL,
family = NULL,
type = NULL,
offset = NULL,
strata = 1,
nicenames = TRUE,
showN = TRUE,
showEvent = TRUE,
CIwidth = 0.95,
reflevel = NULL,
returnModels = FALSE,
fontsize,
forceWald = FALSE
)
Global p-values are likelihood ratio tests for lm, glm and polr models. For lme models an attempt is made to re-fit the model using ML and if,successful LRT is used to obtain a global p-value. For coxph models the model is re-run without robust variances with and without each variable and a LRT is presented. If unsuccessful a Wald p-value is returned. For GEE and CRR models Wald global p-values are returned.
As of version 0.1.1 if global p-values are requested they will be included in the p-value column.
The number of decimals places to display the statistics can be changed with digits, but this will not change the display of p-values. If more significant digits are required for p-values then use tableOnly=TRUE and format as desired.
tidyselect can only be used for response and covs variables. Additional arguments must be passed in using characters
Global p-values are likelihood ratio tests for lm, glm and polr models. For lme models an attempt is made to re-fit the model using ML and if,successful LRT is used to obtain a global p-value. For coxph models the model is re-run without robust variances with and without each variable and a LRT is presented. If unsuccessful a Wald p-value is returned. For GEE and CRR models Wald global p-values are returned.
The number of decimals places to display the statistics can be changed with digits, but this will not change the display of p-values. If more significant digits are required for p-values then use tableOnly=TRUE and format as desired.
A character vector of the table source code, unless tableOnly=TRUE in which case a data frame is returned
A character vector of the table source code, unless tableOnly=TRUE in which case a data frame is returned
uvsum
,lm
,glm
,
cmprsk::crr
,
survival::coxph
,
nlme::lme
,
geepack::geeglm
,
MASS::glm.nb
covsum
,fisher.test
,
chisq.test
, wilcox.test
,
kruskal.test
, anova
, rstatix::cramer_v
,
rstatix:eta_squared
, and outTable
# Examples are for demonstration and are not meaningful
# Coxph model with 90% CI
data("pembrolizumab")
rm_uvsum(response = c('os_time','os_status'),
covs=c('age','sex','baseline_ctdna','l_size','change_ctdna_group'),
data=pembrolizumab,CIwidth=.9)
# Linear model with default 95% CI
rm_uvsum(response = 'baseline_ctdna',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab)
# Logistic model with default 95% CI
rm_uvsum(response = 'os_status',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab,family = binomial)
# Poisson models returned as model list
mList <- rm_uvsum(response = 'baseline_ctdna',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab, returnModels=TRUE)
#'
# GEE on correlated outcomes
data("ctDNA")
rm_uvsum(response = 'size_change',
covs=c('time','ctdna_status'),
gee=TRUE,
id='id', corstr="exchangeable",
family=gaussian("identity"),
data=ctDNA,showN=TRUE)
# Using tidyselect
pembrolizumab |> rm_uvsum(response = sex,
covs = c(age, cohort))
# Examples are for demonstration and are not meaningful
# Coxph model with 90% CI
data("pembrolizumab")
rm_uvsum(response = c('os_time','os_status'),
covs=c('age','sex','baseline_ctdna','l_size','change_ctdna_group'),
data=pembrolizumab,CIwidth=.9)
# Linear model with default 95% CI
rm_uvsum(response = 'baseline_ctdna',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab)
# Logistic model with default 95% CI
rm_uvsum(response = 'os_status',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab,family = binomial)
# Poisson models returned as model list
mList <- rm_uvsum(response = 'baseline_ctdna',
covs=c('age','sex','l_size','pdl1','tmb'),
data=pembrolizumab, returnModels=TRUE)
#'
# GEE on correlated outcomes
data("ctDNA")
rm_uvsum(response = 'size_change',
covs=c('time','ctdna_status'),
gee=TRUE,
id='id', corstr="exchangeable",
family=gaussian("identity"),
data=ctDNA,showN=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.