View source: R/print_pred_stratum.R
print_pred_stratum | R Documentation |
Outputs list of results from 'print_pred' for the whole data set and for each stratum defined by 'strat'. Suitable to assist in determining whether a variable is a confounder or effect modifier. Ref: https://open.oregonstate.education/epidemiology/chapter/effect-modification/
print_pred_stratum( meas, adj, strat, data, dec = 2, n.by.adj = FALSE, p.val = FALSE, include.stratum = T )
meas |
binary outcome measure variable, column name in data.frame as a string. Can be numeric or factor. Result is calculated accordingly. |
adj |
variables to adjust for, as string. |
strat |
stratum to stratify, variable name as string |
data |
dataframe of data. |
include.stratum |
flag to set if stratum variable should be included in first analysis of non-stratified data. |
data('mtcars') mtcars$vs<-factor(mtcars$vs) mtcars$am<-factor(mtcars$am) print_pred_stratum(meas="mpg",strat="vs",adj=c("disp","wt","am"),data=mtcars,include.stratum=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.