|
CODE DEXName:
If your factor variables are in original units of the data rather than classical units, you can use the CODE DEX command to convert them to classical units. This command should only be used if your data has 2 or 3 distinct values. If you have more than 3 distinct values, and error message will be generated and the coded variable will not be created. If you have only one unique value, the code variable will set all values to +1.
where <z> is the factor variable; <x> is a variable where the coded values are saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
If you want to have variables in the original units for some purposes, you can save the data in original units before using the CODE DEX command. For example
LET Z^J = X^J LET X^J = CODE DEX Z^J END OF LOOP
SKIP 50 READ CLAYTILE.DAT Y X1 TO X7 LOOP FOR J = 1 1 7 LET X^J = CODE DEX X^J END OF LOOP . SET WRITE DECIMALS 0 PRINT Y X1 X2 X3 X4 X5 X6 X7The following output is generated. ------------------------------------------------------------ Y X1 X2 X3 ------------------------------------------------------------ 16 -1 -1 -1 17 -1 -1 -1 12 -1 1 1 6 -1 1 1 6 1 -1 1 68 1 -1 1 42 1 1 -1 26 1 1 -1 ------------------------------------------------------------ X4 X5 X6 X7 ------------------------------------------------------------ -1 -1 -1 -1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 -1 1 -1 -1 1
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 04/04/2018 |