A) Entering Numeric Data
B) Entering String Data
C) Defining Data
C1) Adding Variable
Labels
C2) Changing Variable
Type And Format
C3) Adding Value
Labels For Numeric Variables
C4) Adding Value
Labels For String Variables
C5) Using Value
Labels For Data Entry
C6) Handling Missing
Data
C7) Missing Values
For A Numeric Variable
C8) Missing Values
For A String Variable
C9) Copying And
Pasting Variable Attributes
C10) Defining
Variable Properties For Categorical Variables
The Data Editor displays the contents of the active data file. The
information in the Data Editor consists of variables and cases.
• In Data View, columns represent variables, and rows represent
cases (observations).
• In Variable View, each row is a variable, and each column is
an attribute that is associated with that variable.
Variables are used to represent the different types of data that
you have compiled. A common analogy is that of a survey. The response to each
question on a survey is equivalent to a variable. Variables come in many
different types, including numbers, strings, currency, and dates.
A) ENTERING NUMERIC DATA
1) Data can be entered into the Data Editor, which may be useful for small data files or for making minor edits to larger data files.
2) Click the Variable View tab at the bottom of the Data Editor window.
3) You need to define the variables that will be used. In this case, only three variables are needed: age, marital status, and income.
4) In the first row of the first column, type age. In the second row, type marital. In the third row, type income.
5) New variables are automatically given a Numeric data type.
6) If you don't enter variable names, unique names are automatically
created. However, these names are not descriptive and are not recommended for
large data files.
7) Click the Data View tab to continue entering the data.
8) The names that you entered in Variable View are now the headings
for the first three columns in Data View.
9) Begin entering data in the first row, starting at the first
column. In the age column, type 55. In the marital column, type 1. In the income column, type 72000.
10) Move the cursor to the second row of the first column to add the next subject's
data.
► In the age column, type 53. In the marital column, type 0. In the income column, type 153000.
11) Currently, the age and marital columns display decimal points, even though their
values are intended to be integers. To hide the decimal points in these
variables:
Click the Variable View tab at the bottom of the Data
Editor window. In the Decimals column of the age row, type
0 to hide the decimal. In the Decimals column of the marital row,
type 0 to hide the decimal.
B) ENTERING STRING DATA
1) Non-numeric data, such as strings of text, can also be entered into the Data Editor.
2) Click the Variable View tab at the bottom of the Data Editor window.
3) In the first cell of the first empty row, type sex for the variable name.
4) Click the Type cell next to your entry. Click the button on the right side of the Type cell to open the Variable Type dialog box.
5) Select String to specify the variable type. Click OK to save your selection and return to the Data Editor.
C) DEFINING DATA
In addition to defining data types, you can also define descriptive variable labels and value labels for variable names and data values. These descriptive labels are used in statistical reports and charts.
C1) ADDING VARIABLE LABELS
1) Labels are meant to provide descriptions of variables. These descriptions are often longer versions of variable names.
2) Labels can be up to 255 bytes. These labels are used in your output to identify the different variables.
3) Click the Variable View tab at the bottom of the Data Editor window.
4) In the Label column of the age row, type Respondent's Age. In the Label column of the marital row, type Marital Status.
5) In the Label column of the income row, type Household Income. In the Label column of the sex row, type Gender.
C2) CHANGING VARIABLE TYPE AND FORMAT
C3) ADDING VALUE LABELS FOR NUMERIC VARIABLES
1) Value labels provide a method for mapping your variable values to a string label. In this example, there are two acceptable values for the marital variable.
1) The Type column displays the current data type for each variable. The most common data types are numeric and string, but many other formats are supported.
2) In the current data file, the income variable is defined as a numeric type.
3) Select Dollar.
3) Select Dollar.
The formatting options for the currently selected data type are displayed.
For the format of the currency in this example, select $###,###,###.
Click OK to save your changes.
C3) ADDING VALUE LABELS FOR NUMERIC VARIABLES
1) Value labels provide a method for mapping your variable values to a string label. In this example, there are two acceptable values for the marital variable.
2) A value of 0 means that the subject is single, and a value
of 1 means that he or she is married.
C4) ADDING VALUE LABELS FOR STRING VARIABLES
1) String variables may require value labels as well. For example, your data may use single letters, M or F, to identify the sex of the subject.
3) Click the Values cell for the marital row, and then click the button on the right side of
the cell to open the Value Labels dialog box.
4) The value is the actual numeric
value. The value label is the string label
that is applied to the specified numeric value.
5) Type 0 in the Value field. Type Single in the Label field. Click Add to add this label to the list.
6) Type 1 in the Value field, and type Married in the Label field. Click Add, and then click OK to save
your changes and return to the Data Editor.
7) These labels can also be displayed in Data View, which can make
your data more readable.
8) Click the Data View tab at the bottom of the Data
Editor window.
9) From the menus choose:
View > Value Labels
10) The labels are now displayed in a list when you enter values in
the Data Editor. This setup has the benefit of suggesting a valid response and
providing a more descriptive answer.
If the Value Labels menu item is already active (with a check mark
next to it), choosing Value Labels again will turn
off the display of value labels.
C4) ADDING VALUE LABELS FOR STRING VARIABLES
1) String variables may require value labels as well. For example, your data may use single letters, M or F, to identify the sex of the subject.
2) Value labels can be used to specify that M stands for Male and F stands for Female.
3) Click the Variable View tab at the bottom of the Data
Editor window.
4) Click the Values cell in the sex row, and then click the button on the right side of the
cell to open the Value Labels dialog box.
5) Type F in the Value field, and then type Female in the Label field. Click Add to add this label to your data file.
6) Type M in the Value field, and type Male in the Label field. Click Add, and then click OK to save your changes and return to the Data Editor.
7) Because string values are case sensitive, you should be consistent. A lowercase m is not the same as an uppercase M.
C5) USING VALUE LABELS FOR DATA ENTRY
1) You can use value labels for data entry.
2) Click the Data View tab at the bottom of the Data Editor window.
3) In the first row, select the cell for sex. Click the button on the right side of the cell, and then choose Male from the drop-down list. In the second row, select the cell for sex. Click the button on the right side of the cell, and then choose Female from the drop-down list.
4) Only defined values are listed, which ensures that the entered data are in a format that you expect.
C6) HANDLING MISSING DATA
1) Missing or invalid data are generally too common to ignore. Survey respondents may refuse to answer certain questions, may not know the answer, or may answer in an unexpected format.
2) If you don't filter or identify these data, your analysis may not provide accurate results.
3) For numeric data, empty data fields or fields containing
invalid entries are converted to system-missing, which is identifiable by a
single period.
4) The reason a value is missing may be important to your analysis.
5) For example, you may find it useful to distinguish between
those respondents who refused to answer a question and those respondents who
didn't answer a question because it was not applicable.
C7) MISSING VALUES FOR A NUMERIC VARIABLE
1) Click the Variable View tab at the bottom of the Data Editor window.
2) Click the Missing cell in the age row, and then click the button on the right side of the cell to open the Missing Values dialog box.
3) In this dialog box, you can specify up to three distinct missing values, or you can specify a range of values plus one additional discrete value.Select Discrete missing values. Type 999 in the first text box and leave the other two text boxes empty.
4) Click OK to save your changes and return to the Data Editor.
5) Now that the missing data value has been added, a label can be applied to that value. Click the Values cell in the age row, and then click the button on the right side of the cell to open the Value Labels dialog box.
6) Type 999 in the Value field. Type No Response in the Label field. Click Add to add this label to your data file. Click OK to save your changes and return to the Data Editor.
C8) MISSING VALUES FOR A STRING VARIABLE
1) Missing values for string variables are handled similarly to the missing values for numeric variables.
2) However, unlike numeric variables, empty fields in string variables are not designated as system-missing. Rather, they are interpreted as an empty string.
3) Click the Variable View tab at the bottom of the Data
Editor window.
4) Click the Missing cell in the sex row, and then click the button on the right side of the
cell to open the Missing Values dialog box.
5) Select Discrete
missing values. Type NR
in the first text box.
6) Missing values for string variables are case sensitive. So, a value of nr is not treated as a missing value.
7) Click OK to save your changes and return to the Data Editor.
8) Now you can add a label for the missing value. Click the Values cell in the sex row, and then click the button on the right side of the cell to open the Value Labels dialog box.
9) Type NR in the Value field. Type No Response in the Label field. Click Add to add this label to your project. Click OK to save your changes and return to the Data Editor.
C9) COPYING AND PASTING VARIABLE ATTRIBUTES
1) After you've defined variable attributes for a variable, you can copy these attributes and apply them to other variables.
2) In Variable View, type agewed in the first cell of the first empty row. In the Label column, type Age Married.
3) Click the Values cell in the age row.
4) From the menus choose:
5) Click the Values cell in the agewed row.
6) From the menus choose:
7) The defined values from the age variable are now applied to the agewed variable.
8) To apply the attribute to multiple variables, simply select multiple target cells (click and drag down the column).
9) When you paste the attribute, it is applied to all of the selected cells.
10) New variables are automatically created if you paste the values into empty rows.
11) To copy all attributes from one variable to another variable:
C10) DEFINING VARIABLE PROPERTIES FOR CATEGORICAL VARIABLES
1) For categorical (nominal, ordinal) data, you can use Define
Variable Properties to define value labels and other variable properties. The
Define Variable Properties process:
• Scans the actual data values and lists all unique data values
for each selected variable.
• Identifies unlabeled values and provides an "auto-label"
feature.
• Provides the ability to copy defined value labels from another
variable to the selected variable or from the selected variable to additional
variables.
2) This example uses the data file demo.sav.
3) In Data View of the Data Editor, click the first data cell for the variable ownpc (you may have to scroll to the right), and then enter 99.
4) From the menus choose:
You might notice that the measurement level icons for all of
the selected variables indicate that they are scale variables, not categorical
variables.
Click Suggest.
14) An X in the first column of the
Scanned Variable List also indicates that the selected variable has at least one
observed value without a defined value label.
15) In the Label column for the value of 99, enter No answer.
16) Check the box in the Missing column for the value 99 to
identify the value 99 as user-missing.
Data
values that are specified as user-missing are flagged for special treatment and
are excluded from most calculations.
17) Before we complete the job of modifying the variable properties
for ownpc, let's apply the same measurement level, value
labels, and missing values definitions to the other variables in the list.
In the Copy Properties area, click To Other Variables.
18) In the Apply Labels and Level dialog box, select all of the variables in the
list, and then click Copy.
19) If you select any other variable in the Scanned Variable List of
the Define Variable Properties main dialog box now, you'll see that they are all
ordinal variables, with a value of 99 defined as user-missing and a value label
of No answer.
20) Click OK to save all of the variable properties that
you have defined.
No comments:
Post a Comment