SMG ITS SPSS Handout Insurance

SMG ITS SPSS TUTORIAL
Spring 2015
GETTING STARTED
To get started in SPSS, the first thing you’ll need to do is open a data file. Open our
sample data file insurance_claims.sav
There are two ways to look at your data in SPSS:
 DATA VIEW – shows the actual data (i.e., responses to your survey)
 VARIABLE VIEW – shows names and properties of all of your variables:
o This is where you can type in your survey questions and the value for
each response (i.e., 1 = strongly agree, 2 = agree, etc.)
o You can change variable type (ordinal, nominal, scale)
▪ There are different types of data - make sure you know which
type of data you are using, as different data types are suitable
or different analyses.
● Nominal level data - categorized using names or labels;
qualitative analyses only
● Ordinal level data - data arranged in order, differences
between entries are not meaningful; qualitative and
quantitative analyses
● Scale level data - data arranged in order, differences
between entries can be calculated; quantitative
analyses
You’ll notice that as soon as you open the data set, another window labeled Output
will open as well. This is where your charts and graphs will open, and you’ll be able
to track your progress throughout your analysis.
SPSS is also capable of importing data from other programs. To import from Excel
click File > Open > Data and select Open File of Type (EXCEL) from the drop down.
Select the Excel file and SPSS will display a dialog box asking for the range of data
you wish to import. If the Excel file contains multiple worksheets you must select
the one you wish to work with. If you wish to import all of the data from the
worksheet then leave the range field blank.
1
SMG ITS SPSS TUTORIAL
Spring 2015
PART 1: VARIABLES
Goal: Understanding how to view and use the variable view
Creating a new variable
1. Navigate to Variable View in your data editor.
2. Scroll down to the bottom, and click in the first empty cell in the Name
column to begin entering a new variable.
3. Name your variable whatever you’d like. You’ll notice that as soon as you
name the variable, many of the other variable fields for the new variable will
auto-populate.
4. Click through the variable fields to see what each of them do.
2
SMG ITS SPSS TUTORIAL
Spring 2015
Transforming a Variable
1. Select the Transform menu
2. Select Compute Variable
3. Name the target variable lincome
4. From the Function group menu select Arithmetic and then Ln
5. Press the up arrow to move it to the Numeric Expression box
6. Select income for the input variable, and press the arrow to add it to the
equation.
7. Press okay
3
SMG ITS SPSS TUTORIAL
Spring 2015
Combining Different Variables
Suppose you want to classify your data by car size. To do this you want to divide
your data into four categories. “Small”, “Midsize”, “Large”, and Oversize”
1. To categorize the data select the Transform menu and click Recode into
Different Variables
2. Select Income from the variable list and name the output variable bracket
then click Change
3. Click Old and New Values to define the ranges for each category.
4.
5.
6.
7.
Check Range lowest through value, enter 13 and then 1 for the New Value
Click Add to store and repeat for the rest of the tax brackets.
Click Continue and then OK
Select the Values tab for your new variable in the Variable View
15. Enter the names for the different tax brackets
4
SMG ITS SPSS TUTORIAL
Spring 2015
PART 2: DESCRIPTIVE STATISTICS OF YOUR DATA
Goal: Be able to calculate and store descriptive statistics
Running Descriptives
1. From the Analyze menu, click Descriptive Statistics and then click on
Descriptives.
2. Select Claim_amount and press the arrow to select the variable for analysis.
It will then appear in the ‘Variable(s)’ window.
3. Select Options.
4. In the Options menu, select Mean (for quantitative variables), maximum,
minimum, and standard deviation. Click Continue.
5. Check the Save standardized values as variables box to save the Zscore
6. Click OK.
7. The results of your query will appear in your Output window.
Running Frequencies
1. From the Analyze menu, click on Descriptive Statistics, and select
Frequencies.
2. Select the desired variable. From here, you have several options:
a. Press Statistics to determine which descriptive statistics you’d like
for your quantitative variables (mean, median, mode, dispersion, etc.).
b. Press Charts to determine how your data will be displayed (in a bar
chart, pie chart, or histogram).
5
SMG ITS SPSS TUTORIAL
Spring 2015
c. Press Format to select the order (ascending or descending) that your
information is displayed.
3. Press OK.
4. The results of your query will appear in your Output window.
5. Double-clicking on the bar chart in your Output window will open the Chart
editor, which can be used to edit or change chart attributes.
Running Crosstabs
1. From the Analyze menu, click on Descriptive Statistics.
2. Select Crosstabs.
3. Select a variable for “Row” and one or more for “Columns”.
4. Click Statistics, and select Chi-square. Click Continue.
5. Click Cells. This is where you can choose to display both the observed and
expected outcomes, as well as column and row percentages. Check the
desired settings, and click Continue.
6. Click OK.
7. In your output editor, you will see your Case Summary, your
Crosstabulation Chart, and a chart showing the results of your Chi-square
test. The Chi-square chart will tell you if the association between the
variables is statistically significant, and you can use the Crosstabulation chart
to determine what might be driving that association (if one exists).
6
SMG ITS SPSS TUTORIAL
Spring 2015
Graphical Representation
1. SPSS is widely used in part because of its strong graphical capabilities. In
order to create charts and graphs we will use a tool called the Chart Builder.
2. Go to Graphs>Chart Builder
3. Click through the pop-up if you’re sure of your data or click define variable
properties to adjust variable settings. This will automatically check variables
and make sure their data is consistent.
4. Use the Gallery tab to select the type of chart you wish to draw
5. From the gallery select one of the available designs and drag it to the canvas
above
6. From the Variables list select and drag the X and Y variables to their
respective positions
7. From the Element Properties window you can adjust statistics you want
displayed.
8. Click Okay to draw the graph.
7
SMG ITS SPSS TUTORIAL
Spring 2015
PART 3: STATISTICAL ANALYSES OF YOUR DATA
Goal: Understanding how to preform more advanced statistical analyses
Running a Correlation Analysis
1.
2.
3.
4.
5.
6.
From the Analyze menu, click Correlate, and choose Bivariate.
Select the appropriate variables.
Under Correlation Coefficients, choose either Pearson or Spearman.
Select Two-Tailed under Test of Significance
Select Flag Significant Correlations
Click Run.
Running a Regression Analysis
Regression analysis shows the relationship between an independent variable and
one or more dependent variables. In order to run a regression analysis, you must
first develop a regression model that includes the following steps:
● Identify a dependent variable
● Choose the independent variable(s)
● Run correlations among the variables
● Run the regression model(s)
● Interpret the output
To run a regression analysis in SPSS:
1. From the Analyze menu, choose Regression.
2. Select Linear.
3. Select lnsales as the dependent variables
4. Select price, engine size, horsepower, wheelbase, width, length, curb weight,
fuel capacity and fuel efficiency as the independent variables.
5. From Statistics select estimates, model fit, and Part and Partial correlations
6. Click OK
Interpreting the results of your regression analysis:
1. Check the R2 value. This will tell you the proportion of variation in the
dependent variable that is explained by the independent variables.
2. Is the regression model significant? In order to be significant, ANOVA F-test
results must be p<0.05.
3. Examine the standardized betas and their significance level. To be significant,
p<0.05, or t>2.
4. Use the relative size of the significant standardized betas to arrive at
substantive conclusions.
5. Determine the direction of the relationship.
6. Interpret the coefficients of dummy variables.
8
SMG ITS SPSS TUTORIAL
Spring 2015
Automatic Linear Modeling
SPSS has an advanced feature known as Automatic Linear Modeling, which is used
to simplify the process of creating regression models. The data is automatically
prepared and a model is created based on what SPSS thinks is best. The most useful
part of this feature is the in depth graphical report that is created which is designed
to be easier to read than the normal regression output.
1. From the Analyze menu, choose Regression
2. Select Automatic Linear Modeling
3. Move the variables Cost of Claims in Thousands from predictors to fields and
then to Target
4. Click Run
The first page of the report summarized how accurate the model’s predictions are.
This is used to compare one model to another.
The third page provides a quick overview of the most important predictors
9
SMG ITS SPSS TUTORIAL
Spring 2015
The fourth page plots the actual values versus the predicted values from the model.
This helps visualize the data and determine if any transformation is needed.
The seventh page is a visualization of the ANOVA table. The full table can be
accessed by selecting table from the styles menu.
10
SMG ITS SPSS TUTORIAL
Spring 2015
The eighth page is a visualization of the coefficients for each predictor. Select table
from styles to see the full table.
11