Learn R Programming

StratifiedBalancing (version 0.2.0)

sensdisc: sensdisc()

Description

This function performs sensitivity analysis on discrete outcome variables by dropping varaibles one at a time, in-order to determine which variables can be removed without altering the results of stratified covariate balancing.

Usage

sensdisc(Treatment,Outcome,Matrix)

Arguments

Treatment

Column number of variable to be used as treatment.

Outcome

Column number of variable to be used as outcome.

Matrix

Name of matrix or data.frame where data is stored.

Details

This function performs sensitivity analysis by dropping varaibles one at a time, in-order to determine which variables can be removed without altering the results of stratified covariate balancing.

Examples

Run this code
# NOT RUN {
## In this example we will generate a matrix with a large number of
## covariates and a small number of observations. No model will be
## built into the data, our goal here is to demonstrate how sensitivty
## analysis would be performed.

## Firstly a matrix with 10 columns and 1000 observations will be created
m=matrix(nrow=1000,ncol=10)
for(i in 1:ncol(m)){
m[,i]=rbinom(1000,1,0.5)
}

## Next we will run function sensdisc() on the data.
g=sensdisc(9,10,m)

# }

Run the code above in your browser using DataLab