Learn R Programming

StratifiedBalancing (version 0.2.0)

senscont: senscont()

Description

This function performs sensitivity analysis on continuous variable outcomes 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

senscont(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)
}

## We will populate the 10th column randomly from the normal distribtuion
m[,10]=rnorm(1000,0,1)
## Next we will run function sensdisc() on the data.
g=senscont(9,10,m)

# }

Run the code above in your browser using DataLab