# stddiff: Calculate the Standardized Difference for Numeric, Binary and... In stddiff: Calculate the Standardized Difference for Numeric, Binary and Category Variables

## Description

Contains three main functions including stddiff.numeric(), stddiff.binary() and stddiff.category(). These are used to calculate the standardized difference between two groups. It is especially used to evaluate the balance between two groups before and after propensity score matching.

## Usage

 ```1 2 3``` ```stddiff.numeric(data,gcol,vcol) stddiff.binary(data,gcol,vcol) stddiff.category(data,gcol,vcol) ```

## Arguments

 `data` a dataframe `gcol` a column number of group variable in data, 0 for control group, 1 for treatment group `vcol` one or more column numbers of different types variables in data

## Details

stddiff.numeric() is used for numeric variables. stddiff.binary() is used for binomial variables. stddiff.category() is used for categorical variables. stddiff should be less than 0.2 or 0.1.

## Value

for stddiff.numeric function:

 `mean.c` the mean of control group `sd.c` the standard deviation of control group `mean.t` the mean of treatment group `sd.t` the standard deviation of treatment group `missing.c` the counts of missing value of control group `missing.t` the counts of missing value of treatment group stddiff: the standardized difference between two groups `stddiff.l` the lower limit of the 95 percentage confidence interval of standardized difference `stddiff.u` the upper limit of the 95 percentage confidence interval of standardized difference

for stddiff.binary function:

 `p.c` the proportion of last level in the control group `p.t` the proportion of last level in the treatment group `missing.c` the counts of missing value of control group `missing.t` the counts of missing value of treatment group `stddiff` the standardized difference between two groups `stddiff.l` the lower limit of the 95 percentage confidence interval of standardized difference `stddiff.u` the upper limit of the 95 percentage confidence interval of standardized difference

for stddiff.category function:

 `p.c` the proportion of each level in the control group `p.t` the proportion of each level in the treatment group `missing.c` the counts of missing value of control group `missing.t` the counts of missing value of treatment group `stddiff` the standardized difference between two groups `stddiff.l` the lower limit of the 95 percentage confidence interval of standardized difference `stddiff.u` the upper limit of the 95 percentage confidence interval of standardized difference

## Note

Update:

version 2.0: Avoiding the negative number for the 'stddiff' of stddiff.numeric() and stddiff.binary()

version 3.0: Fixing the incorrect format in the results of stddiff.category()

## Author(s)

Zhicheng Du<dgdzc@hotmail.com>, Yuantao Hao<haoyt@mail.sysu.edu.cn>

## References

Yang DS, Dalton JE. A Unified Approach to Measuring the Effect Size Between Two Groups Using SAS. SAS Global Forum 2012. paper 335

nothing

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```#set.seed(2016) #treat<-round(abs(rnorm(100)+1)*10,0) %% 2 #numeric<-round(abs(rnorm(100)+1)*10,0) #binary<-round(abs(rnorm(100)+1)*10,0) %% 2 #category<-round(abs(rnorm(100)+1)*10,0) %% 3 #data<-data.frame(treat,numeric,binary,category) #stddiff.numeric(data=data,gcol=1,vcol=c(2,2)) #stddiff.binary(data=data,gcol=1,vcol=c(3,3)) #stddiff.category(data=data,gcol=1,vcol=c(4,4)) ```

### Example output

```
```

stddiff documentation built on March 26, 2020, 7:14 p.m.