+ All Categories
Home > Education > 4. chapter iv(transform)

4. chapter iv(transform)

Date post: 22-Jan-2018
Category:
Upload: chhom-karath
View: 121 times
Download: 0 times
Share this document with a friend
27
Transform
Transcript
Page 1: 4. chapter iv(transform)

Transform

Page 2: 4. chapter iv(transform)

Computing Variables• Use the Compute dialog box to compute values for a variable based on

numeric transformations of other variables.

– You can compute values for numeric or string (alphanumeric) variables.

– You can create new variables or replace the values of existing variables. For new variables, you can also specify the variable type and label.

– You can compute values selectively for subsets of data based on logical conditions.

– You can use a large variety of built-in functions, including arithmetic functions, statistical functions, distribution functions, and string functions.

Page 3: 4. chapter iv(transform)

To Compute Variables

• From the menus choose:

– Transform > Compute Variable...

– Type the name of a single target variable. It can be an existing variable or a new variable to be added to the active dataset.

– To build an expression, either paste components into the Expression field or type directly in the Expression field.

– You can paste functions or commonly used system variables by selecting a group from the Function group list and double-clicking the function or variable in the Functions and Special Variables list (or select the function or variable and click the arrow adjacent to the Function group list). Fill in any parameters indicated by question marks (only applies to functions). The function group labeled All provides a listing of all available functions and system variables. A brief description of the currently selected function or variable is displayed in a reserved area in the dialog box.

– String constants must be enclosed in quotation marks or apostrophes.

– If values contain decimals, a period (.) must be used as the decimal indicator.

– For new string variables, you must also select Type & Label to specify the data type.

Page 4: 4. chapter iv(transform)

From the menus in the Data Editor window choose:Transform > Compute Variable...Minus_Value1Value2= Value1-Value2+, <,>,<=,>=,-*/

Page 5: 4. chapter iv(transform)

Replace Missing Value

Page 6: 4. chapter iv(transform)

Weigh Case

• Weight Cases gives cases different weights (by simulated replication) for statistical analysis.

• • The values of the weighting variable should indicate the number of observations represented by single cases in your data file.

• • Cases with zero, negative, or missing values for the weighting variable are excluded from analysis.

• • Fractional values are valid and some procedures, such as Frequencies, Crosstabs, and Custom Tables, will use fractional weight values. However, most procedures treat the weighting variable as a replication weight and will simply round fractional weights to the nearest integer. Some procedures ignore the weighting variable completely, and this limitation is noted in the procedure-specific documentation.

• Once you apply a weight variable, it remains in effect until you select another weight variable or turn off weighting. If you save a weighted data file, weighting information is saved with the data file. You can turn off weighting at any time, even after the file has been saved in weighted form.

Page 7: 4. chapter iv(transform)

Weigh Case

• If you want to see the frequency of freq in cross tab

Analyze=>Descriptie Statistic=>CrosstabsRow(s):sexColumn(s):choice

Page 8: 4. chapter iv(transform)
Page 9: 4. chapter iv(transform)

Data=>Weight Cases

Page 10: 4. chapter iv(transform)

Weight case by:freq

Page 11: 4. chapter iv(transform)

Split file

Analyze=>Descriptive StatisticVariable: income

Page 12: 4. chapter iv(transform)
Page 13: 4. chapter iv(transform)
Page 14: 4. chapter iv(transform)
Page 15: 4. chapter iv(transform)
Page 16: 4. chapter iv(transform)

Split file

Page 17: 4. chapter iv(transform)
Page 18: 4. chapter iv(transform)
Page 19: 4. chapter iv(transform)
Page 20: 4. chapter iv(transform)

Rank Value

Page 21: 4. chapter iv(transform)
Page 22: 4. chapter iv(transform)
Page 23: 4. chapter iv(transform)
Page 24: 4. chapter iv(transform)
Page 25: 4. chapter iv(transform)

Rank case• The Rank Cases dialog box allows you to create new variables

containing ranks, normal and Savage scores, and percentile values for numeric variables.

• New variable names and descriptive variable labels are automatically generated, based on the original variable name and the selected measure(s). A summary table lists the original variables, the new variables, and the variable labels. (Note: The automatically generated new variable names are limited to a maximum length of 8 bytes.)

• Optionally, you can:• • Rank cases in ascending or descending order.• • Organize rankings into subgroups by selecting one or more

grouping variables for the By list. Ranks are computed within each group. Groups are defined by the combination of values of the grouping variables. For example, if you select gender and minority as grouping variables, ranks are computed for each combination of gender and minority.

Page 26: 4. chapter iv(transform)

Transform=>Rank Case…

Page 27: 4. chapter iv(transform)

Recommended