![]() | ![]() | ![]() |
If you specify a character SUBJECT= variable in the RANDOM statement in PROC QLIM, the following error message is issued in the log:
PROC QLIM proceeds, but the RANDOM statement is ignored.
To avoid this problem, use a numeric SUBJECT= variable. You can convert your character SUBJECT= variable to a numeric variable before running PROC QLIM.
If the character variable contains only numbers, use the INPUT function for the conversion. For an example, see SAS Note 24590, "Convert variable values from character to numeric or from numeric to character."
If the character variable contains characters, you can use either one of the following two methods to convert the character variable to a numeric variable. Following is an example demonstrating the two methods.
The following DATA step reads in the data. The ID variable is a character variable with character values 'A', 'B', 'C'. This variable is the SUBJECT = variable in PROC QLIM.
Method 1: Creating a numeric variable using a DATA step
First sort the data by the character variable ID:
The following DATA step creates a numeric variable IDNUM, such that each unique number corresponds to one unique value of the character variable ID. With the BY statement, the FIRST.ID identifies the first observation within each ID, and the IDNUM variable is increased by 1 each time a new ID is encountered.
The PROC PRINT step displays the resulting data set.
You can then specify SUBJECT=IDNUM in the RANDOM statement in PROC QLIM.
Method 2: Creating a numeric variable by applying a custom format
First, run the FREQ procedure to create a data set containing a list of the unique ID values:
Create a CNTLIN= data set for PROC FORMAT:
Use PROC FORMAT to create a custom format that associates a unique integer with each level of the character variable:
Apply the format to create the numeric variable IDNUM:
The PROC PRINT step displays the resulting data set.
Finally, specify SUBJECT=IDNUM in the RANDOM statement in PROC QLIM.
| Product Family | Product | System | Product Release | SAS Release | ||
| Reported | Fixed* | Reported | Fixed* | |||
| SAS System | SAS/ETS | Solaris for x64 | 14.1 | 9.4 TS1M3 | ||
| Linux for x64 | 14.1 | 9.4 TS1M3 | ||||
| HP-UX IPF | 14.1 | 9.4 TS1M3 | ||||
| 64-bit Enabled Solaris | 14.1 | 9.4 TS1M3 | ||||
| 64-bit Enabled AIX | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Ultimate x64 | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Ultimate 32 bit | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Professional x64 | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Professional 32 bit | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Home Premium x64 | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Home Premium 32 bit | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Enterprise x64 | 14.1 | 9.4 TS1M3 | ||||
| Windows 7 Enterprise 32 bit | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2012 Std | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2012 R2 Std | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2012 R2 Datacenter | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2012 Datacenter | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2008 for x64 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2008 R2 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows Server 2008 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 10 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8.1 Pro x64 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8.1 Pro 32-bit | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8.1 Enterprise x64 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8.1 Enterprise 32-bit | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8 Pro x64 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8 Pro 32-bit | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8 Enterprise x64 | 14.1 | 9.4 TS1M3 | ||||
| Microsoft Windows 8 Enterprise 32-bit | 14.1 | 9.4 TS1M3 | ||||
| Microsoft® Windows® for x64 | 14.1 | 9.4 TS1M3 | ||||
| z/OS 64-bit | 14.1 | 9.4 TS1M3 | ||||
| z/OS | 14.1 | 9.4 TS1M3 | ||||
| Type: | Problem Note |
| Priority: | high |
| Topic: | Analytics ==> Econometrics Analytics ==> Regression SAS Reference ==> Procedures ==> QLIM |
| Date Modified: | 2021-06-08 13:48:09 |
| Date Created: | 2021-04-15 16:19:53 |


