diff_compare | R Documentation |
Compare two datasets based on relative changes, ztest and ttest.
diff_compare(dat1 = dat1, dat2 = dat2, wgt1 = wgt1, wgt2 = wgt2, varlist = fvarlist, segment = segment, ratediff = 0.05)
dat1 |
dataset 1. |
dat2 |
dataset 2. |
wgt1 |
weight of dataset1. |
wgt2 |
weight of dataset2. |
varlist |
variable list to be compared. All variables must exsit in both datasets. |
segment |
tag to the comparison which is used to identify different comparisons. |
ratediff |
threshold of relative change (percent) for binary variables. All variables will be categoried to dummy variables for comparison at different levels. Default value: 0.05. |
The return list contains comparison results
, and segment identifier
.
res <- diff_compare(dat1=data.baseline, dat2=data.primary, wgt1=PERS_WGT, wgt2=PERS_WGT, varlist=varlist, segment="SEGID1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.