View source: R/standardize.proportion.R
standardize.proportion | R Documentation |
Standardize proportions and absolute risks to a given age distribution
standardize.proportion(
vars,
agevar,
byvar,
data,
ref = 2,
formula,
cause,
times,
level = 0.95,
...
)
vars |
Name vector of categorical variables |
agevar |
Name of categorical age variable |
byvar |
Name of categorical strata variable |
data |
Data set |
ref |
For categorical variable that are not factors the level for which we calculate the standardized proportion |
formula |
Passed to prodlim for calculation of absolute risks |
cause |
In case of competing risks the cause of interest |
times |
The time point(s) for evaluation of absolute risks |
level |
Confidence level |
... |
Not (yet) used |
Standardize proportions and absolute risks to a given age distribution
Data table with standardized proportions and standardized absolute risks
Thomas A. Gerds <tag@biostat.ku.dk>
standardize.prodlim
library(riskRegression)
set.seed(84)
d <- riskRegression::sampleData(83)
d[,X1:=factor(X1,levels=c("0","1"),labels=c("0","1"))]
d[,X2:=factor(X2,levels=c("0","1"),labels=c("0","1"))]
d[,agegroups:=cut(X6,c(-Inf,40,60,Inf))]
standardize.proportion(vars=c("X1","X2"),agevar="agegroups",byvar="X4",data=d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.