SPSSpriručnik engleski

Embed Size (px)

Citation preview

  • 7/31/2019 SPSSprirunik engleski

    1/37

    http://www.nyu.edu/its/

    New York University

    For New Users of SPSS V.9.0 on Microsoft Windows at NYU

    Fourth Edition September 15, 1999

    Contents

    1. In trod uction ............................................................................................. 1

    2. SPSS Basics............................................................................................... 2

    Star ting SPSS....................................................................................... 2

    Crea ting a New Data Set ................................................................... 3

    Savin g the Data Set ............................................................................ 7

    Producing a Data Dictionary ............................................................ 9

    Entering Data .................................................................................... 10Disp laying Valu e Labels.................................................................. 12

    Changing the Ord er of Variables ................................................... 13

    Prin ting the Spread sheet of Cases ................................................. 13

    Com mon Errors ................................................................................ 14

    3. Working With the Data Set ................................................................. 15

    Variable Transform ations................................................................ 15

    Recod ing .................................................................................... 15

    Recod ing a Variable ......................................................... 16

    Ad ding Across Variab les ........................................................ 17

    Reliability Analysis (Cronbach Alph a) ......................... 18

    Sum ..................................................................................... 19Mean .................................................................................. 20

    Analyzin g the Data Set .................................................................... 21

    Analyzing a Subset of Data ..................................................... 21

    Descrip tive Statistics ................................................................ 22

    Frequ ency Distr ibution ................................................... 22

    Mean and Standard Devia tion ....................................... 25

    Com parative Statis tics ............................................................. 26

    Crosstabulation Table...................................................... 26

    Cor relation ........................................................................ 28

    Com parison of Means: t-test........................................... 29

    Comparison of Mean s: One-Way ANOVA .................. 31Comparison of Means: Two-Way AN OVA ................. 32

    4. Ad ditional Sources of In form ation .................................................... 35

  • 7/31/2019 SPSSprirunik engleski

    2/37

    Publication History

    Fourth Edition, September 1999; Revised to reflect edition 9.0 chan ges. Revised by Fran k LoPresti, Deborah Pad gett and Joan

    Charlotte Matelli.

    Third Ed ition, September 1998; Revised to reflect edition 8.0 changes, and to ad d Cronbach alpha, filtering for subsets of d ata.

    Revised by Fran k LoPresti, Deborah Pad gett and Melissa Whitney.

    Second Edition, September 1997; Revised to reflect edition 7.5 of SPSS. Revised by Melissa Whitney, Alexandra Cincotta,

    Frank LoPresti and Deborah Padgett.

    First Edition, October 1995; minor revisions, September 1996.

    Written by Mary Ann Jones, Frank LoPresti, Zvia Nap htali and Melissa Whitney; edited by Melissa Whitney,

    with Estelle Hochberg

  • 7/31/2019 SPSSprirunik engleski

    3/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 1

    1. Introduction

    Statistical Package for th e Social Sciences (SPSS) is a comp rehensive

    integrated software p ackage for statistical data analysis. SPSS for Window s

    allows you to store data, perform transformations and analyses, and prod uce

    charts and grap hs of results. Data are entered using a spread sheet and results

    are displayed in a separate output w indow. The data and the outp ut can be

    saved independently for the next work session. The output tables can be

    copied to a word processing app lication for inclusion in pap ers.

    This documen t is an introdu ctory guide to SPSS version 9.0 run ning in the

    Microsoft Wind ows environmen t. It was w ritten particularly for stud ents in

    the cou rse Social Work Research II (S44.2008). Accord ingly, exam ples are

    given with th is cour se's requirements in mind . Nonetheless, the guide will be

    helpful to oth er SPSS users as w ell.

    This guide w ill be most useful if you ar e sitting at a comp uter, following the

    steps for wor king w ith SPSS as you read . The illustrations are taken directly

    from the compu ter screen and will match w hat you see on you r monitor

    while you are working.

    Classes in SPSS and Window s basics are offered by NYUs Information

    Technology Services (ITS). Schedules are available at any ITS computer lab;

    in the Innovation Center on the second floor of Warren Weaver Hall; and on

    the World Wide Web at www.nyu.edu/its/classes/.

    A basic familiarity with the Wind ows op erating system is assum ed in this

    document. If you are new to Windows, run the online tutorial beforeproceeding w ith SPSS. To start the tu torial on any Wind ows m achine:

    1. Select Help from the Start menu.

    2. Select the Contents tab in the Help Topics: Windows H elp dialog box.

    3. Select Tour: Ten minu tes to using Windows and click the Display

    button.

    SPSS for Window s is available at the following ACF compu ter labs:

    Tisch Hall 40 West 4th Street, Rooms LC-7 and LC-8

    14 Washington Place 14 Washington Place, basement

    For information on eligibility to use the ITS labs, please see

    www.nyu.edu/its/labs. Lab hou rs are listed on the last page of this guide.

    Bring two 3.5-inch h igh d ensity floppy d isks formatted for DOS/Windows

    on wh ich to save your work.

    Windows Online Tutorial

    Getting Startedat an ACF Lab

  • 7/31/2019 SPSSprirunik engleski

    4/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 2

    2. SPSS Basics

    To start SPSS for Windows at an ITS lab:

    1. Double-click on the Applications folder on the desktop .

    2. Dou ble-click on the Statistical Analysis folder.

    3. Dou ble-click on the SPSS 9.0 folder.

    4. Dou ble-click on the SPSS 9.0 pr ogram icon.

    The SPSS wind ow op ens.

    At this point you have two op tions: begin creating a new da ta set (see page 3)

    or u sing an existing d ata set (see page 8). Before covering either topic, we

    will review th e elemen ts of the SPSS Data Editor w indow .

    SPSS opens m ultiple windows as it performs operations. The two wind ows

    you w ill use most frequently are the Data Editor and the Ou tput Viewer.

    Every window h as a title bar and a m enu bar.

    The title bar displays the name of the ap plication, SPSS, and the curren t

    wind ow, for example, Data Editor or Viewer. On either end of the title bar

    are common elemen ts of Window s app lications: control menu, minimize and

    maximize button s. If these terms are un familiar to you, consider run ning the

    Window s tutorial (see page 1).

    The menu bar app ears just below th e title bar. Clicking once on a word in the

    menu bar opens the a ssociated m enu, from w hich you can select a comman d.

    The instruction "select Save from the File menu " tells you to click once on the

    wor d "File," then once on the w ord "Save."

    The Data Editor is a spreadsheet in wh ich you define your variables and

    enter values. All of your da ta entry is done in this wind ow. The title bar

    displays th e nam e of the open da ta file, or "Untitled" if the file has not yet

    been saved.

    Starting SPSS

    The Main W indow r

    Menu bar

    Tool Bar

    Data Editor

    (active window)

    Spreadsheet

  • 7/31/2019 SPSSprirunik engleski

    5/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 3

    The active wind ow is the window you are currently using or th at is currently

    selected. Keystrokes and com man ds are ap plied to the active window . If a

    wind ow is active, its title bar changes color to d ifferentiate it from other

    window s. Only one window is active at a time. To make a wind ow active,

    click on any p art of the window, or select it from the Window menu. You

    can also select it from the task b ar found at the bottom of your screen.

    The active cell in the spread sheet is indicated by a d ark bord er. This is the

    cell in wh ich typ ing w ill app ear. Only on e cell is active at a tim e. You can

    make a different cell active by clicking on it, or by using the tab, retu rn, and

    cursor keys to move to it.

    The spreadsheet that app ears within the d ata editor is a series of rows and

    colum ns. Each column correspon ds to a variable. Each row correspon ds to a

    case or subject.

    Creating a new da ta set consists of the following step s:

    1. Define var iables.

    Name.

    Description.

    2. Save the data set.

    3. Produce a da ta dictionary (optional).

    4. Enter da ta.

    5. Save the data set again.

    6. Print the cases (optional).

    Variables are d efined one at a tim e using the Define Variable dialog box.

    To access the Define Variable dialog box:

    Double-click on the top of a column, w here the w ord var ap pears.

    or

    Select Define Variable from the Data menu.

    Creating a New DataSet

    Defining Variables

  • 7/31/2019 SPSSprirunik engleski

    6/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 4

    The Variable Name field d isplays the name of the var iable. You can edit the

    nam e directly by placing your cursor in this field. SPSS provides a d efault

    nam e for each variable in the format VAR00001, VAR00002 and so on.

    Replace this name w ith one wh ich is more mean ingful to your research. The

    variable name m ust begin with a letter of the alpha bet and cannot exceed 8

    characters. Spaces are not allowed within the variable nam e. Each variable

    nam e must be unique. Make your variable names mem orable. SALSTART

    and SALNO W are easier to interp ret than SALARY1 and SALARY2.

    The Variable Description area d isplays informa tion about the variable. The

    defau lt variable description is a Num eric variable with a colum n width of 8,

    right justified; no d ecimal p laces; no labels; and no m issing values. This

    description w ill suffice for the majority of your variables. To mod ify the

    variable description, use the buttons in the Change Settings area.

    The aspect of the variable description that you most frequen tly will change is

    Labels. There are two types o f labels in SPSS: Variable and Value.

    The Variable Label can be th ough t of as a long nam e for the variable. The

    eight character limit on the va riable name can resu lt in arcane n ames such as

    PAEDUC or AGCH LD2. The variable label shows that PAEDUC stand s for

    "Father's Edu cation Level" and AGCHLD2 stands for "Age of the Second

    Child." Variable labels can be up to 120 characters long an d can includ e

    spaces (which variable nam es cannot). If you enter a variable label, the label

    will print on your charts and reports instead of the na me, making them easier

    to und erstand.

    Value Labels provide a key for translating numeric data tha t is not inheren tly

    mean ingful. For example, a variable representing age contains numeric

    values ind icating age in years. These numbers are easily interp reted. Anoth er

    variable ind icates a su bject's sex. A value of 1 d oes not au tomatically reveal

    wh ether the su bject is male or female, so value labels must be supp lied.

    The Define Variable

    Dialog Box

    Variable Name

    Variable Description

    Variable Name field

    Variable Description area

    Chan e Settin s area

  • 7/31/2019 SPSSprirunik engleski

    7/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 5

    The other elements of the variable description are type, missing values, and

    alignment. These op tions are d iscussed in the on line SPSS help system . To

    access the help system, from the H elp menu, select Topics then Con tents.

    To introd uce you to va riable definition, we'll create a simple data set using

    information on age, gender an d salary.

    Define a variable named id , which will serve as a uniq ue iden tifier or key

    for our cases.

    1. Double-click on the top of the first colum n, where the word var appears.

    or

    Click anyw here in th e first column , then select Define Variable from the

    Data m enu . The Define Variable dialog box opens.

    2. Enter id in the Variable Nam e field. The defau lt description is suitable for

    the id v ariable, so we will close the dialog box.

    3. Click on the OK button. You are returned to the data w indow , and the

    first colum n now contains the variable id.

    Define a variable named age.

    1. Double-click on the second column , wh ere the word var appears.

    or

    Click anyw here in the second colum n, then select Define Variable from

    the Data m enu . The Define Variable dialog box opens.

    2. Enter age in the Variable Nam e field.

    3. Click on Type, then set the width as 8.

    4. Click on the OK button. You are returned to the data w indow , and the

    second column contains the age variable.

    Example: Creating a

    Sample Data Set

  • 7/31/2019 SPSSprirunik engleski

    8/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 6

    Define a variable named gend er as a numeric variable with value labels.

    1. Double-click on the top of the third column, wh ere the word var ap pears.

    or

    Click anyw here in the third colum n, then select Define Variable from the

    Data m enu . The Define Variable dialog box opens.

    2. Enter gender in the Variable Nam e field.

    3. Click on the Labels button in the Cha nge Settings area. The Define Labels

    dialog box opens.

    4. The variable name "gend er" is sufficiently descriptive, so we will not ad d

    a Variable Label. Leave the Variable Label box empty.

    5. Enter 0 in the Value field and Male in the Value Label field. Click the Ad d

    button . The phr ase 0="Male" appear s in the lower section of the dialog

    box. Now, enter 1 in the Value field and Female in the Value Label field.

    Click on the Add button again.

    We are using the values 0 and 1 to represent the two genders, but thechoice of numbers is arbitrary. Num eric values are often assigned to a

    categorical variable at the time a questionna ire is designed . When that is

    the case, use the p reassigned nu mbers to define value labels.

    6. Click on the Continu e button. The Define Labels dialog box closes and

    you ar e returned to the Define Variable dialog box.

    NOTE: Do not to click the Continue bu tton until all of your labels

    app ear in the lower section of the dialog box. If you d o not

    click on the Ad d bu tton after entering a Value and a Label,

    the informa tion will be lost.

    7. Click on the OK button. You are returned to the data w indow , and thethird column now contains the gender va riable.

    Define a variable n amed salary with a Variable Label "Salary in

    Thousands."

    1. Double-click on the top of the fourth colum n, where the word var

    appears.

    or

  • 7/31/2019 SPSSprirunik engleski

    9/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 7

    Click anyw here in the fourth colum n, then select Define Variable from the

    Data m enu . The Define Variable dialog box opens.

    2. Enter salary in the Variable Name field.

    3. Click on the Labels button . The Define Labels dialog box opens.

    4. Enter Salary in Thousand s in the Variable Label field.

    5. Click on the Continu e button. The Define Labels dialog box closes and

    you a re return ed to the Define Variable dialog box. Notice that the

    variable label you just entered ap pear s in the variable description area ofthe Define Variable dialog box.

    6. Click on the OK button. You are returned to the data w indow , and the

    fourth column now contains the salary variable.

    All of the variables in our sam ple da ta set are now d efined . The remaining

    steps to complete the data set are:

    1. Save the data set.

    2. Prod uce a da ta dictionary (optional).

    3. Enter da ta.

    4. Save the data set again.

    5. Print the cases (optional).

    Work performed on your d ata set lasts only du ring the current session. To

    retain your wor k you m ust save it to a file. It is a good id ea to save your

    work frequently. Machines do occasionally go d own, and any w ork not

    saved w ill have to be redon e.

    To save a new data set:

    1. Insert your floppy disk in the A:\ drive.

    2. Make sure that the da ta editor is the active wind ow. The active windowapp ears on top of other wind ows and has a differently colored title bar. If

    the data ed itor is not active, select it from th e Window menu .

    3. Select Save from th e File menu . The Save Data As d ialog box opens.

    4. From the Save as Type d rop-d own list, select SPSS (*.sav).

    From the Save in d rop-d own list, select a: for the floppy drive.

    Saving the Data Set

  • 7/31/2019 SPSSprirunik engleski

    10/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 8

    In the File name box, enter a name for the file. SPSS au tomatically ad ds

    the extension .sav. For our samp le data set, enter the name sample .

    5. Click Save. It will take a few m omen ts for the comp uter to save th e file to

    disk.

    If you h ave pr eviously saved th e file you are w orking on, selecting Save fromthe File menu autom atically saves your changes to the app ropr iate file. If you

    want to save you r changes to a d ifferent file, use the Save As comman d on

    the File menu .

    To use a data file which has been saved to a floppy disk:

    1. Insert your floppy disk in the A:\ drive.

    2. Select Open from th e File menu. The Open File dialog box opens.

    3. From the File of type drop -dow n list, select SPSS (*.sav)

    From the Look in d rop-d own list, select a:In the File nam e box, enter the nam e of the file to open. You do n ot need

    to includ e the .sav extension.

    4. Click Open. It will take a few mom ents for the comp uter to open the file

    from the disk.

    Opening a Saved Data File

  • 7/31/2019 SPSSprirunik engleski

    11/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 9

    A data d ictionary is a list of the param eters for each var iable in you r da ta set:

    the var iable name, type, variable label, value labels, missing value d efinition,

    and display format. The data d ictionary d ocum ents how each variable in

    your d ata set was defined.

    Producing a d ata d ictionary at this point a llows you to qu ickly check each of

    your variable definitions for errors before inp utting d ata.

    To produ ce a data dictionary:

    Select File Info from the Utilities menu.

    SPSS opens the outp ut viewer, bringing it to the foreground and covering the

    da ta editor. The data d ictionary begins w ith the line "List of variables on the

    wor king file." To the left is the nam e of each va riable, and to the right the

    column number in which the variable appears. Below each variable name is

    the pr int and wr ite format, followed by an y special characteristics of the

    variable description, for example, value labels. Use the scroll bars to view th e

    entire data dictionary.

    To print the d ata d ictionary:

    1. Make sure that the outp ut viewer is the active window. If it is not, select

    the output viewer from the Wind ow menu .

    2. Select Print from the File menu. The Print d ialog box opens. Before

    printing the data dictionary, check which printer your machine is

    connected to by looking at th e Where line in the Print d ialog box. If you

    are still un certain about w here m aterial will print, ask an ITS Lab

    consultant for help.

    Producing a DataDictionary

    Printing the Data Dictionary

  • 7/31/2019 SPSSprirunik engleski

    12/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 10

    3. Click OK.

    The entire contents of the outpu t w indow print out. To print only the m ost

    recent output (in this case, the data d ictionary):

    1. Select the Select comm and on the Edit menu , then select Last Outpu t on

    the Select submenu . The last outpu t is highlighted in the ou tput wind ow.

    2. Select Print from the File menu. In the Print d ialog box select Selection

    before clicking OK. Only the h ighlighted text pr ints out.

    To return to the data ed itor, select the data editor from the Window menu .

    Once all of the variables are defined , you can begin entering d ata. The data is

    typed into the spr eadsh eet one cell at a time. Each cell represents one

    responden t's answer to one qu estion. A colum n rep resents a single piece of

    information about every respond ent, and a row represents every piece of

    information about a single respondent.

    When you type information into the data window of SPSS for Wind ows it

    app ears in the edit area at the top of the window . The information is entered

    into the cell wh en you m ove the active cell. The mouse and th e tab, return,

    and cursor keys can be u sed to enter data.

    Mouse activates the cell clicked on

    Tab key moves the active cell one cell to the right

    Return key moves the active cell one cell down

    Cursor keys move the active cell one cell in the direction of the arrow.

    Entering Data

  • 7/31/2019 SPSSprirunik engleski

    13/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 11

    To introd uce you to h ow to en ter da ta in SPSS, we'll enter some values for

    our samp le data set.

    Enter values for th e first case.

    1. Click on the first cell to make it the active cell.

    2. Type the num ber 1. Notice that it app ears in the edit area at the top of thescreen.

    3. Press the Tab key. The num ber 1 appear s in the first cell, and the active

    cell moves right one colum n.

    The row nu mber to th e left of the first colum n tu rns black. This indicatesthat a case has been created.

    The second cell in th e first row is now the active cell. Notice that in the

    box to the left of the ed it area the caption "1:age" is d isplayed. This

    indicates that the active cell is in the first row and the age colum n.

    4. Type the num ber 26. This information app ears in the edit area.

    5. Press the Tab key. The number 26 app ears in the second cell, and the

    active cell moves one cell to the right.

    6. Type 1 for the cell "1:gend er" and press th e Tab key.

    7. Type 20 for the cell "1:salary" and press th e Tab key.

    We now have a comp lete record for a 26-year-old female m aking $20,000.

    Example: Entering Data intothe Sample Data Set

  • 7/31/2019 SPSSprirunik engleski

    14/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 12

    Complete the d ata set.

    Enter values for the next four cases according to the sp readsheet below:

    Experiment w ith the tab, return and cursor keys and w ith the mouse to find

    the method most efficient for your w ork.

    Once you have entered several cases it is a good id ea to save your w ork

    again. Select Save from the File menu . Because you have already nam ed an d

    saved this file, the Save d ialog box does not open. The new information is

    autom atically saved to the correct file and d isk.

    To display value labels for the data in the spr eadsheet:

    Select Value Labels from the View m enu .

    or

    Click on the Value Labels button on the toolbar.

    The gender colum n d isplays the text value labels for the numeric data

    entered earlier. In the illustration above, the active cell is on "Female," but

    notice that the u nd erlying num eric value (1) displays in the edit area on the

    top left of the wind ow.

    Saving the Data Set Again

    Displaying ValueLabels

  • 7/31/2019 SPSSprirunik engleski

    15/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 13

    For most of you r w ork in SPSS, you select variables to include from a list in a

    dialog box. This list may appear either in alphabetical order or in the order

    in wh ich the va riables occur in the original data file. If you h ave hu nd reds of

    variables, you w ould p robably choose to view the list in alph abetical order,

    while if your data set is well known to you, the d ata entry order of the

    variables may be m ore useful. To change the ord er in wh ich SPSS displays

    variable names:

    1. Select Options from the Edit menu. The Options dialog box opens.

    2. In the Variable Lists area select either the Alphabetical or the File option

    and clickOK.

    SPSS displays a m essage that th e change w ill take effect the next time you

    open a d ata file.

    3. Close the current d ata file by selecting New from th e File menu , then Data

    from the New sub m enu, or by closing and re-opening the SPSS program.

    4. Re-open you r data file by selecting Op en from the File menu.

    To print the complete spread sheet of cases you have entered :

    1. Make sure the d ata editor is the active wind ow. If it is not, select the data

    editor from the Window menu to activate it.

    2. Select Print from the File menu . The Print d ialog box opens. The title bar

    of the dialog box displays the name of the w indow to print.

    3. Click OK.

    Changing the Orderof Variable Lists

    Printing theSpreadsheet of Cases

  • 7/31/2019 SPSSprirunik engleski

    16/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 14

    The entire spread sheet prints ou t. To print only certain rows or columns, use

    the m ouse to select them , then check the Selection op tion in the Print dialog

    box before clicking OK.

    Empty cases (rows) at the bottom of the sp readsh eet

    When you enter a value anyw here in a row , SPSS au tomatically creates a case

    for that row. If you then delete the value, the cell contents are deleted, but the

    row is still considered a case by SPSS. It is a case consisting entirely of

    missing values. Any analysis run on your data set will contain erroneous

    missing values.

    To remove an emp ty case, click on th e row nu mber to the left of the case. The

    row is highlighted . Press the delete key. The case is deleted, and the row

    num ber app ears in grey instead of black.

    Unwan ted variables

    To remove an erroneou s variable or column , click once on the grey cell at the

    top of the sp read sheet that contains the variable nam e (VAR00001, or

    something similar). The column is highlighted. Press the d elete key. The

    column is deleted and the heading returns to a grey "var" placeholder.

    Inserting a variable (column ) in the mid dle of the spreadsh eet

    To insert a var iable, click on the colum n before wh ich you want the new

    variable to app ear. Select Insert Variable from th e Data m enu . A colum n is

    inserted to the left of the active cell. Double-click on the grey head er of the

    column to define the new variable.

    Inserting a case (row) in th e mid dle of the spreadsheet

    To insert a case, click on the row above w hich you w ant the new case to

    app ear. Select Insert Case from the Data men u. A row is inserted above the

    active cell. Enter values as you w ould for any other case.

    Common Errors

  • 7/31/2019 SPSSprirunik engleski

    17/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 15

    3. Working With an Existing Data Set

    Now that you are familiar with how to enter data and get around w ithin

    SPSS, you are read y to use the system to p erform variable transforma tions

    and analyze data.

    This section u ses a shorter nota tion for making selections from m enus. The

    instruction "Select Define Variable from th e Data m enu" is shortened to:

    Select Data > Define Variable.

    For a comm and on a subm enu, the notation takes the form of "Menu Title >

    Subm enu Title > Command Nam e."

    We will be working with the hiv.sav d ata file in this section.

    To open the hiv.sav file on the N YU-ACF networ k:

    1. Select File > Op en. The Op en File d ialog box opens.

    2. From the File of type drop -dow n list, select SPSS (*.sav).

    From the Look in d rop-d own list, select x:, then Courses, then S442008.

    In the File name box, type in the name hiv .

    3. Click Open. It will take a few mom ents for the comp uter to open the file.

    There are three m ain reasons for recoding variables: to compr ess categorical

    data values into a smaller nu mber of categories; to reverse the values of some

    items in a Likert-type scale prep aratory to calculating a sum or mean ; and to

    convert a continuou s variable into a grou ped or categorical variable.

    In the first instance, you m ight run a chi-squar e analysis and find tha t more

    than 20% of the cells have expected values of less than 5. Recoding to

    compress som e of the categories into a single category will enable you to

    redu ce the num ber of cells with coun ts of less than 5.

    In the second instance you m ay have a self-esteem inven tory in wh ich all the

    questions are ran ked on a scale of 1 to 5. How ever, because of the way the

    Opening thehiv.sav file

    VariableTransformations

    Recoding

  • 7/31/2019 SPSSprirunik engleski

    18/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 16

    questions are phrased , the value 1 indicates high self-esteem on some

    questions and low self-esteem on others. Before summ ing across the

    questions, you would recode the scores on the items that requiring reversing,

    so the nu merical values repr esent the sam e level of self-esteem.

    Finally, you m ight want to present a continuous variable as a grouped or

    categorical variable. For example, a continuous variable containing

    individuals ages might be recoded into age groups.

    To recode th e HIV data set var iable age into three categories:

    1. Select Transform > Recode > Into Different Variables. The Recode into

    Different Variables dialog box op ens.

    2. Select age from the var iable list and click on the ar row button , so region

    app ears in the Nu meric Variable -> Outp ut Variable box.

    3. Enter agegroup in the Ou tpu t Variable Name box. This variable will be

    created, and the recoded values calculated and entered for each case.

    Click on the Change button. The variable agegroup is added to the

    expression in the center box.

    4. Click on the Old and N ew Values button. The Recode into DifferentVariables: Old and N ew Values dialog box opens. Here we will recode the

    values und er 30 years of age in one group , from 30 to 50 into anoth er and

    over 50 into a third .

    5. In the Old Value area, select Range: Lowest throu gh and en ter 29.

    6. In the New Value area, enter 1 in the Value box. The value 1 will

    represent und er 30 in our new variable.

    7. Click on the Add button . The expression "Lowest thru 29 -> 1" appears in

    the Old -> New area.

    Recoding a Variable into aSmaller Number of Categories

  • 7/31/2019 SPSSprirunik engleski

    19/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 17

    8. In the Old Value area, select Range: through . Enter 30 as the low value

    and 50 as the high value. In the New Value area, enter 2. The value 2 w ill

    represent the group aged 30 to 50 in our n ew var iable. Click the Ad d

    button . The expression "30 thru 50 -> 2" is add ed to the Old -> New area.

    9. In the Old Value area, select Range: throu gh highest and enter 51. In the

    New Value area, enter 3. Click the Ad d button . The expression "51 thruHighest -> 3" is added to the Old -> New ar ea.

    10. Click on the Con tinue bu tton. The Old an d New Values dialog box closes,

    and you a re return ed to the Recode into Different Variables dialog box.

    11. Click OK. The Recode into Different Variables d ialog box closes and SPSS

    activates the d ata editor. The new variable agegroup app ears in the last

    colum n of the spreadsheet. Each subject younger than th irty has been

    given a va lue of 1, and each subject aged thirty to fifty, a value of 2, and

    each subject over fifty, a value of 3. The values 1, 2 and 3 are not

    inherently m eaningful, so the next step is to assign va lue labels.

    12. Double-click on th e head er of the agegrou p colum n to op en the Define

    Variable dialog box. Click on the Labels button to open the Define Labels

    dialog box. Enter the value labels 1= "Un de r 30", 2= "30 to 50" and 3=

    "Over fifty". Click the Continu e button to close the Define Labels dialogbox, then the OK bu tton to close the Define Variable dialog box.

    If you have the Value Labels option on the View m enu tu rned on, the

    labels will display in the spread sheet.

    A ma jor reason for ad ding across variables is to generate a single scale score

    from m ultiple Likert-type items. For examp le, in a self-esteem inventory, the

    answ ers to multiple questions are sum med to arrive at a total self-esteem

    score. You m ight also use the m ean of the answers as th e score. Taking the

    mean across items is a simple method for dealing with m issing d ata among

    scale items. Before add ing var iables it is a good idea to do a reliability

    analysis of the scale items.

    Adding Across Variables

  • 7/31/2019 SPSSprirunik engleski

    20/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 18

    If you h ave an ad ditive scale in w hich you wish to ad d across mu ltiple

    items to come up w ith a score, you m ust first determine if the items are

    internally consistent. That is, do th e items correlate positively with each

    other and at a sufficiently high level to justify add ing them together to

    measu re the concept that the scale prop oses to measure. If you d eveloped

    your ow n scale or modified an existing scale this is particularly important,

    but even if you're using a stand ardized m easure for w hich the Cronbach

    alpha (or other measu re of internal consistency) was rep orted , this is still

    an interesting and instructive thing to do.

    1. Select Analyze > Scale > Reliability Ana lysis. The Reliability Analysis

    dialog box opens.

    2. Select all the "worst state self-esteem" variable nam es that compr ise the

    scale (ability1 through foolish1) and click on the arrow button so that

    they appear in the Items area.

    Select Alpha in the Model field.

    Check the List item lab els option.

    3. Click on the Statistics bu tton . The Reliability Analysis: Statistics d ialog

    box opens.

    4. Select Item and Scale if item d eleted in the Descriptives for area, and

    Correlations in the Inter-Item area.

    Reliability Analysis(Cronbach Alpha)

  • 7/31/2019 SPSSprirunik engleski

    21/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 19

    5. Click the Continue bu tton . The Reliability Analysis: Statistics d ialog box

    closes.

    6. ClickOK. The Reliability Analysis dialog box closes and SPSS activates

    the output window.

    The outpu t gives you the Cronbach alpha statistic. A rule of thu mb is the

    0.60 is the low er level of acceptability for the a lpha, an d alphas in the 0.70's

    and 0.80's are preferable. The inter-item correlation m atrix will allow you to

    see if any of the items are negatively correlated w ith the other items in the

    scale, and the "Scale if item is deleted" will reveal the alpha if each item w ere

    deleted from the scale. This will help you identify any 'clunkers' in th e scale

    that m ight need to be removed before the scale score is calculated.

    To sum across variables:

    1. Select Transform > Compu te. The Compu te Variable dialog box opens.

    2. In the Target Variable field, enter the variable nam e seworst (for "self-

    esteem wor st"). This variable will be created and the sum entered for each

    case.

    3. In the Fun ctions box select the function SUM(nu mexpr,nu mexpr, . . .).

    Click the up arrow button to ad d the function to the N um eric Expression

    box.

    4. We wan t to include each of the self-esteem related items: the variables

    ability1, success1, up throu gh foolish1. This can be done in on e of two

    ways. You m ay type in the nam e of each ind ividu al variable, separated by

    comm as. To do this, delete the two question marks that a pp ear between

    the parentheses and rep lace them w ith the individu al variable names

    separated by commas. If we were interested in summing a subscale such

    as "body self-esteem", we could u se the expr ession SUM(body1, weight1,

    appear1, unatt1). When you are sum ming a large num ber of variables,

    entering the ind ividu al variable names can be ted ious and error-prone.

    If the variables app ear one after the other in the spread sheet, as they do in

    this example, you can simp ly enter a range of variables to sum. Delete the

    two qu estion marks that ap pear between the parentheses and replace

    them with the phrase ability1 to foolish1, so the expression read s:

    SUM(ability1 to foolish1)

    Sum

  • 7/31/2019 SPSSprirunik engleski

    22/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 20

    5. Click OK. The Compu te Variable dialog box closes and SPSS activates the

    data editor. The new variable seworst app ears in the last column of the

    spreadsheet.

    To compu te the mean you u se the same d ialog box, substituting the MEAN

    function for the SUM function.

    1. Select Transform > Compu te. The Compu te Variable dialog box opens. If

    you hav e previously compu ted a variable, the data u sed for that

    compu tation is retained in the Com pu te Variable dialog box. To clear the

    dialog box in preparation for a new computation, press the Reset button.

    2. In the Target Variable box, enter the variable name seworst (for "self-

    esteem wor st: mean ").This variable will be created and the mean entered

    for each case.

    3. In the Fun ctions box select the function MEAN (nu mexpr, nu mexpr, . . .)

    Click the up arrow button to ad d the function to the N um eric Expression

    box.

    4. We wan t to include each of the self-esteem related items: the variables

    ability1, success1, up throu gh foolish1. This can be done in on e of two

    ways. You m ay type in the nam e of each ind ividu al variable, separated by

    comm as. To do this, delete the two question marks that a pp ear between

    the parentheses and rep lace them w ith the individu al variable names

    separated by comm as. If we w ere only interested in the body image

    related items, we could u se the expr ession MEAN (bod y1, weigh t1,

    appear1, unatt1). When you are sum ming a large num ber of variables,

    entering the ind ividu al variable names can be ted ious and error-prone.

    If the variables app ear one after the other in the spread sheet, as they do in

    this example, you can simp ly enter a range of variables. Delete the two

    question m arks that app ear between the parentheses and replace them

    with the phrase ability1 to foolish1, so the expression read s:

    MEAN(ability1 to foolish1)

    5. Click OK. The Compu te Variable dialog box closes and SPSS activates the

    data editor. The new variable sewmean app ears in the last column of the

    spreadsheet.

    Mean

  • 7/31/2019 SPSSprirunik engleski

    23/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 21

    You m ay sometimes wish to exclud e some cases while you are perform ing

    certain an alysis. For example, if you h ave only a few men in a large set of

    da ta, you might d ecide to select only the females from your p opu lation to

    keep the effect of those few men ou t of your statistics. In the data set we are

    working with, the population is predominantly homosexual, with relativelyfew bisexual subjects. To look just at th e hom osexual pop ulation, withou t

    perm anen tly deleting the bisexual cases, we could select just the homosexual

    cases.

    To work with a su bset of the data:

    1. Select Select Cases from the Data menu. The Select Cases dialog box

    opens.

    2. Make sure the Filtered option is selected in the Unselected Cases Are

    area. IfDeleted is selected the cases will be perm anen tly removed .

    Select If cond ition is satisfied and click on the Ifbutton. The Select

    Cases: If dialog box op ens.

    3. Select Sexual Orientation [sexual] and click on the arrow button so the

    variable sexual app ears in the expression area. Comp lete the expression

    by typ ing in "=0", as 0 is the value for homosexua l orientation.

    Analyzing theData Set

    Analyzing a

    Subset of Data

  • 7/31/2019 SPSSprirunik engleski

    24/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 22

    4. Click Continu e. The Select Cases: If d ialog box closes and you are

    return ed to th e Select Cases dialog box.

    5. Click OK. You ar e return ed to the SPSS Data Editor. Notice that the

    bisexual cases still app ear in the Data Ed itor, but there is a slash thr ough

    the case num ber, and there is a message on the bottom of the wind ow that

    there is a Filter On .

    Only those cases that don't hav e a slash through them w ill be included in

    subsequent analyses.

    To look only at a consecutive grou p of cases, or instances if all your

    control cases are entered consecutively, you can u se the Based on Time or

    Case Range option in the Select Cases dialog box. See the SPSS Reference

    Guide for more inform ation on selection criteria.

    6. To return to analyzing th e comp lete data set, select Select Cases from th e

    Data m enu . Click on the All Cases option, and click OK. Notice that the

    hash marks are removed from the bisexual cases.

    Descriptive Statistics look at a single variable. Two comm only u sed

    descriptive statistics are frequency distribution, and mean and standarddeviation. Frequency distributions are used primarily with categorical data.

    Mean and stand ard d eviation are used p rimarily with continuou s data.

    This example generates a frequen cy distribution showing the relative

    frequencies of edu cation level categories in the h iv da ta set.

    Descriptive Statistics

    Frequency Distribution

  • 7/31/2019 SPSSprirunik engleski

    25/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 23

    1. Select Ana lyze > Descript ive Statistics > Frequ encies. The Frequen cies

    dialog box opens.

    2. Click on the var iable educate in the variable list, then click on the right

    arrow button betw een the boxes. The ed ucate variable moves over to the

    Variable(s) box.

    NOTE: You can calculate mu ltiple frequency distributions

    simultaneou sly by add ing variables to the Variable(s) box.

    A single variable is used in th is examp le for clarity.

    3. Click on the checkbox next to "Display frequency tables," so a checkmark

    app ears in the box.

    4. Click OK.

    SPSS activates the outp ut view er and p roduces a frequen cy table for the

    variable educate.

    Examining and Using the Output in the SPSS Viewer

    To examine your outpu t, make the Viewer the active wind ow. You can d o

    this in any of three w ays. Select SPSS Viewer from the Wind ow menu; click

    the SPSS Viewer tab on you r Windows taskba r along the bottom of the

    screen; or if some por tion of the Viewer w indow is visible, click d irectly on it

    to make it active.

    In the left panel of the Viewer is an outline of the various outp uts, listing the

    name of the analyses and the individual charts or tables produ ced for each

  • 7/31/2019 SPSSprirunik engleski

    26/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 24

    analysis. To go d irectly to a pa rticular analysis, click on the n ame in th e

    outline pan el. Alternately, you can use the scroll bar on the right panel to

    scroll up and down through the output.

    When the ou tpu t from a p rocedu re is very long, the Viewer only d isplays the

    top portion of the table, then shows a red arrow ind icating that the outpu t

    continues ou t of view. To view the comp lete table, dou ble-click on th e table

    itself. A Pivot Table wind ow op ens, displaying the complete outp ut. Use the

    scroll bar to view any p art of the table. To close the Pivot Table and retur n to

    the Viewer, click on th e 'x' in the u pp er right corner of the Pivot Table

    window.

    An easy way to create reports from SPSS outp ut is to copy an d p aste the

    tables of interest into a w ord p rocessor. Open both your word processor and

    the SPSS Viewer. Select a table in the Viewer by clicking d irectly on it, or by

    clicking on its name in th e outline panel on the left of the Viewer. Once a

    table is selected, select Copy Objects from the Edit men u in SPSS Viewer,

    then select Paste from the Edit menu in you r wor d p rocessor.

  • 7/31/2019 SPSSprirunik engleski

    27/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 25

    To generate means and standard deviations:

    1. Select Analyze > Descript ive Statistics > Descriptives. The Descriptives

    dialog box opens.

    2. Select worst and click on the arrow button to ad d th e variable worst to the

    Variable(s) box. Likewise, select best and click on the arrow button.

    NOTE: As w ith frequency d istribution, SPSS allows you to calculate

    mean an d standard deviation for a single variable or for

    many variables simultaneously.

    3. Click on the Options button. The Descriptives: Op tions dialog box opens.

    4. Check the Mean option. Select the Std. Deviation, Minimu m and

    Maximum options in the Dispersion area. Select Variable List in the

    Display Ord er area, to display the outpu t in the order in w hich the

    variables are entered in the Descriptives d ialog box.

    5. Click the Continue button . The Descriptives: Op tion dialog box closes and

    you are retu rned to the Descriptives dialog box.

    6. Click OK. The Descript ives dialog box closes and SPSS activates the

    output viewer.

    Mean and Standard Deviation

  • 7/31/2019 SPSSprirunik engleski

    28/37

  • 7/31/2019 SPSSprirunik engleski

    29/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 27

    6. Click Continue. The Crosstabs: Statistics dialog box closes and you a re

    returned to the Crosstabs dialog box.

    7. Click on the Cells button . The Crosstabs: Cell Display d ialog box opens.

    8. Select the Expected and Observed op tions in the Coun ts area and th e

    Colum n op tion in the Percentages area. The ru le of thum b is to prod uce

    percentages for the indep endent variable. In ou r example the

    independent variable, income, appears in the column, so we will generate

    column percentages.

    9. Click on the Continue bu tton. The Crosstabs: Cell Display dialog boxcloses and you are retur ned to the Crosstabs dialog box.

    10. Click OK. The Crosstabs d ialog box closes and SPSS activates the ou tpu t

    wind ow. The crosstabulation table is disp layed first, followed by the chi-

    squar e informa tion. Note that SPSS includ es a message regarding h ow

    man y of the cells have an expected coun t of less than 5.

  • 7/31/2019 SPSSprirunik engleski

    30/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 28

    Two or more var iables may be included in a correlation matrix. To produce a

    correlation matr ix:

    1. Select Analyze > Correlate > Bivaria te. The Bivariate Correlations d ialog

    box opens.

    2. Select worst and click on the arrow so the worst variable is added to the

    Variables dialog box. Use the same m ethod to add the variable best. The

    order of the variables in the Variables box determines the ord er in wh ich

    they appear in the report.

    3. In the Correlation Coefficients area, select Pearson . In the Test of

    Significance area, select Two-tailed. Select the Flag significant correlations

    option at the bottom of the dialog box.

    Correlation

  • 7/31/2019 SPSSprirunik engleski

    31/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 29

    4. Click OK. The Bivariate Correlations dialog box closes and SPSS activates

    the ou tpu t viewer. The correlation coefficient for each p air of variables

    displays in the Pear son correlation area, followed by the tw o-tailed

    significance value in the Sig area. The num ber of cases app ears at the

    bottom.

    The t-test is a comparison of the means of a dep end ent variable for two

    groups of an ind epend ent variable. The indep endent variable must be a

    categorical variable, or a continuou s variable recoded into categorical form.

    This is called the group ing variable. The depend ent variable mu st be a

    continuou s variable. In SPSS the depend ent var iable is called the test

    variable. We will use a t-test to look at the relationship betw een mem bership

    in a gay/ lesbian religious group and best self-esteem rating in the HIV dataset.

    1. Select Analyze > Compare Means > Indep end ent-Samp les T Test. The

    Indep end ent-Samp les T Test dialog box opens.

    2. Select best and click on the top arrow button, so the variable best is added

    to the Test Variable(s) box.

    3. Select galesrel and click on the bottom arr ow bu tton, so the variable

    galesrel is add ed to the Grou ping Variable box.

    Comparison ofMeans: t-test

  • 7/31/2019 SPSSprirunik engleski

    32/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 30

    4. Highlight the Group ing Variable field and click on the Define Group s

    button . The Define Group s dialog box opens.

    5. Enter 0 (the value for no) in the Grou p 1 box and 1 (the value for yes) in

    the Group 2 box.

    6. Click on the Continue bu tton. The Define Groups dialog box closes, and

    you are returned to the Independ ent-Samp les T Test dialog box. Note that

    the values for the two group s (no and yes) now ap pear as part of the

    Group ing Variable expression.

    7. Click OK. The Indep end ent-Samp les T Test d ialog box closes and SPSS

    activates the output window. A table of means displays, followed by the

    t-test results.

    Results of two significance tests are displayed : one for when the variances are

    equal, and on e for when they ar e unequ al. Consu lt the p level for Levenes

    Test for Equality of Variances in d etermining w hich significance test to use.

    In SPSS, p level is known as Sig level. If p is less than or equal to 0.05,

    the variances are unequal and the results labeled Un equal should be used .

    If p is greater than 0.05, the variances can be considered equa l, and the

    Equal results u sed.

  • 7/31/2019 SPSSprirunik engleski

    33/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 31

    Like the t-test, one-way an alysis of variance comp ares mean s of a dependen t

    variable by an ind ependent grouping v ariable. However, the grouping

    variable, or "factor," in an analysis of variance may have any nu mber of

    categories, wher e the t-test allows on ly two.

    1. Select Analyze > Compare Means > One-Way AN OVA. The One-Way

    ANOVA dialog box opens. ANOVA is a comm on abbreviation for

    Analysis of Variance.

    2. Select worst and click on the top arr ow bu tton, so the variable wor st is

    add ed to the Depend ent List box.

    3. Select educate and click on the bottom ar row bu tton, so the variable

    edu cate is add ed to the Factor box.

    4. Click on the Options button. The One-Way ANOVA: Options dialog box

    opens.

    5. Select Descrip tive in the Statistics area, and select Exclude cases ana lysis

    by ana lysis in the Missing Values area .

    6. Click on the Continue button . The One-Way AN OVA: Options dialog box

    closes and you are returned to the One-Way ANOVA d ialog box.

    NO TE: Be sure to set the O ne-Way AN OVA Op tions (steps 4-6). If

    you d o not, SPSS will use the default options and you w ill

    not get the expected report.

    7. Click OK. The On e-Way ANOVA dialog box closes and SPSS activates the

    outp ut w indow . The ana lysis of variance significance results are at the

    bottom right. The means of the depend ent variable for each category of

    the independ ent variable can be found und er Descriptives.

    Comparison of Means:One-Way ANOVA

  • 7/31/2019 SPSSprirunik engleski

    34/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 32

    The two-way an alysis of variance comp ares means of a dep endent variable

    by two variables or factors.

    1. Select Analyze > General Linear Mod el > Univariate. The Univariate

    dialog box opens.

    2. Select worst and click on the top ar row bu tton so the variable worst is

    add ed to the Depend ent Variable box.

    3. Select educate and click on the second arrow button so the ed ucate

    variable is added to th e Fixed Factor(s) box. Next, add the sexual variable

    to the Fixed Factor(s) box in the sam e man ner.

    4. Click the Options dialog box. The Univariate: Options d ialog box opens.

    Comparison of Means: Two-WayANOVA

  • 7/31/2019 SPSSprirunik engleski

    35/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 33

    5. In the Display area , select Descript ive Statistics. Leave the Significance

    level set to 0.05.

    6. Click the Continue button . The Univariate: Options dialog box closes, and

    you are returned to Univariate dialog box.

    NO TE: Be sur e to set th e GLM - General Factorial Options (steps 4-

    6). If you d o not, SPSS will use the d efault options and you

    will not get the expected rep ort.

    7. Click OK. The Univariate d ialog box closes and SPSS activates the outp ut

    window.

  • 7/31/2019 SPSSprirunik engleski

    36/37

    ITS/ NYU September 15 , 1999 SPSS for Wind ows 34

  • 7/31/2019 SPSSprirunik engleski

    37/37

    4. Additional Sources of Information

    Online Help: SPSS for Wind ows includ es an extensive online help system.

    To access the online help, select Topics from th e Help menu.

    Trade Books: SPSS documentation and a variety of third-party trade books

    are available at the NYU Compu ter Store.

    Classes: The Academic Computing Services offers classes in SPSS and

    Window s basics. Schedu les are available at any ACS compu ter lab; at the

    ACF HelpCenter on the second floor of Warren Weaver Hall; and via the

    World Wide Web at http://www.nyu.edu/its/classes/. Introductory

    workshops can be held for specific courses; contact the ACS Social Science

    Statistics and GIS group at 998-3398 to make arran gemen ts.

    Consultants: Researchers can contact Frank LoPresti of the ACS Social

    Science Statistics and GIS Group at 998-3398 to arrange tutorials, or for

    assistance with SPSS and other statistical pr ogram s.