AGREETAB MACRO 8 November 2001 Teresa Mayer CancerCare Manitoba (204) 787-4054 The agreetab macro creates two-by-two tables and the following agreement statistics: * sensitivity * specificity * positive predictive value (PPV) * negative predictive value (NPV) * concordance * Youden's index * Kappa statistic and p-value * McNemar's test statistic and p-value %_agreetab (byvar= ,na= ,var1= ,var2= ,outdat= ,indat= , html=, htmldir=, print=, addvar= ,iterat= ,sens= ,spec= ,PPV= ,NPV= ,debug= ); Call: _agreetab ; Options: byvar = at this point, byvar must be supplied. This is the variable that results will be stratified by. na = This must also be specified at this point. This is used to remove missing values. All missing values must be LESS THAN this value. var1 = This must be specified. This is the first variable in the two-by-two table. If one variable is more precise than the other, then this variable is the least precise of the two. default = selfmam. Valid values are 1=yes, 2=no. (If 0=no, then this macro will reset var1=2) So, valid values are actually 1=yes, 0,2=no. var2 = This must be specified. This is the second variable in the two-by-two table, and should be the most precise variable. default = clmam Valid values are 1=yes, 2=no. If 0=no, then this macro will reset var2=2). So, really valid values are 1=yes, 0,2=no. outdat = This is the name of the output dataset. default = &byvar indat = This is the name of the input dataset. default = last dataset used in SAS program. addvar = If you want to add in another variable to the output dataset, specify the variable name here. Default is blank; no other variables will be put into output dataset. interat= Ask Teresa what this is for. It is for doing iterative runs of this macro. And it designates which iteration (or "i" value). MUST be specified if addvar is used. html = yes if you want html output. no if you do not want html output. default=no. htmldir= This is the name of the directory where the html files go. This must be specified if html=yes. print = Print all agree statistics on the .lst file. The statistics printed on the .lst are listed above (e.g. Kappa, concordance, etc.) Valid values are yes or no. default=yes. debug = Set to debug to turn on notes. Default=nodebug. Notes: The byvar= variable and na= options must be set. If you only have one set of data then set a variable to a single value in the datastep prior to the macro call. Na= should be larger than this value (e.g. all=1 then inthe call na=9. Example: data final ; set survey ; all=1 ; run; agreetab byvar=all na = 2 var1=diabete var2=admin_diab outdat=printit indat=final ;