standardize.proportion: Standardize proportions and absolute risks to a given age...

View source: R/standardize.proportion.R

standardize.proportionR Documentation

Standardize proportions and absolute risks to a given age distribution

Description

Standardize proportions and absolute risks to a given age distribution

Usage

standardize.proportion(
  vars,
  agevar,
  byvar,
  data,
  ref = 2,
  formula,
  cause,
  times,
  level = 0.95,
  ...
)

Arguments

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

Details

Standardize proportions and absolute risks to a given age distribution

Value

Data table with standardized proportions and standardized absolute risks

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

See Also

standardize.prodlim

Examples

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)


tagteam/heaven documentation built on Oct. 24, 2024, 7:40 p.m.