Hi everyone, I am trying to adapt a macro that calculates effect size and its CL to my data set. This is the original paper: https://analytics.ncsu.edu/sesug/2012/SD-06.pdf The edited macro for my specific dataset is the following: %macro effect_size( data,idvar,design,groupvar, timevar, timeval1, timeval2,respvars,cl=0.95); %if &groupvar^= tx_area and &timevar^= rounds %then %do; proc sql noprint; select distinct(&groupvar) into :grp1-:grp2 from &data; quit; ** to calculate effect size of 2-group pre-post design***; ** make two separate data set for group 1 and group 2****; data data_&grp1(keep=&idvar &timevar &respvars) data_&grp2(keep=&idvar &timevar &respvars); set &data; if &groupvar=&grp1 then output data_&grp1; if &groupvar=&grp2 then output data_&grp2; run; * Noow calculate effect size for both groups*********************; * using either design 1(independent) or design 2 paired desig)***; %eff_size_paired(data=data_&grp1,idvar=&idvar,design=&design, timevar=&timevar,timeval1=&timeval1, timeval2=&timeval2, respvars=&respvars,cl=&cl,outdata=effectsize_table&grp1) %eff_size_paired(data=data_&grp2,design=&design,idvar=&idvar, timevar=&timevar,timeval1=&timeval1, timeval2=&timeval2, respvars=&respvars,cl=&cl,outdata=effectsize_table&grp2) * combine two tables to get effect size***; * IGPP design is square root of sum of variance ****; proc sql; create table effectsize_table_IGPP as select trim(a.Response) ||"&grp1"||"-"||trim(a.Response)||"&grp2" as Response, a.n as n_&grp1, a.mean1 as M1_&grp1 format 8.2, a.sd1 as SD1_&grp1 format=8.2, a.mean2 as M2_&grp1 format=8.2, a.sd2 as SD2_&grp1 format=8.2, b.n as n_&grp2, b.mean1 as M1_&grp2 format=8.2, b.sd1 as SD1_&grp2 format=8.2, b.mean2 as M2_&grp2 format=8.2, b.sd2 as SD2_&grp2 format=8.2, a.effect_size - b.effect_size as eff_size, calculated eff_size-PROBIT(.50+&cl/2)*(sqrt(a.se_d**2+b.se_d**2)) as CI_LOW, calculated eff_size+PROBIT(.50+&cl/2)* (sqrt(a.se_d**2+b.se_d**2)) as CI_UP from work.effectsize_table&grp1 as a, work.effectsize_table&grp2 as b where a.Response=b.response; quit; %goto printresult; %end; ** calculate macro variable for confidence level***; %printresult: ** Print results***; ** Print results***; ods html file="survey_data_eff_size.xls"; %if &timevar= %then %do; title "Table 1: Effect Size (Cohen'd) and its Confidence Interval for Independnt Group Post-Test Design(IG)."; proc sql nonumber; select trim(measure) ||"&grp2"||"-"||trim(measure)||"&grp1" as Response, n1 label="Group&grp1 Sample Size (n1)",mean1 label="Group&grp1 mean", sd1 label="Group&grp1 SD", n2 label="Group&grp2 Sample Size (n2)", mean2 label="Group&grp2 Mean", sd2 label="Group&grp2 SD", eff_size format=8.3 label="Effect Size (d)", "("||trim(left(put(ci_low,8.3)))||","||trim(left(put(ci_up,8.3)))||")" label="&conf % Conf. Interval" from work.effectsize_table_IG; quit; title; %end; %if &groupvar^= tx_area and &timevar^= rounds %then %do; title "Table 1: Effect Size (Cohen'd) and its Confidence Interval for Independent Group Pretest Posttest Design(IGPP)"; proc sql nonumber; select * from work.effectsize_table_IGPP; quit; title; %end; ods html close; %mend effect_size; the macro invoking line is: %effect_size( data=che_lim, idvar=unique_id, groupvar=tx_area, respvars=hc_cat BSI TRGI CESD, cl=0.95) I have been getting the following error: ERROR: Insufficient authorization to access C:\Program Files\SASHome\SASFoundation\9.4\effectsize_table_IGPP.xls. ERROR: No body file. HTML output will not be created. and ERROR: File WORK.EFFECTSIZE_TABLE_IG.DATA does not exist. Can someone let me know what is it that I'm doing wrong? I am using SAS 9.4 on windows.
... View more