The macro is used by reading the macro into SAS with an "include" statement:
%inc [[path and filename where macro is found]] and then calling the macro by typing %lregmc1( parameter1=choice1, parameter2=choice2, ...) where the parameters and choices are as follows: DATA SAS dataset to be used in fitting the model. The default is the last dataset created. YVAR The variable that contains the imperfect diagnostic test result. YVAR must be a binary variable which takes the values 1 or 0. XVAR The predictor variables in the model. You have to create your own intercept variable if you want an intercept in the model. SENS The variable which provides the sensitivity of the diagnostic test which generated YVAR. SENS must be a variable in the dataset and so it takes a value for each observation in the dataset. In many applications, SENS will assume the same value for each observation. The default is 1. SPEC Analogous to SENS, SPEC specifies the variable which provides the specificity of the diagnostic test. The default is 1. BETA Initial estimates for the regression coefficients. This is an optional parameter and may only be necessary if there is difficulty reaching convergency with the initial estimates chosen by the program. ITER The maximum number of iterations performed by the program. The default number is 50. CRIT The convergence criteria. The default value is .00001. MISSDEL This specified how missing values are handled. If "yes" then all observations which have missing values for either YVAR, XVAR, SENS, or SPEC will be automatically removed from the dataset before the program model is fit. The default is "yes". I cannot think of any reason not to specify MISSDEL="yes". PRINTER This specifies whether the results from each iteration are printed. The iteration results will not be printed unless PRINTER="yes". ===================================================================== Example: The following program reads in some data and fits a simple model under the assumption that the sensitivity of the diagnostic test is .8 and the specificity is .9: %inc "c:lregmc1.sas"; data a; input exposures testres; sensvar-.8; specvar=.9; intcept=1; cards; 1 1 1 1 1 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 ; %lregmc1 (data=a,yvar=testres,xvar=intcept exposure, sens=sensvar,spec=specvar); run; This produces the following output: The SAS System 09:50 Friday, August 16, 1996 Logistic Regression when outcome is measure with error and sensitivity and specificity are known Data File: a Outcome variable: TESTRES Predictors: INTCEPT EXPOSURE Sensitivity variable: SENSVAR Specificity variable: SPECVAR Number of non-missing obs used: 10 Averages of Outcome variable and Predictors: TESTRES INTCEPT EXPOSURE SENSVAR SPECVAR 0.5 1.0 0.5 0.8 0.9 Initial estimate of regression coefficients: INTCEPT 0.4 EXPOSURE 0.2 NOTE: Convergence after 19 iteration(s). Variance/covariance of estimates: INTCEPT EXPOSURE INTCEPT 1.633333 -1.633333 EXPOSURE -1.633333 3.9853066 Estimate with s.e., z-score, p-value, and confidence limits: Estimate SE z pvalue OR lower upper INTCEPT -0.287681 1.2780 -0.2251 0.8219 0.75 0.06 9.18 EXPOSURE 1.2039607 1.9963 0.6031 0.5464 3.33 0.07 166.79 Log-likelihood=-6.730117