Example: air traffic controller

SUGI 23: Robust Standard Error Estimate for Cluster ...

1 Robust Standard Error Estimate for Cluster Sampling Data:A SAS/IML Macro Procedure for Logistic Regression with HuberizationHonghu Liu, Department of Medicine, UCLA, Los Angeles, CaliforniaABSTRACTData sets with Cluster structure are very common inpractical business and research, one has to take intoaccount the intra- Cluster correlation in data paper systematically discusses the Huber/Whitestandard Error Estimate for Cluster sampling data inlogistic regression, and presents a user-friendlySAS/IML macro procedure which canautomatically fit logistic model, calculate robuststandard errors and produce confidence intervals forodds ratio. The Robust Standard Error calculated inthis procedure also has a finite sample-adjustmentfeature which is now available in most updatedversion of some statistical software. The syntax forthe procedure is simple and easy. One data exampleis shown to illustrate how to actually use theprocedures.

1 Robust Standard Error Estimate for Cluster Sampling Data: A SAS/IML Macro Procedure for Logistic Regression with Huberization Honghu Liu, Department of Medicine ...

Tags:

  Standards, Robust, Robust standard

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of SUGI 23: Robust Standard Error Estimate for Cluster ...

1 1 Robust Standard Error Estimate for Cluster Sampling Data:A SAS/IML Macro Procedure for Logistic Regression with HuberizationHonghu Liu, Department of Medicine, UCLA, Los Angeles, CaliforniaABSTRACTData sets with Cluster structure are very common inpractical business and research, one has to take intoaccount the intra- Cluster correlation in data paper systematically discusses the Huber/Whitestandard Error Estimate for Cluster sampling data inlogistic regression, and presents a user-friendlySAS/IML macro procedure which canautomatically fit logistic model, calculate robuststandard errors and produce confidence intervals forodds ratio. The Robust Standard Error calculated inthis procedure also has a finite sample-adjustmentfeature which is now available in most updatedversion of some statistical software. The syntax forthe procedure is simple and easy. One data exampleis shown to illustrate how to actually use theprocedures.

2 The SAS system products included inthis work are SAS , SAS/STAT and SAS/IML .This procedure can be run on any IBM compatiblepersonal computer, MVS/UNIX system and anyother computer platforms with a working SAS often encounter data set with Cluster example, subjects collected from different citiesor hospitals are nested within cities or within city or hospital more likely havesimilar characteristics. These kind of data have intra-city or intra-hospital correlations embedded in thedata structure, which have to be taken into account inparameter work discusses the Huber method, also knownas White or Sandwich method, of Robust standarderror Estimate for Cluster sampling data in logisticmodeling. A user friendly SAS/IML macroprocedure is introduced, which can automatically fitlogistic regression model, calculate Robust standarderror for parameter estimates, test statisticalsignificance of parameter estimates as well asproduce confidence intervals for adjusted odds ratiofrom the fitted real data example is given to demonstrate in detailshow to exactly use the procedures in data SAS products to support this macro procedureinclude SAS , SAS/STAT and SAS/IML.

3 Thismacro procedure can be run on any IBM compatiblepersonal computer, SUN station, MVS/ UNIX system and any other computer platforms with aworking SAS S Robust Standard ERRORESTIMATEThe traditional Standard Error estimates for logisticregression models based on maximum likelihood fromindependent observations is no longer proper for datasets with Cluster structure since observations in thesame clusters tend to have similar characteristics andare more likely correlated each other. Robuststandard Error estimates are needed to take intoaccount of the intra- Cluster correlation. Huber (1967)has proposed a formula, which is a theoretical(asymptotic) bootstrap or jackknife, for calculatingrobust Standard errors if there is heteroscedasticity,clustered us denote peeixxii= 1 i=1,..nbe the probability of an event, wherexi is thecovariates associated with the event probabilityand is the regression fxlxiii= = = log( ())log(())()i=1.

4 ,n. be the log likelihood, then define scorefunction to bePostersPosters2 SLxii= ()()and the Hessian be HLxji= 22()for the ith observation, i=1,.., that we drop the ith observation from themodel, then the estimates would shift by the amountof DSxiiT1 where the matrix DHxxiiTii= ().We assume that no single observation has very largeeffect in the fitting, then the effect of dropping twoobservations is roughly the sum of the effect ofdropping each observation individually. The sametoken is true for observations from a Cluster ,dropping all the members of a group is roughlyequivalent to the sum of dropping each member inturn. By Huber s formula, the Robust standardvariance Estimate is: VarDS x x S DiiTiii()() = 11. (1)we can see from the physical appearance of the aboveformula that why people also name the Estimate as Sandwich Estimates.

5 For logistic model, we can, after some algebra, showthat the score is SLxypiiii== ()() and the Hessian is HLxppjiii== 221()().Then plug into (1), we have Varppx xiiiTii() ( ( ()())) = 11 *(()())ypxxypiiiTiiii . *(( ()()))ppxxiiiTii11 .Suppose that we have C clusters (each Cluster hasgj observations, j=1,..,C), and each Cluster isindependent with other clusters. Then the robuststandard Error is VarDU U DjTjj()~()~ = 11. (2)where ~()DHxxjkkgjCjkTjkj=== 11 UxSjjkjkkgj== 1, j=1,..,C., the contribution to score from each clusterFor data with weights, we will have XXT, XyTand yyT replaced by XWXT,XWyT and yWyT,where W is a diagonal matrix whose diagonalelements are the elements of w, the vector the Robust Standard Error Estimate is based onsample data, a finite sample correction is necessary toadjust the estimates more closer to the populationvalue.

6 There are two popular adjustment, one is theregression-like formula (Fuller et al. 1986), qNNpCCc= 111()*where N is the number of total observations andpis the number of predictors in the model (withoutcounting the constant 1 for intercept) and C is thenumber of clusters in the data. The secondadjustment is the asymptotic-like formula: qCCc= data set with very large number of observations,the effect of these two adjustment are about the into account the finite sample correction, theformula for the Huber Robust variance is: Varq DU U DcjTjj()~()~ = SAS/IML MACRO PROCEDUREThis SAS macro procedure for calculating Huberrobust Standard Error in logistic model is written bySAS , SAS/STAT and SAS/IML . The procedurecalls the SAS PROC LOGIT in the program anduses it to produce coefficient estimates for logisticregression (these coefficient estimates are stillconsistent even with Cluster data structure).

7 Intermediate values needed to conduct the calculationof Robust Standard errors such as the total number ofobservations, the number of clusters, the number ofpredictors, a character string containing all thePostersPosters3independent and dependent variable names withcomma as delimitations, and some datamanipulations such as to get rid of all theobservations with missing values on either dependentor independent variables are calculated or conductedby using macro language in SAS . The core part ofthe calculation for Robust Standard errors is carriedout by using SAS/IML .To have a closer look into the macro procedure, let ustake a piece. As an example, let us look at the partwhich creates a macro variable named NP containingthe number of predictors and the macro variablenamed XYM containing all the predictors and thedependent variable with comma as delimitation, thecode is %macro npm; %global np xym; %let np=1; %let xm=; %let xs=; %let xn=&x; %do %until( %let xs=%scan(&xn,1,' '); %if &np=1 %then %let xm= %else %let xm=&xm%str(,) %let np=%eval( %let l=%eval(%length( %if &xs=&xn %then %goto done; %let xn=%substr( %end; %done: %let xym=&y%str(,) %mend npm.)))))

8 At beginning of the procedure, the working data setcontaining the dependent variable, all the independentvariables, Cluster id and weights, if any, is identifiedby the data set name parameter entered through themacro procedure syntax or by the system variable_last_ if no data set name entered (using the defaultvalue, , the last active data set). Then, theprocedure automatically calculate those intermediateparameters needed in later calculation, such as thetotal number of observations, the number of clustersand number of predictors (see the above macrocode). These intermediate parameters are not askedfrom user, but rather computed directly from thegiven data in the effort trying to make the proceduresyntax more user-friendly. The number of predictorswhich is used later to determine the matricesdimension in the core calculation and the characterstring of all independent variables and dependentvariable names are obtained through macro variableoperation with quoting features (see the above macrocode).

9 The macro code for this part can work on anylength of variable listing with spaces in between. Thecode scans over the variable string each time, andfind the first blank, then gets the sub-string of avariable name (from the first character up to rightbefore the first blank). This part of code itself is aninternal sub-macro procedure and it operates data set with no missing values on the dependentvariable and all the independent variables is createdfor all the calculation activities in the SAS PROC LOGIST only uses theobservations without any missing values on bothdependent and all independent variables in itscomputation, a data set without any missing valueshas to be created to ensure that all the calculationsfor the Robust Standard errors and the coefficientsparameter estimates are both based on the calculation of the Robust Standard Error is basedon the Huber s formula (see section II). The Scoreand Hessian values for each observation are createdright after the invoking of PROC finite-sample adjustment in the procedure isbased on Fuller s method which takes into accountthe number of observations, the number of clustersand the number of independent variables.

10 If weight isused in coefficient parameter estimation, thenprobability weights is used in Robust Standard errorcalculation. There are five levels of choices forconfidence intervals of odds ratio, they are 80%,85%, 90%, 95% and 99%. These confidenceintervals are calculated based on asymptoticallynormal outputs of this procedure include logistic modelfitting information, parameter estimations, robuststandard errors, testing statistics and p-value of theparameter testing results based on Robust standarderrors, and also confidence intervals of odds is a program heading at the beginning of theprocedure code in which a description of thePostersPosters4procedure and the required syntax has beendescribed. The required syntax for the procedure is: %hlogist(x_list,y,cluster_id,wt,ci,datas et);where x_list is the list of all the independent variables with space in between. y is the dependent variable.


Related search queries