SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 36068: Incorrect standard errors when format reorders CLASS levels in PROC SURVEYREG

DetailsAboutRate It

If a format is specified that changes the internal order of levels of a CLASS variable in PROC SURVEYREG and either METHOD=JK or METHOD=BRR is specified, then the standard errors for estimated regression coefficients obtained with the SOLUTION option on the MODEL statement will be incorrect for the intercept and the reordered class variable.

For example, suppose the variable GENDER in the following code has the values 1 and 2, where 1 is for Male and 2 is for Female:

proc surveyreg data=dset method=jk;
  class gender;
  model y=gender / solution;
run;

Since PROC SURVEYREG uses the GLM parameterization and sets the last level as the reference level, the reference level for GENDER will be 2 or Female. If you want 1 or Male to be the reference level instead, you would typically use a custom format such as this:

proc format;
  value genderfmt 1='Male' 2='Female';
run;

The order for character values is alphabetical, so by applying this format the class level order changes. In the following code, Female is now first and the reference level is Male.

proc surveyreg data= dset method=jk;
  format gender genderfmt.;
  class gender;
  model y=gender / solution;
run;

This, however, results in incorrect standard errors for the Intercept and GENDER parameter estimates.

To circumvent the problem, create a new variable with the custom format and use the new variable in the model. For example:

data dset;
  set dset;
  group=put(gender, genderfmt.);
run;
proc surveyreg data= dset method=jk;
  class group;
  model y=group / solution;
run;


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/STATz/OS9.2 TS1M09.2 TS2M3
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft Windows XP 64-bit Edition9.2 TS1M09.2 TS2M3
Microsoft® Windows® for x649.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Datacenter Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Enterprise Edition9.2 TS1M09.2 TS2M3
Microsoft Windows Server 2003 Standard Edition9.2 TS1M09.2 TS2M3
Microsoft Windows XP Professional9.2 TS1M09.2 TS2M3
Windows Vista9.2 TS1M09.2 TS2M3
64-bit Enabled AIX9.2 TS1M09.2 TS2M3
64-bit Enabled HP-UX9.2 TS1M09.2 TS2M3
64-bit Enabled Solaris9.2 TS1M09.2 TS2M3
HP-UX IPF9.2 TS1M09.2 TS2M3
Linux9.2 TS1M09.2 TS2M3
Linux for x649.2 TS1M09.2 TS2M3
OpenVMS on HP Integrity9.2 TS1M09.2 TS2M3
Solaris for x649.2 TS1M09.2 TS2M3
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.