Manually Changing the Types of Output Variables
Previous Topic  Next Topic 

In most cases it is appropriate let Stat/Transfer automatically optimize your variables and to accept the output type that Stat/Transfer chooses.  However, there may be times when you wish to specify the output types for some variables.


Changing Target Output Types

The Variables dialog box displays a list of all of the variables in the input data set.  When the input file is opened, Stat/Transfer assigns target output types based on information in the data file dictionary and displays them next to the list of variables.  These will not be the final target output type assigned by Stat/Transfer. The final output type will be assigned automatically during the optimization pass.


You can change the output variable types by using the Optimize button on the right side of the Variables dialog box after you have selected all of the variables that you wish to transfer.


When you press the Optimize button, the optimization step will take place before the data are transferred.  After the optimization step, you can examine the target types that Stat/Transfer has chosen for your variables  and change any that are not appropriate.


After you press the Optimize button, to see the final target output type, choose one of the variables in the list box on the left and the output type automatically assigned by Stat/Transfer will be displayed on the buttons on the right.


If you wish to change the output type for a particular variable, simply click on the new type you want to assign to that variable.


Quick Variable Type Changer

This feature is useful when you want to change the type of a number of variables, where the new type is the same for all.  The Quick Type Changer dialog box enables you to specify selection criteria for the variables.  This is considerably less tedious for long lists of variables than manually changing each one.


Selection conditions are entered in the same way as in the Quick Variable Selector box.  They can take the form of the wildcard characters '*' or '?' or you can use variable ranges.  The question mark matches exactly one character, while the asterisk matches more than one.  Unlike standard wildcards, more than one asterisk can be included in a specification.  For instance: '*inc*' will match any variable with the string 'inc' in any position.  Ranges of contiguous variables can be specified with a dash (without spaces) between two variable names.  For instance 'distance-a9' will select (or drop) variables 'distance' through 'a9', inclusive.


Space or comma delimited lists of conditions can be entered at one time.  For example:


        factor1,cluster,a2-a10,L1*


will select the variables 'factor1', 'cluster', 'a2' through 'a10', and any variable which starts with the string 'l1'.  The output type for these variables is specified from the drop down menu below the line specifying the variables.


If needed, you can successively refine your selection by entering conditions and then clicking on either the Drop or Keep buttons, or, alternatively, by manually checking or unchecking variables in the list box.


Automatic optimization will, of course, not take place during your transfer when you have used the Optimize button.



Limitations on Changing Output Variable Types

Output variable types can be changed freely for ASCII files and worksheet files.  For all other file formats, you can change freely among the numeric types of 'byte', 'integer', 'long', 'float' and 'double' and you can change among the time types. However, conversions between any of the numeric types and dates or strings are not supported.


You should be careful not to choose a smaller type than that chosen by Stat/Transfer unless you are sure you know more about your data than Stat/Transfer does.


Remember that you are selecting a "target" type.  If the output data format does not support the specific type you have selected, then Stat/Transfer will use the best match to the type you have selected.


You can determine the output variable types supported for each output file type by consulting the table given in the topic describing that file format.



Handling Mixed Data

If you have mixed data in which some variables need doubles and others do not (for example, you might have precisely measured dollar amounts, which should be in doubles, along with scales of survey items, which should be in floats) you should press the Optimize button in order to designate integers for the right variables and then designate floats and doubles to reflect the appropriate level of measurement for each variable.