24
STUDY SERIES (Statistics #2008-01) SAS Programs for Fitting a Large Number of Stepwise Regressions, Each With a Large Number of Model Variables, and Identifying Outliers Julie Tsay Lynn Weidman Statistical Research Division U.S. Census Bureau Washington, D.C. 20233 Report Issued: September 30, 2008 Disclaimer: This report is released to inform interested parties of research and to encourage discussion. The views expressed are those of the authors and not necessarily those of the U.S. Census Bureau.

STUDY SERIES (Statistics #2008-01)STUDY SERIES (Statistics #2008-01) SAS Programs for Fitting a Large Number of Stepwise Regressions, Each With a Large Number of Model Variables, and

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • STUDY SERIES (Statistics #2008-01)

    SAS Programs for Fitting a Large Number of Stepwise Regressions, Each With a Large Number of Model Variables, and Identifying Outliers

    Julie Tsay Lynn Weidman

    Statistical Research Division U.S. Census Bureau

    Washington, D.C. 20233

    Report Issued: September 30, 2008 Disclaimer: This report is released to inform interested parties of research and to encourage discussion. The views expressed are those of the authors and not necessarily those of the U.S. Census Bureau.

  • SAS Programs for Fitting a Large Number of Stepwise Regressions, Each With a Large Number of Model Variables, and Identifying Outliers

    Julie Tsay and Lynn Weidman

    Statistical Research Division, U. S. Census Bureau

    Abstract This paper presents documentation for a SAS program and describes its flexibility in performing stepwise regressions for a large number of analysis measures, calculating their predicted values, and identifying potential outliers. Keywords stepwise regression, outliers 1. Introduction In 2008 the Census Bureau will publish its first full-sample multi-year data products for the American Community Survey (ACS) and the Puerto Rico Community Survey (PRCS). They will consist of three-year estimates, using data collected in 2005, 2006, and 2007, for geographies with populations of at least 20,000. These estimates must be reviewed by subject-matter analysts before the products are released. The purpose of the review is to identify unusual estimates, often called outliers, for each published geography and to determine why they occur and if they make sense. There are three empirical, three statistical, and about a dozen other rules that are applied to 285 estimates or functions of estimates, referred to as measures, for use in the review. For each measure an analyst defines a combination of the rules to be used to identify whether the value of a measure for a given geography is an outlier. The rule we proposed for use in the review is based on the following idea. All the other rules that are measure-based look only at the distribution of a single measure across geographies. Before determining whether or not the measure for a given geography is an outlier, we would like to know if its value makes sense, based on the values of related measures in the geography. In other words, a measure for a specific geography may be an outlier compared to its value in other geographies, but may be reasonable based on the values of other measures in that geography, or vice versa. The relationship between a measure and other measures in the same geography is defined by a linear regression selected via a stepwise procedure. This paper describes the individual tasks that were defined to implement this regression rule and the software written to perform them. Program listings are presented in the appendix. An important thing to note about the outlier detection process is that it is actually performed twice using the same programs, once for data from the ACS and once for data from the PRCS. For simplicity, in the remainder of the paper we will just refer to ACS.

  • 2. Methodology The initial set of estimates calculated for ACS data products are combined into base tables, so named because they are the basis for all other estimates that are produced. A subset of these initial estimates and functions of multiple initial estimates were identified by subject-matter analysts to be used in their review of the data before the public release of the ACS estimates, and are referred to as measures. Most of these measures are percentages. The flowchart below shows how the regression outlier detection process for these measures was separated into individual tasks. The main task was to develop software to automatically select regression models for a function of each of the 285 measures, where the potential independent variables are among the other 284 measures. Then the resulting coefficient estimates and their estimated covariance matrix were saved to be used to calculate predicted values, 95% confidence intervals, and outlier flags for each geography by measure combination. In addition, the saved coefficient and covariance matrix estimates were used to calculate outlier flags for other geographies as they became available. A brief explanation of the function each of the programs in the flowchart follows.

    File of estimates for measures -- by geography

    Reformat measure names as needed

    Transform percentages to logits

    Perform stepwise regression for each measure using proc REG

    Run proc REG to reformat regression coefficient and covariance matrix files to directly usable form

    Calculate predicted values, confidence limits, and outlier flags

    Output file of outlier flags – measure by geography

    A file of measures for each Public Use Microdata Area (PUMA) type was provided by the ACS Data Products Branch. The measures are grouped by subject into profile tables and the name of a measure in a given profile table is in the format ‘P##L**’, where ## is the profile table number and ** is its line number in that profile table. Additionally, there is a variable which is the number of the base table from which a measure is derived and a variable which is the geography code for the PUMA. The file is sorted by PUMA and profile line within profile table but the profile tables are not sorted. When fitting the stepwise regression for a given measure, all other measures except those having the same profile and base tables as the given measure are eligible independent variables. So the first task is to rename the measures as needed to be able to easily identify which measures are not eligible to be used as independent variables in each stepwise regression. This is accomplished by finding profile tables whose measures are derived from more than one base table. The set of measures that come from the same base table as the

  • measure on line 1 retain their original profile table and line number; the rest of the measures are assigned new profile tables and line numbers, with one profile table for each different base table. All profile table names are reformatted to the format ‘P###L**.’ Next, a logit transformation logit(measure) = log[measure/(1- measure)] is applied to measures that are percentages. Before calculating the transformed values, the measures are Windsorized to a minimum value of .0001 and a maximum value of .9999 to avoid infinite logit values for measures of 0 and 1. Now a linear regression model is estimated for each non-percentage measure and each logit of a percentage measure. Variable selection is performed via the stepwise selection method in SAS procedureREG. Options used are calculating and inputting a covariance matrix of the measures, significance level .10 for variables to enter the regression, and significance level .05 for variables to be removed from the regression. The estimated coefficients of the variables in the final model, the model mean squared error, and the covariance matrix of the estimated coefficients are saved as outputs. The output from procedureREG is in a format that is not directly usable for the next set of calculations. Rather than these files including just measures selected as the independent variables in the final regression model, all measures which were eligible independent variables are included. A single model is run for procedureREG that includes only the independent variables selected in the final stepwise model, so the new output files of the estimated coefficients and their covariance matrix no longer include the unused eligible independent variables and have a directly usable form. Then they are used to calculate the predicted values, 95% confidence limits and outlier flags for the model dependent variable in all the geographies included in the initial input file. The predicted value of y for geography i is pred(yi) = xyi′ by , which has the estimated variance var(yi) = xyi′ cov(by) xyi + sey2, where yi is measure y for geographic area i, xyi′ is a row vector of the independent variable measures in the regression model for y, by is the corresponding column vector of estimated regression coefficients, cov(by) is the estimated covariance matrix of by , and sey is the square root of estimated variance of the model for y. The upper and lower 95% confidence limits are Upper limit = pred(yi) + 1.96*sqrt(var(yi)) Lower limit = pred(yi) - 1.96*sqrt(var(yi)).

  • The flags are calculated as flag = 0 if the observed values lies inside the 95% confidence interval for the predicted values from the regression or at least one of the measures in the regression model is missing flag = 1 if the observed values lies outside the 95% confidence interval for the predicted values from the regression 3. Summary description of the programs The program RegFlag performs the steps in the flowchart for PUMAs using the following SAS programs. rename_tbl.sas: Reads the input file of measures, re-formats measure names, and renames measures in a profile table that come from a different base table than its first measure. Checks for missing values for each measure and geography. If a measure has the same value in all geographies, then it deletes the variables from the output file. create_logit_puma.sas: A logit transformation is applied to all of the measures that are percentages.

    reg_flag_puma.sas: The main driver, this program calls two macros to perform stepwise regressions and calculate outlier flags. namelist: Put all measure names into a character array. duloop: For a dependent variable, identifies measure names of eligible independent

    variables for the stepwise regression procedure and calls three macros. stepreg: Performs stepwise regression using SAS procedure REG to choose the

    regression model for the dependent variable. The estimated coefficients of the independent variables in the final model, the model mean squared error, and the covariance matrix of the estimated coefficients are saved as output.

    savcov: Run procedureREG using only the independent variables in the final model to convert the output files from stepreg to a directly usable format.

    setflag: Use the files from savcov to calculate predicted values, confidence limits, and outlier flags for the measure or logit measure in each PUMA.

    catprflag_puma_us.sas: Combines the output files of flags for each measure and, if a measure name was changed for use in the regression procedure, changes it back to its original name. This file is returned to the ACS Data Products Branch. Outlier flags for 21 geographic levels other than PUMAs were created using the estimates from savcov to calculate predicted values and confidence limits for all measures. This was accomplished using suitably modified versions of rename_tbl.sas, create_logit_puma.sas, namelist, setflag, and catprflag_puma_us.sas.

    Listings of the programs rename_tbl.sas, create_logit_puma.sas, and reg_flag_puma.sas are included in the Appendices.

  • Appendix 1 Program to rename the measures options nocenter linesize=120; libname j7 '/cenhome/tsay0001/acs-multiyr/3yr_review/July08'; data est; set j7.est_795; run; data dat1; set j7.tblcomp_795(where=(geoid='79500US0100100')); tbl=proftbl*1; ln=profln*1; run; proc iml; start chgprof(tb2,c) global(ptb); p=c-1; flag=0; do i=1 to p; tmp=ptb[i:i,]; if tb2=tmp then do; flag=1; i=p; end; end; return(flag); finish chgprof; use dat1; read all var {tblid} into tblid; read all var {tbl} into ptb; read all var {ln} into pln; read all var {proftbl} into ctb; read all var {profln} into cln; x=max(ptb); print x; nr=nrow(tblid); tbn=100; id1=tblid[1:1,]; tb1=ptb[1:1,]; ctb1=concat('flagP0',char(tb1,2,0)); ln1=pln[1:1,]; cln1=concat(ctb1,'L0',char(ln1,1,0)); oln1=concat('P',char(tb1,2,0),'L0',char(ln1,1,0)); do i=2 to nr; id2=tblid[i:i,]; tb2=ptb[i:i,]; ln2=pln[i:i,]; ob2=ptb[i:i,]; on2=pln[i:i,]; if (id1 ^= id2) then do; nln=0; flag=chgprof(tb2,i); if flag=1 then do;

  • tbn=tbn+1; nln=nln+1; ln2=nln; tb2=tbn; end; end; else if (id1=id2) & (tb1 ^= tb2) then do; tb2=tb1; ln2=ln1+1; end; if tb29 & tb2

  • proc iml; use est; read all var _num_ into x; read all var {geoid} into geoid; use j7.newvar; read all var {newvar} into y1; read all var {orgvar} into a1; name1=y1`; name2=a1`; nr=nrow(x); nc=ncol(x); DO i=1 TO nr; count=0; do j=1 to nc; tmp=x[i:i,j:j]; if tmp=. then count=count+1; end; if i=1 then cntms=count; else cntms=cntms//count; end;; create ling4 from x [colname=name1]; append from x; create ling5 var {geoid cntms}; append; create ling6 from x [colname=name2]; append from x; close ling4; close ling5; close ling6; *** checking the number of missing value in each measure and each geography; proc means data=ling4 n nmiss min max; var P033L01 -- P158L01; run; proc means data=ling6 n nmiss min max; var P33L01 -- P46L01; run; proc print data=ling5; var geoid cntms; title 'The number of missing measures by each geography'; run;

  • Appendix 2 Program to perform logit transformations options nocenter linesize=120; libname reg '/cenhome/tsay0001/acs-multiyr/3yr_review/July08'; data dat1; set reg.est_795; run; proc iml; use dat1; read all var { P33L02 P33L03 P33L04 P33L05 P33L06 P28L01 P28L02 P28L03 P28L04 P28L05 P28L06 P28L07 P13L02 P13L04 P13L06 P13L07 P13L10 P01L06 P01L02 P01L03 P01L04 P01L05 P01L01 P03L01 P03L02 P03L03 P03L04 P03L05 P03L06 P09L01 P09L02 P09L03 P45L01 P45L02 P45L03 P45L04 P47L02 P47L01 P47L03 P47L04 P22L01 P22L02 P22L03 P22L04 P22L05 P22L07 P18L10 P18L11 P18L14 P18L15 P18L16 P18L17 P18L18 P18L19 P18L02 P18L03 P18L04 P18L05 P18L06 P18L07 P18L08 P18L09 P18L12 P18L13 P29L01 P29L04 P11L01 P11L02 P11L03 P15L03 P15L04 P15L05 P15L06 P15L07 P15L08 P15L09 P15L10 P15L11 P21L01 P21L02 P21L03 P10L01 P10L02 P32L01 P32L02 P32L03 P32L04 P32L05 P32L08 P32L09 P44L01 P44L02 P20L04 P20L05 P20L07 P20L10 P20L11 P20L12 P20L13 P20L14 P20L15 P27L01 P27L02 P27L03 P27L04 P27L05 P27L06 P27L07 P27L08 P27L10 P05L01 P05L02 P05L06 P05L07 P05L08 P05L09 P05L10 P05L11 P05L12 P05L13 P05L14 P05L15 P05L16 P05L17 P05L18 P05L19 P16L16 P16L23 P16L24 P16L10 P16L17 P16L18 P16L19 P16L11 P16L12 P40L01 P40L02 P40L03 P40L04 P40L05 P36L01 P08L01 P08L02 P08L03 P08L04 P08L05 P08L06 P41L01 P41L02 P24L01 P24L02 P24L03 P24L04 P24L05 P24L06 P24L07 P24L08 P24L09 P24L10 P24L11 P24L12 P17L01 P17L02 P17L03 P17L04 P17L05 P17L06 P17L07 P17L08 P17L09 P17L10 P17L11 P17L12 P17L13 P17L14 P17L15 P17L16 P17L17 P17L18 P17L19 P17L20 P17L21 P17L22 P17L23 P17L24 P17L25 P17L26 P04L01 P04L02 P04L03 P04L04 P04L05 P04L06 P04L07 P04L08 P04L09 P04L10 P04L11 P04L12 P04L13 P04L14 P04L15 P04L16 P23L02 P23L03 P35L01 P35L02 P23L04 P23L05 P23L06 P14L01 P14L02 P37L01 P37L02 P12L01 P12L02 P02L01 P34L01 P34L02 P39L01 P39L02 P39L03 P39L04 P26L01 P19L01 P19L02 P25L01 P25L08 P25L09 P46L01 } into p; read all var { P33L01 P33L07 P18L01 P18L20 P29L02 P29L03 P15L01 P15L02 P05L20 P16L01 P16L15 P16L21 P16L22 P16L14 P07L01 P07L02 P41L03 P24L13 P24L14 P24L15 P24L16 P24L17 P24L18 P17L27 P17L28 P17L29 P17L30 P17L31 P17L32 P17L33 P17L34 P17L35 P17L36 P17L37 P17L38 P17L39 P04L17 P04L18 P04L19 P04L20 P04L21 P04L22 P04L23 P31L01 P43L01 P42L01 P42L02 P30L01 P30L02 P38L01

  • P25L04 P25L05 P25L06 P25L07 P25L10 } into t; read all var {geoid} into geoid; name2={'LP033L01','LP101L01','LP018L01','LP018L20','LP029L02','LP029L03','LP015L01','LP015L02','LP131L01','LP016L01', 'LP132L01','LP142L01','LP143L01','LP144L01','LP007L01','LP007L02','LP148L01','LP149L01','LP149L02','LP149L03', 'LP149L04','LP149L05','LP149L06','LP150L01','LP150L02','LP150L03','LP150L04','LP150L05','LP150L06','LP150L07', 'LP150L08','LP150L09','LP150L10','LP150L11','LP150L12','LP150L13','LP151L01','LP151L02','LP151L03','LP151L04', 'LP151L05','LP151L06','LP151L07','LP031L01','LP043L01','LP042L01','LP042L02','LP030L01','LP154L01','LP038L01', 'LP155L01','LP155L02','LP156L01','LP156L02','LP158L01' }; name1={'LP033L02','LP033L03','LP033L04','LP033L05','LP033L06','LP028L01','LP028L02','LP028L03','LP028L04','LP028L05', 'LP028L06','LP028L07','LP013L02','LP013L04','LP013L06','LP013L07','LP013L10','LP001L06','LP001L02','LP001L03', 'LP001L04','LP001L05','LP102L01','LP003L01','LP003L02','LP003L03','LP103L01','LP103L02','LP103L03','LP009L01', 'LP009L02','LP009L03','LP045L01','LP045L02','LP045L03','LP045L04','LP047L02','LP047L01','LP047L03','LP047L04', 'LP022L01','LP022L02','LP022L03','LP022L04','LP022L05','LP104L01','LP105L01','LP106L01','LP107L01','LP107L02', 'LP107L03','LP107L04','LP107L05','LP107L06','LP108L01','LP108L02','LP108L03','LP108L04','LP108L05','LP108L06', 'LP108L07','LP108L08','LP109L01','LP110L01','LP029L01','LP111L01','LP011L01','LP011L02','LP011L03','LP015L03', 'LP015L04','LP015L05','LP015L06','LP015L07','LP015L08','LP015L09','LP015L10','LP015L11','LP021L01','LP021L02', 'LP112L01','LP010L01','LP010L02','LP032L01','LP032L02','LP032L03','LP032L04','LP032L05','LP113L01','LP114L01', 'LP044L01','LP044L02','LP020L04','LP115L01','LP116L01','LP116L02','LP116L03','LP116L04','LP116L05','LP116L06', 'LP116L07','LP027L01','LP027L02','LP027L03','LP117L01','LP118L01','LP119L01','LP119L02','LP119L03','LP120L01', 'LP005L01','LP005L02','LP121L01','LP121L02','LP121L03','LP121L04','LP122L01','LP123L01','LP124L01','LP125L01', 'LP126L01','LP127L01','LP128L01','LP128L02','LP129L01','LP130L01','LP133L01','LP134L01','LP135L01','LP136L01', 'LP137L01','LP138L01','LP139L01','LP140L01','LP141L01','LP040L01','LP145L01','LP145L02','LP145L03','LP145L04', 'LP036L01','LP008L01','LP008L02','LP008L03','LP008L04','LP008L05','LP146L01','LP041L01','LP147L01','LP024L01', 'LP024L02','LP024L03','LP024L04','LP024L05','LP024L06','LP024L07','LP024L08','LP024L09','LP024L10','LP024L11', 'LP024L12','LP017L01','LP017L02','LP017L03','LP017L04','LP017L05','LP017L06','LP017L07','LP017L08','LP017L09', 'LP017L10','LP017L11','LP017L12','LP017L13','LP017L14','LP017L15','LP017L16','LP017L17','LP017L18','LP017L19', 'LP017L20','LP017L21','LP017L22','LP017L23','LP017L24','LP017L25','LP017L26','LP004L01','LP004L02','LP004L03', 'LP004L04','LP004L05','LP004L06','LP004L07','LP004L08','LP004L09','LP004L10','LP004L11','LP004L12','LP004L13', 'LP004L14','LP004L15','LP004L16','LP023L02','LP023L03','LP035L01','LP035L02','LP152L01','LP152L02','LP152L03', 'LP014L01','LP014L02','LP037L01','LP037L02','LP012L01','LP012L02','LP002L01','LP034L01','LP034L02','LP039L01', 'LP039L02','LP039L03','LP039L04','LP026L01','LP019L01','LP153L01','LP025L01','LP157L01','LP157L02','LP046L01' }; name3={'P033L02','P033L03','P033L04','P033L05','P033L06','P028L01','P028L02','P028L03','P028L04','P028L05', 'P028L06','P028L07','P013L02','P013L04','P013L06','P013L07','P013L10','P001L06','P001L02','P001L03', 'P001L04','P001L05','P102L01','P003L01','P003L02','P003L03','P103L01','P103L02','P103L03','P009L01', 'P009L02','P009L03','P045L01','P045L02','P045L03','P045L04','P047L02','P047L01','P047L03','P047L04', 'P022L01','P022L02','P022L03','P022L04','P022L05','P104L01','P105L01','P106L01','P107L01','P107L02', 'P107L03','P107L04','P107L05','P107L06','P108L01','P108L02','P108L03','P108L04','P108L05','P108L06', 'P108L07','P108L08','P109L01','P110L01','P029L01','P111L01','P011L01','P011L02','P011L03','P015L03',

  • 'P015L04','P015L05','P015L06','P015L07','P015L08','P015L09','P015L10','P015L11','P021L01','P021L02', 'P112L01','P010L01','P010L02','P032L01','P032L02','P032L03','P032L04','P032L05','P113L01','P114L01', 'P044L01','P044L02','P020L04','P115L01','P116L01','P116L02','P116L03','P116L04','P116L05','P116L06', 'P116L07','P027L01','P027L02','P027L03','P117L01','P118L01','P119L01','P119L02','P119L03','P120L01', 'P005L01','P005L02','P121L01','P121L02','P121L03','P121L04','P122L01','P123L01','P124L01','P125L01', 'P126L01','P127L01','P128L01','P128L02','P129L01','P130L01','P133L01','P134L01','P135L01','P136L01', 'P137L01','P138L01','P139L01','P140L01','P141L01','P040L01','P145L01','P145L02','P145L03','P145L04', 'P036L01','P008L01','P008L02','P008L03','P008L04','P008L05','P146L01','P041L01','P147L01','P024L01', 'P024L02','P024L03','P024L04','P024L05','P024L06','P024L07','P024L08','P024L09','P024L10','P024L11', 'P024L12','P017L01','P017L02','P017L03','P017L04','P017L05','P017L06','P017L07','P017L08','P017L09', 'P017L10','P017L11','P017L12','P017L13','P017L14','P017L15','P017L16','P017L17','P017L18','P017L19', 'P017L20','P017L21','P017L22','P017L23','P017L24','P017L25','P017L26','P004L01','P004L02','P004L03', 'P004L04','P004L05','P004L06','P004L07','P004L08','P004L09','P004L10','P004L11','P004L12','P004L13', 'P004L14','P004L15','P004L16','P023L02','P023L03','P035L01','P035L02','P152L01','P152L02','P152L03', 'P014L01','P014L02','P037L01','P037L02','P012L01','P012L02','P002L01','P034L01','P034L02','P039L01', 'P039L02','P039L03','P039L04','P026L01','P019L01','P153L01','P025L01','P157L01','P157L02','P046L01' }; nr=nrow(p); nc=ncol(p); DO i=1 TO nr; do j=1 to nc; tmp=p[i:i,j:j]; if tmp^=. then do; tmp1=tmp/100; if tmp1.9999 then tmp2=.9999; else tmp2=tmp1; LP=log(tmp2/(1-tmp2)); end; else LP=.; if j=1 then lg1=LP; else lg1=lg1||LP; end; free tmp tmp1 tmp2 LP; if i=1 then lg=lg1; else lg=lg//lg1; end; create ling1 from lg [colname=name1]; append from lg;

  • create ling3 var {geoid}; append; create ling2 from t [colname=name2]; append from t; create ling4 from p [colname=name3]; append from p; close ling1; close ling2; close ling3; close ling4; *** output file for running stepwise regressions; data reg.logit_795; merge ling1 ling2 ling3 ling4 ; run;

  • Appendix 3 Program to perform stepwise regressions and calculate outlier flags /********************************************************************************************************* *** The purpose of this program is to prepare the file of flags for the regression rule to be used . *** It is performed by a call set of macros included : namelist, duloop, stepreg, savcov and setflag. ************************************************************************************************************/ options nocenter mprint symbolgen mlogic linesize=120; libname reg '/cenhome/tsay0001/acs-multiyr/3yr_review/July08'; libname nreg '/cenhome/tsay0001/acs-multiyr/3yr_review/July08/data'; data all; set reg.logit_795; state=substr(geoid,8,2); run; **** Exclude the measures in PRCS; data dat1(drop=LP018L20 LP047L01 LP047L02 LP047L03 LP047L04 P047L01 P047L02 P047L03 P047L04); set all(where=(state ne '72')); run; **** Computes correlation coefficients between variables and requests that covariances be printed; proc corr nocorr cov data=dat1(drop=geoid) outp=corout (type=cov) noprint; run; /*** Input all measures into a character array that assigns measure one by one as the dependent variable in stepwise regression procedure. The array declaration needs to change according to the measures from the input file; */ %MACRO namelist; data _null_; array colcd(280) $ ('LP033L01','LP033L02','LP033L03','LP033L04','LP033L05','LP033L06','LP101L01','LP028L01','LP028L02','LP028L03', 'LP028L04','LP028L05','LP028L06','LP028L07','LP013L02','LP013L04','LP013L06','LP013L07','LP013L10','LP001L06', 'LP001L02','LP001L03','LP001L04','LP001L05','LP102L01','LP003L01','LP003L02','LP003L03','LP103L01','LP103L02', 'LP103L03','LP009L01','LP009L02','LP009L03','LP045L01','LP045L02','LP045L03','LP045L04', 'LP022L01','LP022L02','LP022L03','LP022L04','LP022L05','LP104L01','LP018L01', 'LP105L01','LP106L01','LP107L01','LP107L02','LP107L03','LP107L04','LP107L05','LP107L06','LP108L01','LP108L02', 'LP108L03','LP108L04','LP108L05','LP108L06','LP108L07','LP108L08','LP109L01','LP110L01','LP029L01','LP029L02', 'LP029L03','LP111L01','LP011L01','LP011L02','LP011L03','LP015L01','LP015L02','LP015L03','LP015L04','LP015L05', 'LP015L06','LP015L07','LP015L08','LP015L09','LP015L10','LP015L11','LP021L01','LP021L02','LP112L01','LP010L01',

  • 'LP010L02','LP032L01','LP032L02','LP032L03','LP032L04','LP032L05','LP113L01','LP114L01','LP044L01','LP044L02', 'LP020L04','LP115L01','LP116L01','LP116L02','LP116L03','LP116L04','LP116L05','LP116L06','LP116L07','LP027L01', 'LP027L02','LP027L03','LP117L01','LP118L01','LP119L01','LP119L02','LP119L03','LP120L01','LP005L01','LP005L02', 'LP121L01','LP121L02','LP121L03','LP121L04','LP122L01','LP123L01','LP124L01','LP125L01','LP126L01','LP127L01', 'LP128L01','LP128L02','LP129L01','LP130L01','LP131L01','LP016L01','LP132L01','LP133L01','LP134L01','LP135L01', 'LP136L01','LP137L01','LP138L01','LP139L01','LP140L01','LP141L01','LP142L01','LP143L01','LP144L01','LP007L01', 'LP007L02','LP040L01','LP145L01','LP145L02','LP145L03','LP145L04','LP036L01','LP008L01','LP008L02','LP008L03', 'LP008L04','LP008L05','LP146L01','LP041L01','LP147L01','LP148L01','LP024L01','LP024L02','LP024L03','LP024L04', 'LP024L05','LP024L06','LP024L07','LP024L08','LP024L09','LP024L10','LP024L11','LP024L12','LP149L01','LP149L02', 'LP149L03','LP149L04','LP149L05','LP149L06','LP017L01','LP017L02','LP017L03','LP017L04','LP017L05','LP017L06', 'LP017L07','LP017L08','LP017L09','LP017L10','LP017L11','LP017L12','LP017L13','LP017L14','LP017L15','LP017L16', 'LP017L17','LP017L18','LP017L19','LP017L20','LP017L21','LP017L22','LP017L23','LP017L24','LP017L25','LP017L26', 'LP150L01','LP150L02','LP150L03','LP150L04','LP150L05','LP150L06','LP150L07','LP150L08','LP150L09','LP150L10', 'LP150L11','LP150L12','LP150L13','LP004L01','LP004L02','LP004L03','LP004L04','LP004L05','LP004L06','LP004L07', 'LP004L08','LP004L09','LP004L10','LP004L11','LP004L12','LP004L13','LP004L14','LP004L15','LP004L16','LP151L01', 'LP151L02','LP151L03','LP151L04','LP151L05','LP151L06','LP151L07','LP023L02','LP023L03','LP035L01','LP035L02', 'LP152L01','LP152L02','LP152L03','LP014L01','LP014L02','LP031L01','LP037L01','LP037L02','LP043L01','LP042L01', 'LP042L02','LP012L01','LP012L02','LP002L01','LP034L01','LP034L02','LP039L01','LP039L02','LP039L03','LP039L04', 'LP026L01','LP019L01','LP153L01','LP030L01','LP154L01','LP038L01','LP025L01','LP155L01','LP155L02','LP156L01', 'LP156L02','LP157L01','LP157L02','LP158L01','LP046L01' ); array colci(280) $ ('LP033L01','P033L02','P033L03','P033L04','P033L05','P033L06','LP101L01','P028L01','P028L02','P028L03', 'P028L04','P028L05','P028L06','P028L07','P013L02','P013L04','P013L06','P013L07','P013L10','P001L06', 'P001L02','P001L03','P001L04','P001L05','P102L01','P003L01','P003L02','P003L03','P103L01','P103L02', 'P103L03','P009L01','P009L02','P009L03','P045L01','P045L02','P045L03','P045L04', 'P022L01','P022L02','P022L03','P022L04','P022L05','P104L01','LP018L01', 'P105L01','P106L01','P107L01','P107L02','P107L03','P107L04','P107L05','P107L06','P108L01','P108L02', 'P108L03','P108L04','P108L05','P108L06','P108L07','P108L08','P109L01','P110L01','P029L01','LP029L02', 'LP029L03','P111L01','P011L01','P011L02','P011L03','LP015L01','LP015L02','P015L03','P015L04','P015L05', 'P015L06','P015L07','P015L08','P015L09','P015L10','P015L11','P021L01','P021L02','P112L01','P010L01', 'P010L02','P032L01','P032L02','P032L03','P032L04','P032L05','P113L01','P114L01','P044L01','P044L02', 'P020L04','P115L01','P116L01','P116L02','P116L03','P116L04','P116L05','P116L06','P116L07','P027L01', 'P027L02','P027L03','P117L01','P118L01','P119L01','P119L02','P119L03','P120L01','P005L01','P005L02', 'P121L01','P121L02','P121L03','P121L04','P122L01','P123L01','P124L01','P125L01','P126L01','P127L01', 'P128L01','P128L02','P129L01','P130L01','LP131L01','LP016L01','LP132L01','P133L01','P134L01','P135L01', 'P136L01','P137L01','P138L01','P139L01','P140L01','P141L01','LP142L01','LP143L01','LP144L01','LP007L01', 'LP007L02','P040L01','P145L01','P145L02','P145L03','P145L04','P036L01','P008L01','P008L02','P008L03', 'P008L04','P008L05','P146L01','P041L01','P147L01','LP148L01','P024L01','P024L02','P024L03','P024L04', 'P024L05','P024L06','P024L07','P024L08','P024L09','P024L10','P024L11','P024L12','LP149L01','LP149L02', 'LP149L03','LP149L04','LP149L05','LP149L06','P017L01','P017L02','P017L03','P017L04','P017L05','P017L06', 'P017L07','P017L08','P017L09','P017L10','P017L11','P017L12','P017L13','P017L14','P017L15','P017L16',

  • 'P017L17','P017L18','P017L19','P017L20','P017L21','P017L22','P017L23','P017L24','P017L25','P017L26', 'LP150L01','LP150L02','LP150L03','LP150L04','LP150L05','LP150L06','LP150L07','LP150L08','LP150L09','LP150L10', 'LP150L11','LP150L12','LP150L13','P004L01','P004L02','P004L03','P004L04','P004L05','P004L06','P004L07', 'P004L08','P004L09','P004L10','P004L11','P004L12','P004L13','P004L14','P004L15','P004L16','LP151L01', 'LP151L02','LP151L03','LP151L04','LP151L05','LP151L06','LP151L07','P023L02','P023L03','P035L01','P035L02', 'P152L01','P152L02','P152L03','P014L01','P014L02','LP031L01','P037L01','P037L02','LP043L01','LP042L01', 'LP042L02','P012L01','P012L02','P002L01','P034L01','P034L02','P039L01','P039L02','P039L03','P039L04', 'P026L01','P019L01','P153L01','LP030L01','LP154L01','LP038L01','P025L01','LP155L01','LP155L02','LP156L01', 'LP156L02','P157L01','P157L02','LP158L01','P046L01'); count=0; DO i=1 TO 280; count=count+1; CALL SYMPUT('dpvar'||LEFT(PUT(count,3.)),colcd{i}); CALL SYMPUT('ipvar'||LEFT(PUT(count,3.)),colci{i}); END; run; %MEND namelist; /*** In running the stepwise regressions, this will sequentially use each measure one by one as the designated dependent variable while treating the remaining measures as independent variables, with the exception of each of the measures having the same proftbl as the designated dependent variable; */ %MACRO duloop(var1,num); data _null_; %GLOBAL depv; %LET depv=%SUBSTR(&var1,1,6); %LET cnt=0; %DO i=1 %TO 280; %LET c1=%SUBSTR(&&dpvar&i,1,6); %LET c2=&&ipvar&i; %IF (&c1 ne &depv) %THEN %DO; %LET cnt=%eval(&cnt+1); CALL SYMPUT('indvar'||LEFT(PUT(&cnt,4.)),"&c2"); %END; %END; %LET cnti=&cnt; CALL SYMPUT('cnti',put(&cnti,4.)); %stepreg;

  • %savcov; %setflag; run; %MEND duloop; /*** Perform stepwise regression to determine which of the independent variables should be included in a regression model ; */ %MACRO stepreg; data hold; array coln(506) LP033L02 LP033L03 LP033L04 LP033L05 LP033L06 LP028L01 LP028L02 LP028L03 LP028L04 LP028L05 LP028L06 LP028L07 LP013L02 LP013L04 LP013L06 LP013L07 LP013L10 LP001L06 LP001L02 LP001L03 LP001L04 LP001L05 LP102L01 LP003L01 LP003L02 LP003L03 LP103L01 LP103L02 LP103L03 LP009L01 LP009L02 LP009L03 LP045L01 LP045L02 LP045L03 LP045L04 LP022L01 LP022L02 LP022L03 LP022L04 LP022L05 LP104L01 LP105L01 LP106L01 LP107L01 LP107L02 LP107L03 LP107L04 LP107L05 LP107L06 LP108L01 LP108L02 LP108L03 LP108L04 LP108L05 LP108L06 LP108L07 LP108L08 LP109L01 LP110L01 LP029L01 LP111L01 LP011L01 LP011L02 LP011L03 LP015L03 LP015L04 LP015L05 LP015L06 LP015L07 LP015L08 LP015L09 LP015L10 LP015L11 LP021L01 LP021L02 LP112L01 LP010L01 LP010L02 LP032L01 LP032L02 LP032L03 LP032L04 LP032L05 LP113L01 LP114L01 LP044L01 LP044L02 LP020L04 LP115L01 LP116L01 LP116L02 LP116L03 LP116L04 LP116L05 LP116L06 LP116L07 LP027L01 LP027L02 LP027L03 LP117L01 LP118L01 LP119L01 LP119L02 LP119L03 LP120L01 LP005L01 LP005L02 LP121L01 LP121L02 LP121L03 LP121L04 LP122L01 LP123L01 LP124L01 LP125L01 LP126L01 LP127L01 LP128L01 LP128L02 LP129L01 LP130L01 LP133L01 LP134L01 LP135L01 LP136L01 LP137L01 LP138L01 LP139L01 LP140L01 LP141L01 LP040L01 LP145L01 LP145L02 LP145L03 LP145L04 LP036L01 LP008L01 LP008L02 LP008L03 LP008L04 LP008L05 LP146L01 LP041L01 LP147L01 LP024L01 LP024L02 LP024L03 LP024L04 LP024L05 LP024L06 LP024L07 LP024L08 LP024L09 LP024L10 LP024L11 LP024L12 LP017L01 LP017L02 LP017L03 LP017L04 LP017L05 LP017L06 LP017L07 LP017L08 LP017L09 LP017L10 LP017L11 LP017L12 LP017L13 LP017L14 LP017L15 LP017L16 LP017L17 LP017L18 LP017L19 LP017L20 LP017L21 LP017L22 LP017L23 LP017L24 LP017L25 LP017L26 LP004L01 LP004L02 LP004L03 LP004L04 LP004L05 LP004L06 LP004L07 LP004L08 LP004L09 LP004L10 LP004L11 LP004L12 LP004L13 LP004L14 LP004L15 LP004L16 LP023L02 LP023L03 LP035L01 LP035L02 LP152L01 LP152L02 LP152L03 LP014L01 LP014L02 LP037L01 LP037L02 LP012L01 LP012L02 LP002L01 LP034L01 LP034L02 LP039L01 LP039L02 LP039L03 LP039L04 LP026L01 LP019L01 LP153L01 LP025L01 LP157L01 LP157L02 LP046L01 P033L02 P033L03 P033L04 P033L05 P033L06 P028L01 P028L02 P028L03 P028L04 P028L05 P028L06 P028L07 P013L02 P013L04 P013L06 P013L07 P013L10 P001L06 P001L02 P001L03 P001L04 P001L05 P102L01 P003L01 P003L02 P003L03 P103L01 P103L02 P103L03 P009L01 P009L02 P009L03 P045L01 P045L02 P045L03 P045L04 P022L01 P022L02 P022L03 P022L04 P022L05 P104L01 P105L01 P106L01 P107L01 P107L02 P107L03 P107L04 P107L05 P107L06 P108L01 P108L02 P108L03 P108L04 P108L05 P108L06 P108L07 P108L08 P109L01 P110L01 P029L01 P111L01 P011L01 P011L02 P011L03 P015L03

  • P015L04 P015L05 P015L06 P015L07 P015L08 P015L09 P015L10 P015L11 P021L01 P021L02 P112L01 P010L01 P010L02 P032L01 P032L02 P032L03 P032L04 P032L05 P113L01 P114L01 P044L01 P044L02 P020L04 P115L01 P116L01 P116L02 P116L03 P116L04 P116L05 P116L06 P116L07 P027L01 P027L02 P027L03 P117L01 P118L01 P119L01 P119L02 P119L03 P120L01 P005L01 P005L02 P121L01 P121L02 P121L03 P121L04 P122L01 P123L01 P124L01 P125L01 P126L01 P127L01 P128L01 P128L02 P129L01 P130L01 P133L01 P134L01 P135L01 P136L01 P137L01 P138L01 P139L01 P140L01 P141L01 P040L01 P145L01 P145L02 P145L03 P145L04 P036L01 P008L01 P008L02 P008L03 P008L04 P008L05 P146L01 P041L01 P147L01 P024L01 P024L02 P024L03 P024L04 P024L05 P024L06 P024L07 P024L08 P024L09 P024L10 P024L11 P024L12 P017L01 P017L02 P017L03 P017L04 P017L05 P017L06 P017L07 P017L08 P017L09 P017L10 P017L11 P017L12 P017L13 P017L14 P017L15 P017L16 P017L17 P017L18 P017L19 P017L20 P017L21 P017L22 P017L23 P017L24 P017L25 P017L26 P004L01 P004L02 P004L03 P004L04 P004L05 P004L06 P004L07 P004L08 P004L09 P004L10 P004L11 P004L12 P004L13 P004L14 P004L15 P004L16 P023L02 P023L03 P035L01 P035L02 P152L01 P152L02 P152L03 P014L01 P014L02 P037L01 P037L02 P012L01 P012L02 P002L01 P034L01 P034L02 P039L01 P039L02 P039L03 P039L04 P026L01 P019L01 P153L01 P025L01 P157L01 P157L02 P046L01 LP033L01 LP101L01 LP018L01 LP029L02 LP029L03 LP015L01 LP015L02 LP131L01 LP016L01 LP132L01 LP142L01 LP143L01 LP144L01 LP007L01 LP007L02 LP148L01 LP149L01 LP149L02 LP149L03 LP149L04 LP149L05 LP149L06 LP150L01 LP150L02 LP150L03 LP150L04 LP150L05 LP150L06 LP150L07 LP150L08 LP150L09 LP150L10 LP150L11 LP150L12 LP150L13 LP151L01 LP151L02 LP151L03 LP151L04 LP151L05 LP151L06 LP151L07 LP031L01 LP043L01 LP042L01 LP042L02 LP030L01 LP154L01 LP038L01 LP155L01 LP155L02 LP156L01 LP156L02 LP158L01 ; array colc(506) $ ('LP033L02','LP033L03','LP033L04','LP033L05','LP033L06','LP028L01','LP028L02','LP028L03','LP028L04','LP028L05', 'LP028L06','LP028L07','LP013L02','LP013L04','LP013L06','LP013L07','LP013L10','LP001L06','LP001L02','LP001L03', 'LP001L04','LP001L05','LP102L01','LP003L01','LP003L02','LP003L03','LP103L01','LP103L02','LP103L03','LP009L01', 'LP009L02','LP009L03','LP045L01','LP045L02','LP045L03','LP045L04', 'LP022L01','LP022L02','LP022L03','LP022L04','LP022L05','LP104L01','LP105L01','LP106L01','LP107L01','LP107L02', 'LP107L03','LP107L04','LP107L05','LP107L06','LP108L01','LP108L02','LP108L03','LP108L04','LP108L05','LP108L06', 'LP108L07','LP108L08','LP109L01','LP110L01','LP029L01','LP111L01','LP011L01','LP011L02','LP011L03','LP015L03', 'LP015L04','LP015L05','LP015L06','LP015L07','LP015L08','LP015L09','LP015L10','LP015L11','LP021L01','LP021L02', 'LP112L01','LP010L01','LP010L02','LP032L01','LP032L02','LP032L03','LP032L04','LP032L05','LP113L01','LP114L01', 'LP044L01','LP044L02','LP020L04','LP115L01','LP116L01','LP116L02','LP116L03','LP116L04','LP116L05','LP116L06', 'LP116L07','LP027L01','LP027L02','LP027L03','LP117L01','LP118L01','LP119L01','LP119L02','LP119L03','LP120L01', 'LP005L01','LP005L02','LP121L01','LP121L02','LP121L03','LP121L04','LP122L01','LP123L01','LP124L01','LP125L01', 'LP126L01','LP127L01','LP128L01','LP128L02','LP129L01','LP130L01','LP133L01','LP134L01','LP135L01','LP136L01', 'LP137L01','LP138L01','LP139L01','LP140L01','LP141L01','LP040L01','LP145L01','LP145L02','LP145L03','LP145L04', 'LP036L01','LP008L01','LP008L02','LP008L03','LP008L04','LP008L05','LP146L01','LP041L01','LP147L01','LP024L01', 'LP024L02','LP024L03','LP024L04','LP024L05','LP024L06','LP024L07','LP024L08','LP024L09','LP024L10','LP024L11', 'LP024L12','LP017L01','LP017L02','LP017L03','LP017L04','LP017L05','LP017L06','LP017L07','LP017L08','LP017L09', 'LP017L10','LP017L11','LP017L12','LP017L13','LP017L14','LP017L15','LP017L16','LP017L17','LP017L18','LP017L19',

  • 'LP017L20','LP017L21','LP017L22','LP017L23','LP017L24','LP017L25','LP017L26','LP004L01','LP004L02','LP004L03', 'LP004L04','LP004L05','LP004L06','LP004L07','LP004L08','LP004L09','LP004L10','LP004L11','LP004L12','LP004L13', 'LP004L14','LP004L15','LP004L16','LP023L02','LP023L03','LP035L01','LP035L02','LP152L01','LP152L02','LP152L03', 'LP014L01','LP014L02','LP037L01','LP037L02','LP012L01','LP012L02','LP002L01','LP034L01','LP034L02','LP039L01', 'LP039L02','LP039L03','LP039L04','LP026L01','LP019L01','LP153L01','LP025L01','LP157L01','LP157L02','LP046L01', 'P033L02','P033L03','P033L04','P033L05','P033L06','P028L01','P028L02','P028L03','P028L04','P028L05', 'P028L06','P028L07','P013L02','P013L04','P013L06','P013L07','P013L10','P001L06','P001L02','P001L03', 'P001L04','P001L05','P102L01','P003L01','P003L02','P003L03','P103L01','P103L02','P103L03','P009L01', 'P009L02','P009L03','P045L01','P045L02','P045L03','P045L04', 'P022L01','P022L02','P022L03','P022L04','P022L05','P104L01','P105L01','P106L01','P107L01','P107L02', 'P107L03','P107L04','P107L05','P107L06','P108L01','P108L02','P108L03','P108L04','P108L05','P108L06', 'P108L07','P108L08','P109L01','P110L01','P029L01','P111L01','P011L01','P011L02','P011L03','P015L03', 'P015L04','P015L05','P015L06','P015L07','P015L08','P015L09','P015L10','P015L11','P021L01','P021L02', 'P112L01','P010L01','P010L02','P032L01','P032L02','P032L03','P032L04','P032L05','P113L01','P114L01', 'P044L01','P044L02','P020L04','P115L01','P116L01','P116L02','P116L03','P116L04','P116L05','P116L06', 'P116L07','P027L01','P027L02','P027L03','P117L01','P118L01','P119L01','P119L02','P119L03','P120L01', 'P005L01','P005L02','P121L01','P121L02','P121L03','P121L04','P122L01','P123L01','P124L01','P125L01', 'P126L01','P127L01','P128L01','P128L02','P129L01','P130L01','P133L01','P134L01','P135L01','P136L01', 'P137L01','P138L01','P139L01','P140L01','P141L01','P040L01','P145L01','P145L02','P145L03','P145L04', 'P036L01','P008L01','P008L02','P008L03','P008L04','P008L05','P146L01','P041L01','P147L01','P024L01', 'P024L02','P024L03','P024L04','P024L05','P024L06','P024L07','P024L08','P024L09','P024L10','P024L11', 'P024L12','P017L01','P017L02','P017L03','P017L04','P017L05','P017L06','P017L07','P017L08','P017L09', 'P017L10','P017L11','P017L12','P017L13','P017L14','P017L15','P017L16','P017L17','P017L18','P017L19', 'P017L20','P017L21','P017L22','P017L23','P017L24','P017L25','P017L26','P004L01','P004L02','P004L03', 'P004L04','P004L05','P004L06','P004L07','P004L08','P004L09','P004L10','P004L11','P004L12','P004L13', 'P004L14','P004L15','P004L16','P023L02','P023L03','P035L01','P035L02','P152L01','P152L02','P152L03', 'P014L01','P014L02','P037L01','P037L02','P012L01','P012L02','P002L01','P034L01','P034L02','P039L01', 'P039L02','P039L03','P039L04','P026L01','P019L01','P153L01','P025L01','P157L01','P157L02','P046L01', 'LP033L01','LP101L01','LP018L01','LP029L02','LP029L03','LP015L01','LP015L02','LP131L01','LP016L01', 'LP132L01','LP142L01','LP143L01','LP144L01','LP007L01','LP007L02','LP148L01','LP149L01','LP149L02','LP149L03', 'LP149L04','LP149L05','LP149L06','LP150L01','LP150L02','LP150L03','LP150L04','LP150L05','LP150L06','LP150L07', 'LP150L08','LP150L09','LP150L10','LP150L11','LP150L12','LP150L13','LP151L01','LP151L02','LP151L03','LP151L04', 'LP151L05','LP151L06','LP151L07','LP031L01','LP043L01','LP042L01','LP042L02','LP030L01','LP154L01','LP038L01', 'LP155L01','LP155L02','LP156L01','LP156L02','LP158L01' ); set dat1 ; run; proc reg data=corout edf outest=nreg.crout&var1 (drop=_type_ _model_); model &var1= %DO cnt=1 %TO &cnti;

  • &&indvar&cnt %END; /selection=stepwise sle=.10 sls=.05 noprint; run; %MEND stepreg; /*** Run the selected regression model to produced an output data set containing the parameter estimates and ccovariance matrix for each measure;*/ %MACRO savcov; data _null_; array coln(506) LP033L02 LP033L03 LP033L04 LP033L05 LP033L06 LP028L01 LP028L02 LP028L03 LP028L04 LP028L05 LP028L06 LP028L07 LP013L02 LP013L04 LP013L06 LP013L07 LP013L10 LP001L06 LP001L02 LP001L03 LP001L04 LP001L05 LP102L01 LP003L01 LP003L02 LP003L03 LP103L01 LP103L02 LP103L03 LP009L01 LP009L02 LP009L03 LP045L01 LP045L02 LP045L03 LP045L04 LP022L01 LP022L02 LP022L03 LP022L04 LP022L05 LP104L01 LP105L01 LP106L01 LP107L01 LP107L02 LP107L03 LP107L04 LP107L05 LP107L06 LP108L01 LP108L02 LP108L03 LP108L04 LP108L05 LP108L06 LP108L07 LP108L08 LP109L01 LP110L01 LP029L01 LP111L01 LP011L01 LP011L02 LP011L03 LP015L03 LP015L04 LP015L05 LP015L06 LP015L07 LP015L08 LP015L09 LP015L10 LP015L11 LP021L01 LP021L02 LP112L01 LP010L01 LP010L02 LP032L01 LP032L02 LP032L03 LP032L04 LP032L05 LP113L01 LP114L01 LP044L01 LP044L02 LP020L04 LP115L01 LP116L01 LP116L02 LP116L03 LP116L04 LP116L05 LP116L06 LP116L07 LP027L01 LP027L02 LP027L03 LP117L01 LP118L01 LP119L01 LP119L02 LP119L03 LP120L01 LP005L01 LP005L02 LP121L01 LP121L02 LP121L03 LP121L04 LP122L01 LP123L01 LP124L01 LP125L01 LP126L01 LP127L01 LP128L01 LP128L02 LP129L01 LP130L01 LP133L01 LP134L01 LP135L01 LP136L01 LP137L01 LP138L01 LP139L01 LP140L01 LP141L01 LP040L01 LP145L01 LP145L02 LP145L03 LP145L04 LP036L01 LP008L01 LP008L02 LP008L03 LP008L04 LP008L05 LP146L01 LP041L01 LP147L01 LP024L01 LP024L02 LP024L03 LP024L04 LP024L05 LP024L06 LP024L07 LP024L08 LP024L09 LP024L10 LP024L11 LP024L12 LP017L01 LP017L02 LP017L03 LP017L04 LP017L05 LP017L06 LP017L07 LP017L08 LP017L09 LP017L10 LP017L11 LP017L12 LP017L13 LP017L14 LP017L15 LP017L16 LP017L17 LP017L18 LP017L19 LP017L20 LP017L21 LP017L22 LP017L23 LP017L24 LP017L25 LP017L26 LP004L01 LP004L02 LP004L03 LP004L04 LP004L05 LP004L06 LP004L07 LP004L08 LP004L09 LP004L10 LP004L11 LP004L12 LP004L13 LP004L14 LP004L15 LP004L16 LP023L02 LP023L03 LP035L01 LP035L02 LP152L01 LP152L02 LP152L03 LP014L01 LP014L02 LP037L01 LP037L02 LP012L01 LP012L02 LP002L01 LP034L01 LP034L02 LP039L01 LP039L02 LP039L03 LP039L04 LP026L01 LP019L01 LP153L01 LP025L01 LP157L01 LP157L02 LP046L01 P033L02 P033L03 P033L04 P033L05 P033L06 P028L01 P028L02 P028L03 P028L04 P028L05 P028L06 P028L07 P013L02 P013L04 P013L06 P013L07 P013L10 P001L06 P001L02 P001L03 P001L04 P001L05 P102L01 P003L01 P003L02 P003L03 P103L01 P103L02 P103L03 P009L01 P009L02 P009L03 P045L01 P045L02 P045L03 P045L04 P022L01 P022L02 P022L03 P022L04 P022L05 P104L01 P105L01 P106L01 P107L01 P107L02

  • P107L03 P107L04 P107L05 P107L06 P108L01 P108L02 P108L03 P108L04 P108L05 P108L06 P108L07 P108L08 P109L01 P110L01 P029L01 P111L01 P011L01 P011L02 P011L03 P015L03 P015L04 P015L05 P015L06 P015L07 P015L08 P015L09 P015L10 P015L11 P021L01 P021L02 P112L01 P010L01 P010L02 P032L01 P032L02 P032L03 P032L04 P032L05 P113L01 P114L01 P044L01 P044L02 P020L04 P115L01 P116L01 P116L02 P116L03 P116L04 P116L05 P116L06 P116L07 P027L01 P027L02 P027L03 P117L01 P118L01 P119L01 P119L02 P119L03 P120L01 P005L01 P005L02 P121L01 P121L02 P121L03 P121L04 P122L01 P123L01 P124L01 P125L01 P126L01 P127L01 P128L01 P128L02 P129L01 P130L01 P133L01 P134L01 P135L01 P136L01 P137L01 P138L01 P139L01 P140L01 P141L01 P040L01 P145L01 P145L02 P145L03 P145L04 P036L01 P008L01 P008L02 P008L03 P008L04 P008L05 P146L01 P041L01 P147L01 P024L01 P024L02 P024L03 P024L04 P024L05 P024L06 P024L07 P024L08 P024L09 P024L10 P024L11 P024L12 P017L01 P017L02 P017L03 P017L04 P017L05 P017L06 P017L07 P017L08 P017L09 P017L10 P017L11 P017L12 P017L13 P017L14 P017L15 P017L16 P017L17 P017L18 P017L19 P017L20 P017L21 P017L22 P017L23 P017L24 P017L25 P017L26 P004L01 P004L02 P004L03 P004L04 P004L05 P004L06 P004L07 P004L08 P004L09 P004L10 P004L11 P004L12 P004L13 P004L14 P004L15 P004L16 P023L02 P023L03 P035L01 P035L02 P152L01 P152L02 P152L03 P014L01 P014L02 P037L01 P037L02 P012L01 P012L02 P002L01 P034L01 P034L02 P039L01 P039L02 P039L03 P039L04 P026L01 P019L01 P153L01 P025L01 P157L01 P157L02 P046L01 LP033L01 LP101L01 LP018L01 LP029L02 LP029L03 LP015L01 LP015L02 LP131L01 LP016L01 LP132L01 LP142L01 LP143L01 LP144L01 LP007L01 LP007L02 LP148L01 LP149L01 LP149L02 LP149L03 LP149L04 LP149L05 LP149L06 LP150L01 LP150L02 LP150L03 LP150L04 LP150L05 LP150L06 LP150L07 LP150L08 LP150L09 LP150L10 LP150L11 LP150L12 LP150L13 LP151L01 LP151L02 LP151L03 LP151L04 LP151L05 LP151L06 LP151L07 LP031L01 LP043L01 LP042L01 LP042L02 LP030L01 LP154L01 LP038L01 LP155L01 LP155L02 LP156L01 LP156L02 LP158L01 ; array colc(506) $ ('LP033L02','LP033L03','LP033L04','LP033L05','LP033L06','LP028L01','LP028L02','LP028L03','LP028L04','LP028L05', 'LP028L06','LP028L07','LP013L02','LP013L04','LP013L06','LP013L07','LP013L10','LP001L06','LP001L02','LP001L03', 'LP001L04','LP001L05','LP102L01','LP003L01','LP003L02','LP003L03','LP103L01','LP103L02','LP103L03','LP009L01', 'LP009L02','LP009L03','LP045L01','LP045L02','LP045L03','LP045L04', 'LP022L01','LP022L02','LP022L03','LP022L04','LP022L05','LP104L01','LP105L01','LP106L01','LP107L01','LP107L02', 'LP107L03','LP107L04','LP107L05','LP107L06','LP108L01','LP108L02','LP108L03','LP108L04','LP108L05','LP108L06', 'LP108L07','LP108L08','LP109L01','LP110L01','LP029L01','LP111L01','LP011L01','LP011L02','LP011L03','LP015L03', 'LP015L04','LP015L05','LP015L06','LP015L07','LP015L08','LP015L09','LP015L10','LP015L11','LP021L01','LP021L02', 'LP112L01','LP010L01','LP010L02','LP032L01','LP032L02','LP032L03','LP032L04','LP032L05','LP113L01','LP114L01', 'LP044L01','LP044L02','LP020L04','LP115L01','LP116L01','LP116L02','LP116L03','LP116L04','LP116L05','LP116L06', 'LP116L07','LP027L01','LP027L02','LP027L03','LP117L01','LP118L01','LP119L01','LP119L02','LP119L03','LP120L01', 'LP005L01','LP005L02','LP121L01','LP121L02','LP121L03','LP121L04','LP122L01','LP123L01','LP124L01','LP125L01', 'LP126L01','LP127L01','LP128L01','LP128L02','LP129L01','LP130L01','LP133L01','LP134L01','LP135L01','LP136L01', 'LP137L01','LP138L01','LP139L01','LP140L01','LP141L01','LP040L01','LP145L01','LP145L02','LP145L03','LP145L04', 'LP036L01','LP008L01','LP008L02','LP008L03','LP008L04','LP008L05','LP146L01','LP041L01','LP147L01','LP024L01', 'LP024L02','LP024L03','LP024L04','LP024L05','LP024L06','LP024L07','LP024L08','LP024L09','LP024L10','LP024L11',

  • 'LP024L12','LP017L01','LP017L02','LP017L03','LP017L04','LP017L05','LP017L06','LP017L07','LP017L08','LP017L09', 'LP017L10','LP017L11','LP017L12','LP017L13','LP017L14','LP017L15','LP017L16','LP017L17','LP017L18','LP017L19', 'LP017L20','LP017L21','LP017L22','LP017L23','LP017L24','LP017L25','LP017L26','LP004L01','LP004L02','LP004L03', 'LP004L04','LP004L05','LP004L06','LP004L07','LP004L08','LP004L09','LP004L10','LP004L11','LP004L12','LP004L13', 'LP004L14','LP004L15','LP004L16','LP023L02','LP023L03','LP035L01','LP035L02','LP152L01','LP152L02','LP152L03', 'LP014L01','LP014L02','LP037L01','LP037L02','LP012L01','LP012L02','LP002L01','LP034L01','LP034L02','LP039L01', 'LP039L02','LP039L03','LP039L04','LP026L01','LP019L01','LP153L01','LP025L01','LP157L01','LP157L02','LP046L01', 'P033L02','P033L03','P033L04','P033L05','P033L06','P028L01','P028L02','P028L03','P028L04','P028L05', 'P028L06','P028L07','P013L02','P013L04','P013L06','P013L07','P013L10','P001L06','P001L02','P001L03', 'P001L04','P001L05','P102L01','P003L01','P003L02','P003L03','P103L01','P103L02','P103L03','P009L01', 'P009L02','P009L03','P045L01','P045L02','P045L03','P045L04', 'P022L01','P022L02','P022L03','P022L04','P022L05','P104L01','P105L01','P106L01','P107L01','P107L02', 'P107L03','P107L04','P107L05','P107L06','P108L01','P108L02','P108L03','P108L04','P108L05','P108L06', 'P108L07','P108L08','P109L01','P110L01','P029L01','P111L01','P011L01','P011L02','P011L03','P015L03', 'P015L04','P015L05','P015L06','P015L07','P015L08','P015L09','P015L10','P015L11','P021L01','P021L02', 'P112L01','P010L01','P010L02','P032L01','P032L02','P032L03','P032L04','P032L05','P113L01','P114L01', 'P044L01','P044L02','P020L04','P115L01','P116L01','P116L02','P116L03','P116L04','P116L05','P116L06', 'P116L07','P027L01','P027L02','P027L03','P117L01','P118L01','P119L01','P119L02','P119L03','P120L01', 'P005L01','P005L02','P121L01','P121L02','P121L03','P121L04','P122L01','P123L01','P124L01','P125L01', 'P126L01','P127L01','P128L01','P128L02','P129L01','P130L01','P133L01','P134L01','P135L01','P136L01', 'P137L01','P138L01','P139L01','P140L01','P141L01','P040L01','P145L01','P145L02','P145L03','P145L04', 'P036L01','P008L01','P008L02','P008L03','P008L04','P008L05','P146L01','P041L01','P147L01','P024L01', 'P024L02','P024L03','P024L04','P024L05','P024L06','P024L07','P024L08','P024L09','P024L10','P024L11', 'P024L12','P017L01','P017L02','P017L03','P017L04','P017L05','P017L06','P017L07','P017L08','P017L09', 'P017L10','P017L11','P017L12','P017L13','P017L14','P017L15','P017L16','P017L17','P017L18','P017L19', 'P017L20','P017L21','P017L22','P017L23','P017L24','P017L25','P017L26','P004L01','P004L02','P004L03', 'P004L04','P004L05','P004L06','P004L07','P004L08','P004L09','P004L10','P004L11','P004L12','P004L13', 'P004L14','P004L15','P004L16','P023L02','P023L03','P035L01','P035L02','P152L01','P152L02','P152L03', 'P014L01','P014L02','P037L01','P037L02','P012L01','P012L02','P002L01','P034L01','P034L02','P039L01', 'P039L02','P039L03','P039L04','P026L01','P019L01','P153L01','P025L01','P157L01','P157L02','P046L01', 'LP033L01','LP101L01','LP018L01','LP029L02','LP029L03','LP015L01','LP015L02','LP131L01','LP016L01', 'LP132L01','LP142L01','LP143L01','LP144L01','LP007L01','LP007L02','LP148L01','LP149L01','LP149L02','LP149L03', 'LP149L04','LP149L05','LP149L06','LP150L01','LP150L02','LP150L03','LP150L04','LP150L05','LP150L06','LP150L07', 'LP150L08','LP150L09','LP150L10','LP150L11','LP150L12','LP150L13','LP151L01','LP151L02','LP151L03','LP151L04', 'LP151L05','LP151L06','LP151L07','LP031L01','LP043L01','LP042L01','LP042L02','LP030L01','LP154L01','LP038L01', 'LP155L01','LP155L02','LP156L01','LP156L02','LP158L01' ); set nreg.crout&var1; nindp=_in_; CALL SYMPUT('nidep',nindp); count=0;

  • DO i=1 TO 506; IF (coln{i} NOT in (.,-1)) THEN DO; count=count+1; CALL SYMPUT('cvar'||LEFT(PUT(count,3.)),colc{i}); END; END; run; data dat3; set hold; keep &var1 geoid; run; data tmp; set hold; %DO ct=1 %TO &nidep; if (&&cvar&ct eq . ) then delete; keep &&cvar&ct &var1 geoid; %END; run; data dat2; set tmp; drop &var1; run; proc reg data=corout outest=nreg.cov&var1 covout; model &var1= %DO count=1 %TO &nidep; &&cvar&count %END; /noprint; run; %MEND savcov; *** Calculate predicted values and the confidence limits,then set flags for each measure; %MACRO setflag; data cov(drop=_model_ _type_ _name_ _depvar_ _rmse_ &var1); set nreg.cov&var1(firstobs=2); run; data est(drop=_model_ _type_ _name_ _depvar_ _rmse_ &var1 ) rsq(keep=_rmse_);

  • set nreg.cov&var1(obs=1); run; proc iml; use dat2; read all var _num_ into x1; read all var {geoid} into geoid; use cov; read all var _num_ into c; use est; read all var _num_ into b; use rsq; read all var {_rmse_} into r1; nr=nrow(x1); r2=r1*r1; r=j(nr,1,r2); x=j(nr,1,1)||x1; pred=x*t(b); var=vecdiag(x*c*t(x)); se=sqrt(var+r2); cfv=1.96#se; lbpred=pred-cfv; ubpred=pred+cfv; create ling1 var {pred se lbpred ubpred geoid}; append; close ling1; *** Output flags for each measure; data nreg.covo&var1(keep=geoid flag&var1); merge ling1(in=a) dat3(in=b); by geoid; if b & not a then do; pred=.; se=.; ubpred=.; lbpred=.; end; flag&var1=0; if ubpred ne lbpred then do; if &var1 > ubpred then flag&var1=1; if &var1 < lbpred then flag&var1=1;

  • end; run; %MEND setflag; %MACRO runregflag; %namelist; %DO k=1 %TO 280; %duloop(&&dpvar&k,&k); %END; %MEND runregflag; %runregflag;

    julie computing_report[2] lw5b body only.pdfAppendices 1