proc means data=both4 stackodsoutput;
class treat;
var
male minority age
risk_miss
risk_08
risk_09
risk_10
felony_binary
misdem_Sum
felony_Sum
misdem_binary;
ods output summary=temp1a;
run;
proc means data=outgs2 stackodsoutput;
class treat;
var
male minority age
risk_miss
risk_08
risk_09
risk_10
felony_binary
misdem_Sum
felony_Sum
misdem_binary;
ods output summary=temp1b;
run;
data temp1a;
set temp1a;
datatype="(1)raw data";
run;
data temp1b;
set temp1b;
datatype="(2)sample";
run;
data temp1;
set temp1a temp1b;run;
data T;set temp1;
if treat=1;
suji=_n_;
T_N=N;
T_Mean=Mean;
T_SD=StdDev;
T_Min=Min;
T_Max=Max;
keep suji variable T_N T_mean T_SD T_min T_max datatype;
run;
proc sort;by variable;run;
data C;set temp1;
if treat=0;
suji=_n_;
C_N=N;
C_Mean=Mean;
C_SD=StdDev;
C_Min=Min;
C_Max=Max;
keep variable C_N C_mean C_SD C_min C_max;
run;
proc sort;by variable;run;
data TC;
merge T C;
by variable;
/*create statistics*/
mean_dif=(T_Mean-C_Mean);
/*Standardized effects*/
g1=
((T_N-1)*(T_SD*T_SD))
+((C_N-1)*(C_SD*C_SD));
g2=T_N + C_N -2;
g3=sqrt(g1/g2);
WWC_effect=mean_dif/g3;
outcome_type="interval";
if T_Min=0 and T_Max=1 and C_Min=0 and C_Max=1 then do;
outcome_type="binary";
/*&usethis._Mean_Yes-&usethis._Mean_NO*/
Odds_C=(C_Mean/(1-C_Mean));
Odds_T=(T_Mean/(1-T_Mean));
Odds_ratio=Odds_T/Odds_C;
LN_C=LOG(Odds_C);
LN_T=LOG(Odds_T);
LN_DIF=LN_T-LN_C;
WWC_effect=/*abs*/(round(LN_DIF/1.65,0.001));/*fixed 06 01 2016*/
/*If greater than 02, Small Effect
If greater than 0.5, Medium Effect
If greater 0.8 then Large Effect*/
end;
if WWC_effect ne . then do;
if abs(WWC_effect) > 0.2 then cohen="Small ";
if abs(WWC_effect) > 0.5 then cohen="Medium";
if abs(WWC_effect) > 0.8 then cohen="Large";
end;
drop
LN_DIF
LN_C
LN_T
Odds_ratio
Odds_T
Odds_C
g3
g2
g1
;
run;
proc sort;by suji;run;