Upload
rakesh-mohindra
View
124
Download
1
Embed Size (px)
DESCRIPTION
Introduction to SPSS
Citation preview
Introduction to SPSSIntroduction to SPSS
Rakesh MohindraRakesh MohindraDepartment of LawsDepartment of Laws
Panjab University, ChandigarhPanjab University, Chandigarh
Rakesh MohindraRakesh MohindraDepartment of LawsDepartment of Laws
Panjab University, ChandigarhPanjab University, Chandigarh
SPSS: An Introduction SPSS: An Introduction Originally it is an acronym of Statistical Package for the
Social Science, Initial released in 1968 by SPSS Inc., later it stands for Statistical Product and Service Solutions.
In 2009 it was re-branded as PASW (Predictive Analytics SoftWare). It is again basically a computer program used for statistical analysis, acquired by IBM.
One of the most popular statistical packages which can perform highly complex data manipulation and analysis with simple instructions
In addition to statistical analysis, data management (case selection, file reshaping, creating derived data) and data documentation (a metadata dictionary is stored in the datafile) are features of this software.
Introduction (contd)Introduction (contd)
SPSS works on Operating system like Windows, Linux / UNIX & Mac Platform Java and perform a wide variety of statistical procedures.
Data management and analysis can be handled very well with SPSS.
Using SPSS we can manipulate data, make graphs and perform statistical techniques varying from means to regression.
Management of data and filesManagement of data and files
SPSS can read different types of data files.
You can open not only SPSS files but also excel and other types of files like csv, txt. Etc.
You can create a new data set with SPSS.
You can also edit, delete and view the contents of your data file.
OverviewOverview Measurement Scales. Type of Variables, Levels of Measurement. Discrete and Continuous Variables. Introduction to SPSS. Entering and Labeling Variables, Values. Transformation of Variables. Descriptive and Inferential Statistics. Running an analysis- explore differences, t test, ANOVA. Creating charts/graphs. Edit Outputs. Moving Charts and Graphs into Word.
Scientific Method of ResearchScientific Method of Research
Statement of the Problem.
Formulate the null hypothesis.
Design the Study.
Collect the Data.
Interpret the Data.
Draw Conclusions.
Statement of the Problem.
Formulate the null hypothesis.
Design the Study.
Collect the Data.
Interpret the Data.
Draw Conclusions.
What is Data?What is Data?a collection of facts from which conclusions may
be drawn; "statistical data"It represent the qualitative or quantitative
attributes of a variable or set of variables.
• An attribute is a property or characteristic of an object Examples: Refund, Sector,
Income
Attribute is also known as variable, field, characteristic, or a feature.
A collection of attributes describe an object
• Object is also known as record, point, case, sample, entity, instance, or observation
Tid Refund Sector Taxable Income Cheat
1 Yes Govt 125K No
2 No Pvt 100K No
3 No Govt 70K No
4 Yes Govt 120K No
5 No Govt 95K Yes
6 No Pvt 60K No
7 Yes Govt 220K No
8 No Govt 85K Yes
9 No Pvt 75K No
10 No Pvt 90K Yes 10
Attributes
Objects
Qualitative (or Categorical) attributes represent distinct categories rather than numbers. Mathematical operations such as addition and subtraction do not make sense. Examples:
eye color, letter grade, IP address, zip code
Quantitative (or Numeric) attributes are numbers and can be treated as such. Examples:
weight, failures per hour, number of TVs, temperature
TYPES OF ATTRIBUTES:TYPES OF ATTRIBUTES:
Discrete
Qualitative vs. Quantitative
Types of VariablesTypes of Variables
You can select type of variableYou can select type of variable String or alphanumericString or alphanumeric NumericNumeric
You can also select format of variableYou can also select format of variable CategoricalCategorical OrdinalOrdinal IntervalInterval
Variables and ConstantsVariables and Constants
Variables : Vary from person to person or object to object.
Constants : Remain constant from person to person or object to object.
A study is conducted to determine if there are gender differences in fine motor skills among five year olds from middle class families.
What are the variables in the study?
What are the constants in the study?
A trait might be a constant or a variable is determined by the nature of the particular study.
ExampleExample
Gender, Fine motor skills
Age, Socio-economic status
Levels of MeasurementLevels of Measurement
NominalNominal
OrdinalOrdinal
ScaleScale• RatioRatio
• IntervalInterval
NominalNominalA Nominal variable is one that has two or more categories, but there is no intrinsic ordering to the categories. if the values can be assigned to a code. The Values are distinct , they can be counted like (1,2,3..) lie students in class, doctors in a hospital
Objects observed to be similar on some characteristic (e.g., college student) are assigned to the same class or category, while objects observed to be dissimilar on that characteristic are assigned to different classes or categories. (Example: Car types: Toyota, Honda, Volvo, BMW, Audi, etc.)
Mutually exclusive unordered categories
Examples Sex (male, female)Race/ethnicity (White, Black, Latino, Asian, American, etc.)
OrdinalOrdinalA set of data/ values which can be ranked or a rating scales. You can count and order but not measure, ordinal data. The ordinal level of measurement is not only based on observing objects as similar or dissimilar, but also on ordering those observations in terms of an underlying characteristics. (Example: Height in size place ranking)
Ordered CategoriesExamples
Injury – Mild, Moderate, SevereIncome – Low, Medium, High
Even though we can order these from lowest to highest, the spacing between the values may not be the same across the levels of the variables.
Scale: Interval or RatioScale: Interval or RatioAn interval variable is similar to an ordinal variable, except that the intervals between the values of the interval variable are equally spaced.
An ordinal level of measurement can be developed into a higher level of measurement. Numbers can be assigned in such a way that equal numerical differences along the scale correspond to equal increments in the underlying characteristic. Like Map on a Scale.
Interval Scale of measurement is where any two adjacent units of measurement is same but the zero point is arbitrary. If this is done so that the score 0 corresponds to having none of the property being measured, the level of measurement is Ratio. (Example: Distance from home to school) Otherwise, it is interval. (Example: Temperature Scale)
Why does it matterWhy does it matter?? Statistical computations and analyses assume Statistical computations and analyses assume
that the variables have specific levels of that the variables have specific levels of measurementmeasurement
Can you compute average of hair color?Can you compute average of hair color? Does it makes sense to Does it makes sense to compute the average of compute the average of
educational experience?educational experience? AAn average requires a variable to be an interval. n average requires a variable to be an interval.
Continuous Data
1. If there are many different discrete values, then discrete data is often treated as continuous.
2. If there are very few discrete values, then discrete data is often treated as ordinal.
3. Qualitative (categorical) attributes are always discrete
Discrete Data
Any value on the continuum is possible (even fractions or decimals)Examples: Height, WeightMany “discrete” variables are often treated as continuous.Examples: BP, Heart RateA variable is continuous if in any unit of measurement, whenever it can take on the values a and b, it can also theoretically take on all the values between a and b.Has real numbers as attribute values.Can compute as accurately as instruments allow.Continuous attributes are typically represented as floating-point variables.
Data AnalysisData Analysis
Data analysis embraces both the problem of finding an appropriate model, on the one hand, and model estimation and testing, on the other.
In this context normality assumption becomes important.
In social sciences, it is hard to find typical bell shaped normal distribution.
Discrete & Continuous VariablesDiscrete & Continuous VariablesA variable is discrete if the values it takes on are integers or can be in
some unit of measurement in which they are integers. Has only a finite or countably infinite set of values Examples: zip codes, counts, or the set of religion type in a class. Often represented as integer variables
Qualitative (categorical) attributes are always discrete
A variable is continuous if in any unit of measurement, whenever it can take on the values a and b, it can also theoretically take on all the values between a and b.
Has real numbers as attribute values Can compute as accurately as instruments allow Examples: temperature, height, or weight Continuous attributes are typically represented as floating-point variables Quantitative (numeric) attributes can be either discrete or continuous.
Residence: 1 = College dormitory, 2 = Off campus apartment, 3 = Parents’ home, 4 = Other
Whether or not the student’s parents live in the same state as the student’s college
Class rank
Year graduated high school
Number of earned credits to date
Height
Family Income
Number of siblings
ExamplesExamples
Continuous
Discrete
Discrete
Discrete
Discrete
Discrete
Discrete
Discrete
How to Work on SPSSHow to Work on SPSS
Concepts (stats and scales).
Data entry (the workspace and Labels).
By hand
Import from Excel data file.
Creating, Computing and Transforming the Variables
Running an analysis- frequencies & Central tendency.
Graphical Representation.
Exporting Output.
Types of StatisticsTypes of Statistics
Descriptive- summarize or describe our Descriptive- summarize or describe our observations (frequencies)observations (frequencies)
Inferential- use observations to allow us to Inferential- use observations to allow us to make predictions (inferences) about a make predictions (inferences) about a situation that has not yet occurredsituation that has not yet occurred
Opening SPSSOpening SPSS The default window will have the data editor There are two sheets in the window:
1. Data view 2. Variable view
Data View windowData View window
The Data View window
This sheet is visible when you first open the Data Editor and this sheet contains the data
Click on the tab labeled Variable View
Click
Variable View windowVariable View window
This sheet contains information about the data set that is stored
with the dataset Name
The first character of the variable name must be alphabetic Variable names must be unique, and have to be less than 64
characters. Spaces are NOT allowed.
Variable View window: TypeVariable View window: Type
Type Click on the ‘type’ box. The two basic types of variables that you
will use are numeric and string. This column enables you to specify the type of variable.
Variable View window: WidthVariable View window: Width
Width Width allows you to determine the number of
characters SPSS will allow to be entered for the variable
Variable View window: DecimalsVariable View window: Decimals Decimals
Number of decimals It has to be less than or equal to 16
L3.14159265
Variable View window: LabelVariable View window: Label
Label You can specify the details of the variable You can write characters with spaces up to 256
characters
Defining the value labelsDefining the value labels
Click the cell in the values column as shown below For the value, and the label, you can put up to 60 characters. After defining the values click add and then click OK.
Click
Practice 1Practice 1
How would you put the following information into SPSS?
Value = 1 represents Male and Value = 2 represents Female
Name Gender HeightJAUNITA 2 5.4SALLY 2 5.3DONNA 2 5.6SABRINA 2 5.7JOHN 1 5.7MARK 1 6ERIC 1 6.4BRUCE 1 5.9
Practice 1 (Solution Sample)Practice 1 (Solution Sample)
Click
Click
Saving the dataSaving the data
To save the data file you created simply click ‘file’ and click ‘save as.’ You can save the file in different forms by clicking “Save as type.”
Click
Sorting the Data
Click ‘Data’ and then click Sort Cases
Sorting the data (cont’d) Double Click ‘Name of the students.’ Then click
ok.
Click
Click
Practice 2 How would you sort the data by the ‘Height’ of
students in descending order? Answer
Click data, sort cases, double click ‘height of students,’ click ‘descending,’ and finally click ok.
Transforming dataTransforming data
Click ‘Transform’ and then click ‘Compute Variable…’
Transforming data (cont’d)Transforming data (cont’d)
Example: Adding a new variable named ‘lnheight’ which is the natural log of height
Type in lnheight in the ‘Target Variable’ box. Then type in ‘ln(height)’ in the ‘Numeric Expression’ box. Click OK
Click
Transforming data (cont’d)Transforming data (cont’d)
A new variable ‘lnheight’ is added to the table
Practice 3Practice 3 Create a new variable named “sqrtheight”
which is the square root of height. Answer
Types of VariablesTypes of VariablesWhat are variables you would consider in buying What are variables you would consider in buying
a second hand bike?a second hand bike?
Brand (Hero, Atlas)Brand (Hero, Atlas) Type of Bike (Road, Mountain, Racer)Type of Bike (Road, Mountain, Racer) Components (Shimano, High Grade)Components (Shimano, High Grade) How OldHow Old Condition (Excellent, good, Poor)Condition (Excellent, good, Poor) PricePrice Bike SizeBike Size Number of gearsNumber of gears
The basic AnalysisThe basic Analysis
The basic analysis of SPSS that will The basic analysis of SPSS that will be introduced in this class be introduced in this class
Frequencies This analysis produces frequency tables showing
frequency counts and percentages of the values of individual variables.
Descriptives This analysis shows the maximum, minimum,
mean, and standard deviation of the variables
Linear regression analysis Linear Regression estimates the coefficients of
the linear equation
Opening the sample dataOpening the sample data
Open ‘Employee data.sav’ from the SPSS Go to “File,” “Open,” and Click Data
Opening the sample dataOpening the sample data
Go to Program Files,” “SPSSInc,” “SPSS16,” and “Samples” folder.
Open “Employee Data.sav” file
FrequenciesFrequencies Click ‘Analyze,’ ‘Descriptive statistics,’ then
click ‘Frequencies’
FrequenciesFrequencies
Click gender and put it into the variable box. Click ‘Charts.’ Then click ‘Bar charts’ and click ‘Continue.’
Click Click
FrequenciesFrequencies
Finally Click OK in the Frequencies box.
Click
Using the Syntax editorUsing the Syntax editor Click ‘Analyze,’ ‘Descriptive statistics,’ then
click ‘Frequencies.’ Put ‘Gender’ in the Variable(s) box. Then click ‘Charts,’ ‘Bar charts,’ and click
‘Continue.’ Click ‘Paste.’
Click
Using the Syntax editorUsing the Syntax editor
Highlight the commands in the Syntax editor and then click the run icon.
You can do the same thing by right clicking the highlighted area and then by clicking ‘Run Current’
ClickRight Click!
Practice 4Practice 4
Do a frequency analysis on the Do a frequency analysis on the variable “minority”variable “minority”
Create pie charts for itCreate pie charts for it
Do the same analysis using the Do the same analysis using the syntax editorsyntax editor
AnswerAnswer
Click
DescriptivesDescriptives Click ‘Analyze,’ ‘Descriptive statistics,’ then Click ‘Analyze,’ ‘Descriptive statistics,’ then
click ‘Descriptives…’click ‘Descriptives…’ Click ‘Educational level’ and ‘Beginning Click ‘Educational level’ and ‘Beginning
Salary,’ and put it into the variable box.Salary,’ and put it into the variable box. Click OptionsClick Options
Click
DescriptivesDescriptives The options allows you to analyze other The options allows you to analyze other
descriptive statistics besides the mean and Std.descriptive statistics besides the mean and Std. Click ‘variance’ and ‘kurtosis’Click ‘variance’ and ‘kurtosis’ Finally click ‘Continue’Finally click ‘Continue’
Click
Click
Descriptive StatisticsDescriptive Statistics Finally Click OK in the Descriptives box. You will
be able to see the result of the analysis.
Regression AnalysisRegression Analysis
Click ‘Analyze,’ ‘Regression,’ then click ‘Linear’ from the main menu.
Regression AnalysisRegression Analysis
For example let’s analyze the model Put ‘Beginning Salary’ as Dependent and ‘Educational Level’ as
Independent.
εββ ++= edusalbegin 10
ClickClick
Regression AnalysisRegression Analysis Clicking OK gives the result
Plotting the regression linePlotting the regression line Click ‘Graphs,’ ‘Legacy Dialogs,’
‘Interactive,’ and ‘Scatterplot’ from the main menu.
Plotting the regression linePlotting the regression line Drag ‘Current Salary’ into the vertical axis box
and ‘Beginning Salary’ in the horizontal axis box. Click ‘Fit’ bar. Make sure the Method is
regression in the Fit box. Then click ‘OK’.
ClickSet this to Regression!
Practice 5Practice 5 Find out whether or not the previous
experience of workers has any affect on their beginning salary? Take the variable “salbegin,” and
“prevexp” as dependent and independent variables respectively.
Plot the regression line for the above analysis using the “scatter plot” menu.
AnswerAnswer
Click
Click on the “fit” tab to make sure the method is regression
Data Entry (import from Excel)
SPSS- Tutorial- Sample Files
Data Entry (import from Excel)16. Select the worksheet, the range (if desired), and if to read variable names- click OK
The data and variable names will appear
Running Analyses17. With SPSS open, select file- Open- Data
Running Analyses (Frequency)19. Select Analyze- Descriptive Stats- Frequencies
20. Select the desired variables and click the arrow to move them to the right side
Running Analyses (Frequency)
Running Analyses (Frequency)
Running Analyses (Frequency)Result Tables and Graphs will appear
Running Analyses (Frequency)Result Tables and Graphs will appear
Running Analyses (Central Tendency)
Results will appear
27. Select some measures of central tendency and dispersion- click Continue then OK
Find differences between groupsFind differences between groups1. Click Analyze- Descriptive Stats- Explore
2. Move a scale variable to dependent, move the category variable to factor- click Statistics
Find differences between groupsFind differences between groups3. Select Descriptors- click continue- click Plots
4. Select the following- click Continue
Find differences between groupsFind differences between groups5. Click OK
The results will appear
Running Analyses (t- test)Running Analyses (t- test)
6. Click Analyze- Compare Means- Independent Samples t test
7. Select the test variable and the grouping variable, then click Define Groups
Running Analyses (t- test)Running Analyses (t- test)
9. Select OK
8. Label the groups (in this case f or m)
Running Analyses (t- test)Running Analyses (t- test)
The results will appear
Running Analyses (ANOVA)Running Analyses (ANOVA)10. Click Analyze- Compare Means-
One-Way ANOVA
11. Move the Numerical variable to the dependent list and move the categorical variable to the Factor list
Running Analyses (ANOVA)Running Analyses (ANOVA)
12. Click Options
13. Select Descriptive then Continue- then select PostHoc…
Running Analyses (ANOVA)Running Analyses (ANOVA)
14. Select Tukey then Continue
15. Click OK
Running Analyses (ANOVA)Running Analyses (ANOVA) Results will appear
The stars tell you where the significant differences occur
Creating ChartsCreating Charts
17. Move the variables to the right side and then click Charts
16. Click Descriptive Stats- Frequencies
The simplest way to make a chart is to create it as you are running an analysis (not always possible)
Creating ChartsCreating Charts
19. Click OK
18. Select the appropriate options and then click continue
Creating ChartsCreating Charts
20. Double click the chart to open the chart editor
The chart will appear in the
output window
Creating ChartsCreating ChartsYou get edit options by double clicking on an item. The changes are automatically added to the output
page once you close the chart editor
Table EditTable Edit21. Right click on any table- select SPSS Pivot Table Object- Open
22. In the Pivot table window, click Table looks
Export Charts and Graphs to WordExport Charts and Graphs to Word
The steps for charts and graphs are the same.
30. Right click on the chart and select copy.
31. In the correct location in the Word document, right click and select paste.
Export Charts and Graphs to WordExport Charts and Graphs to Word
The chart will appear in an editable format in the document.
Export Charts and Graphs to WordExport Charts and Graphs to Word32. To edit a pasted graph, right click the graph and click Edit Picture.
ResourcesResources Indiana University- Getting Started (useful instructions with screenshots)Indiana University- Getting Started (useful instructions with screenshots)
http://http://www.indiana.edu/~statmath/stat/spss/winwww.indiana.edu/~statmath/stat/spss/win//
UCLA- SPSS 12.0UCLA- SPSS 12.0 Starter Kit (useful movies, FAQs, etc) Starter Kit (useful movies, FAQs, etc) http://http://www.ats.ucla.edu/stat/spss/sk/default.htmwww.ats.ucla.edu/stat/spss/sk/default.htm
Texas A & M- a huge selection of helpful movies Texas A & M- a huge selection of helpful movies http://http://www.stat.tamu.edu/spss.phpwww.stat.tamu.edu/spss.php
University of Toronto- A Brief Tutorial (screenshots, instructions and basic University of Toronto- A Brief Tutorial (screenshots, instructions and basic stats)stats)http://www.psych.utoronto.ca/courses/c1/spss/page1.htmhttp://www.psych.utoronto.ca/courses/c1/spss/page1.htm
SPSS Statistics Coach and Tutorial (under Help) as well as the ZU librarySPSS Statistics Coach and Tutorial (under Help) as well as the ZU library
Online Statistics TextbookOnline Statistics Textbookhttp://http://www.statsoft.com/textbook/stathome.htmlwww.statsoft.com/textbook/stathome.html
For further Questions:[email protected]