spss introduction

Upload: gaurav-wadhwa

Post on 03-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 SPSS Introduction

    1/7

    SPSS Introduction

    Yi Li

    Note: The report is based on the websites belowhttp://glimo.vub.ac.be/downloads/eng_spss_basic.pdf

    http://academic.udayton.edu/gregelvers/psy216/SPSS

    http://www.nursing.ucdenver.edu/pdf/FactorAnalysisHowTo.pdfhttp://www.odu.edu/people/m/mbutler/Biometry/BiometryHandouts/SPSS%20Nested%20ANOVA.pdf

    http://www.oup.com/uk/orc/bin/9780199252312/resources/datasets/spss/supplement/spss_12.pdfAruga, kenakaI. 2008. Introduction to SPSS (ppt). Use Google.SPSS statistical package is one of the most popular statistical packages which can perform highly complex datamanipulation and analysis with simple instructions. It is frequently used in the social science. SPSS has four

    windows--- Data editor; Output viewer; Syntax editor; Script window. Many tasks can be performed with the

    menus and dialog boxes but some very powerful features are available only with command syntax. Graphscommand is used exclusively in SPSS to make graphs. SPSS usually creates commonly used graphics in the

    fields of social science, such as histograms, scatterplots, and regression line, etc. The Graphs command allows

    changing aspects of axes, adding text, changing color and font, copying, pasting, and exporting, etc. You could

    also manually editing graphics for publication. For more information regarding making publication readygraphics, please refer http://www.techdocs.ku.edu/docs/spss_output-publishing.pdf.However, SPSS cannot

    give you very complicated statistical graphics, such as maps, contour plot, etc. Several graphs produced by

    SPSS are listed below.

    Linear Regression Analysis

    Example: analyze the model1) Click AnalyzeRegressionLinear from the main menu.2) Put Beginning Salary as Dependent and Educational Level as Independent.3) Clicking OK gives the result.

    edusalbegin 10

  • 7/29/2019 SPSS Introduction

    2/7

    Analysis of Variance

    1) Click AnalyzeCompare meansOne Way ANOVA2) Click on the variable that corresponds to your dependent variable .Move it into the Dependent List by

    clicking on the upper arrow button. In this example, the GPA is the variable that we recorded, so we

    click on it and the upper arrow button. Select the independent variable from the list at the left and click

    on it. Move it into the Factor box by clicking on the lower arrow button. In this example, the quasi-

    independent variable is the recoded variable from above, MAJORNUM.

    3) Click on the Post Hoc button to specify the type of multiple comparisons that you would like to perform.The Post Hoc dialog box appears. In this example, Tukey test is selected.

    4) Click on the Continue button to return to the One-Way ANOVA dialog box. Click on the Options buttonin the One-Way ANOVA dialog box. The One-Way ANOVA Options dialog box appears. Click on the

    check box to the left of Descriptives (to get descriptive statistics), Homogeneity of Variance (to get a

    test of the assumption of homogeneity of variance) and Means plot (to get a graph of the means of theconditions).

    5) Click on the Continue button to return to the One-Way ANOVA dialog box. In the One Way ANOVAdialog box, click on the OK button to perform the analysis of variance.

    Nested variable modeling

    SPSS allows nesting only in the syntax route. Here is the way to run a 2-factor nested ANOVA.

    1) Make sure you have the data organized in columns with subject, nesting variable, nested variable, anddependent measure.

    2) From the pull-down menu: AnalyzeGeneral Linear ModelsUnivariate 3) Specify the appropriate variables. For example: DATA is the dependent variable, FACTOR A is

    fixed, FACTOR B is random.4) Specify the appropriate ANOVA model. Click on the Model button, then click on Custom, and then

    add to the model list: FACTOR A.

    5) Add whatever options you with to the ANOVA analysis; for example, you might want to specify amultiple comparison procedure for factor A, power, check assumptions, etc.

    6) Alter the command language to get the correct text for the nested factor. Click on the Paste button anda syntax window will appear with the program code in it. On the DESIGN subcommand line in thecode, specify the nested effect by inserting after the fixed effect (i.e., FACTOR A) the following:

    FACTOR B (FACTOR A). Run the program, click on the Run Current tool on the toolbar at the top of

    this syntax window.

    Non-linear modeling

    SPSS allows you to apply more sophisticated models with its wide range of non-linear modeling procedure. Butthis analyzing capability is not as powerful as SAS. These procedures include: binary logistic regression,

  • 7/29/2019 SPSS Introduction

    3/7

    multinomial logistic regression, nonlinear regression, and constrained nonlinear regression. Take analyzingbinary logistic as an illustration.

    1) Click Analyze Regression Binary Logistic.2) Fill in the Dependent box Covariates box according to the data. Click OK.3) Click Options and check Hosmer-Lemeshow goodness of fit and CI for exp(B) 95%.

    Continuous/ categorical variable analyses

    FrequenciesExample: make a bar chart for categorical variable gender.

    1) Click AnalyzeDescriptive statistics Frequencies.2) Click gender and put it into the variable box.3) Click Charts.4) Then click Bar charts and click Continue.5) Finally Click OK in the Frequencies box.

    DescriptivivesClick AnalyzeDescriptive statistics. The option allows you to analyze other descriptive statistics besides the

    mean and Std., such as variance, skewness, and kurtosis, etc. Click what you want in the front small box and

    click continue and OK in the descriptives box. You will be able to see the results of the analysis.

    Histogram & QQ-plot

    Example: use data from the SPSS data file Employee data.sav, to assess whether the variable Current salary isnormally distributed.

    1) Open SPSS data file Employee data.sav.2) Click AnalyzeDescriptives StatisticsExplore.3) Select and move the variable Current Salary to the Dependent list area.4) Click on Plots button to open Explore: Plots dialogue box.5) In the dialogue box, make sure to select the options Histogram and Normality plots with tests options.6) Click on Continue to close the dialogue box.7) Click on OK to run procedure.

    Random effect models

    Example: One-way ANOVA with a random factor. Use menu.

    1) AnalyzeGeneral Linear ModelVariance Components2) Choose response into the Dependent Variable box.3) random effects into the Random Factors box.4) Click OptionsANOVA.

    Example: Nested mixing random and fixed effects.

  • 7/29/2019 SPSS Introduction

    4/7

    No nesting permitted in menu route, one syntax example is as follows.glmWGAINbySIREDAM/randomDAM/designSIREDAM(SIRE).

    varcompWGAINbySIREDAM/randomDAM/methodsstype(1)/designSIREDAM(SIRE).

    Chi-squared testing

    SPSS permits you doing lots of kind of chi-square tests, such as Pearsons chi-square, Chi-square goodness-of-

    fit test, Likelihood ratio chi-square test, Mantel-Haenszel chi-square. Take Pearsons chi-square as an example.1) Click AnalyzeDescriptive StatisticsCrosstabs and Crosstabs dialog box appears.2) Select one of the variables of interest from the list at the left and move it into the Row(s) box by clicking

    on the upper arrow button.

    3) Select the other variable of interest from the list at the left and move it into the Column(s) box byclicking on the middle arrow button.

    4) Click on the Statistics button. The Crosstabs: Statistics dialog box appears.5) Click in the check box next to the Chi-square option.6) Click on the Continue button to return to the Crosstabs dialog box. Click on the Cells button. The

    Crosstabs: Cell Display dialog box appears.

    7) To display the expected frequencies, click in the check box next to Expected in the Counts frame.8) Click on the Continue button to return to the Crosstabs dialog box. Click on the OK button to perform

    the chi-squared test of independence of categorical variables. The SPSS output viewer appears.

    Reading in multiple data formats

    SPSS is designed to handle a wide variety of formats including: Spreadsheet files created with Lotus 1-2-3 andExcel, Database files created with dBASE, Tab-deliminated and other types of ASCII text files, SPSS data files

    create on other operating systems, and SYSTAT data files. The following tutorial will indicate how to readthese files into a data set in SPSS.

    1) From the File menu, select Open. This will open the Open File dialog box.2) Change the path name to your home directory and open the SPSS folder. This is where the file to be

    opened should be.

    3) Select Excel (*.xls) / Lotus(*.w*) for Lotus files/ *.txt/*.sav/ from the Files of type box.4) Select the file you want to import.5) Click Open. This will open the Opening File Options dialog box. Click on the Read variable names

    dialog box if you want SPSS read variable names from the chosen file. Click OK. This will close theOpening File Options dialog box and will open the file in the Data Editor. The Output Navigator will

    also be opened.

  • 7/29/2019 SPSS Introduction

    5/7

    Data transformation (e.g. x Log(x))

    Example: Adding a new variable named lnheight which is the natural log of height

    1) Click TransformCompute Variable2) Type in lnheight in the Target Variable box. Then type in ln(height) in the Numeric Expression box

    Click OK and a new variable lnheight is added to the table

    Factor analysis/PCA

    Example: using factor analysis to reproduce the verbal vs. nonverbal distinction, with test WISC-III

    1) Click AnalyzeData ReductionFactor2) Select the variables you want to include in the analysis.3) Select an extraction method and a rotation method. Hit the Extraction button to specify your

    extraction method.

    4) Check the box for a scree plot. This will give you a scree diagram, which is one way to decide howmany factors to extract.

    5) Look at the section labeled Extract. the default setting is for SPSS to use the Kaiser stopping criterion(i.e., all factors with eigenvalues greater than 1) to decide how many factors to extract. You can set amore conservative stopping criterion by requiring each factor to have a higher eigenvalue. Or, if you

    already know exactly how many factors you think there will be, you can set the extraction method to a

    specific Number of factors, and then put the number into this box.6) Go back to the main dialog box by clicking Continue. Once youre there, click on the button for

    Rotation to see the second sub-dialog. This dialog allows you to choose a rotation method for your

    factor analysis. In this case, Varimax (default) is chosen.7) Check box rotated solution.8) Hit Continue in the sub-dialog, and then OK in the main dialog to see the output.

  • 7/29/2019 SPSS Introduction

    6/7

    Sample size calculations

    There is no sample size calculations function in SPSS Base. Sample Power which is an add-on package for

    SPSS allows you using the function. Sample Power has functionality similar to SASs PROC POWER and

    PROC GLMPOWER plus power analysis for logistic regression.

    General data manipulation

    Transposing data structure/matrixExample: Change wide data format into long format

    1) Click Data Restructure and restructure wizard appears. Select Restructure selected variables intocases and click on Next.

    2) A Variables to Cases: Number of Variable Groups dialog box appears. We select one and click on next.3) Select the repeated variables and move them to the target variable box4) After moving the repeated variables into the target variable box, we move the fixed variables into the

    Fixed variable box, and select a variable for case idin this case, subject. Then we click on Next

    5) A create index variables dialog box appears. We leave the number of index variables to be created at oneand click on next at the bottom of the box.

    6) When the following box appears we just type in time and select Next.7) When the options dialog box appears, we select the option for dropping variables not selected.

    We then click on Finish.

  • 7/29/2019 SPSS Introduction

    7/7

    Filling in missing values

    In SPSS, there are two kind of missing values. System-missing values are values automatically recognized asmissing by SPSS, appearing either a blank or a dot. User-defined missing values are numeric values that need tobe defined as missing for SPSS, appearing -9 in cells. You could use Transform command to replace missing

    values are replaced with their predicted values. Under Transform, Replace Missing Cases, supports five

    estimation methods: replacement of missing values with the series mean, by the mean or median of nearbypoints, or linear interpolation between prior and subsequent known points, interpolating between the adjacent

    valid values above and below the missing one, or substitution of the linear regression trend value for that point.

    As for complicated imputation method, such as MCMC and monotone, you have to use SPSS Missing Valuespackage.

    Deleting rows & columns

    Under Data Editor, click the row/or column you want to delete. The row/or column will darken. Right click themouse and choose Clear from the pop-up list. The row/or column deletes.

    Smoothing

    There is no smoothing function in SPSS Base. You have to use SPSS Trends to execute the function.

    More sophisticated programming tasks

    No more complicated tasks are in SPSS.