Chapter 4
Statistical Analysis Using SPSS
4. 1 Analysis of cross-classifications Measure of Associations
The Crosstabs procedure forms two-way and multi-way tables and provides a variety of tests and
measures of association for two-way tables. The Crosstabs procedure offers tests of
independence and measures of association and agreement for nominal and ordinal data. You
can also test for significant differences in column proportions in the cross-tabulation table. For
example, in order to determine customer satisfaction rates, a retail company conducted surveys
of 582 customers at 4 store locations. From the survey results, you found that the quality of
customer service was the most important factor to a customer's overall satisfaction. Given this
information, you want to test whether each of the store locations provides a similar and adequate
level of customer service. The results of the survey are stored in [Link]. Use the Crosstabs
procedure to test the hypothesis that the levels of service satisfaction are constant across stores.
To run a Crosstabs analysis, from the menus choose:
Analyze Descriptive Statistics Crosstabs... ……..
Output of SPSS
Chi-Square Tests
Value df Asymp. Sig. (2-sided)
Pearson Chi-Square 16.293a 12 .178
Likelihood Ratio 17.012 12 .149
Linear-by-Linear Association .084 1 .772
N of Valid Cases 582
a. 0 cells (0.0%) have expected count less than 5. The minimum expected count is 21.73.
The two-sided asymptotic significance of the chi-square statistic is greater than 0.05, so it is
safe to say that the differences are due to chance variation, which implies that each store offers
the same level of customer service .
Chi-Square test
Although examination of the various row and column percentages in a cross-tabulation is a
useful first step in studying the relationship between two variables, row and column percentages
do not allow for qualification or testing of that relationship. For these purposes, it is useful to
consider various indexes that measure the extent of association as well as statistical tests of the
hypothesis that is no association. Therefore, the Chi Square Statistic is used to measure the
association of the row and column variables. The chi-square test measures the discrepancy
1
between the observed cell counts and what you would expect if the rows and columns were
unrelated.
For tables with two rows and two columns, select Chi-square to calculate the Pearson chi-
square, the likelihood-ratio chi-square, Fisher's exact test, and Yates' corrected chi-square
(continuity correction). For 2 × 2 tables, Fisher's exact test is computed when a table that does
not result from missing rows or columns in a larger table has a cell with an expected frequency
of less than 5. Yates' corrected chi-square is computed for all other 2 × 2 tables. For tables with
any number of rows and columns, select Chi-square to calculate the Pearson chi-square and the
likelihood-ratio chi-square. When both table variables are quantitative, Chi-square yields the
linear-by-linear association test.
To produce a chi-square measure, in the crosstabs dialog box click on the statistics... push
button and check in the chi-square check box and then, continue.
Example:Use the Crosstabs procedure to test the hypothesis that the levels of service satisfaction
are constant across stores (use dataset “[Link]”)
Chi-Square Tests
Value df Asymp. Sig. (2-sided)
Pearson Chi-Square 16.293a 12 .178
Likelihood Ratio 17.012 12 .149
Linear-by-Linear Association .084 1 .772
N of Valid Cases 582
a. 0 cells (0.0%) have expected count less than 5. The minimum expected count is 21.73.
The two-sided asymptotic significance of the chi-square statistic is greater than 0.05, so it is
safe to say that the differences are due to chance variation, which implies that each store offers
the same level of customer service.
4.2 Statistical Inference for Populations
Statistical methods are divided into two main areas: Descriptive and inferential statistics.
Descriptive statistics describes data (for example, a chart or graph) and inferential statistics
allows you to make predictions (“inferences”) from that data. With inferential statistics, you take
data from samples and make generalizations about a population. For example, you might stand in
a mall and ask a sample of 100 people if they like shopping at Sears. You could make a bar chart
of yes or no answers (that would be descriptive statistics) or you could use your research (and
inferential statistics) to reason that around 75-80% of the population (all shoppers in all malls)
like shopping at Sears.
4.2.1 Inferential Statistics
2
Statistical inference is the process of using the characteristics of a sample to make statements
about the population from which it is drawn.
There are two main areas of inferential statistics:
Estimating parameters. This means taking a statistic from your sample data (for example the
sample mean) and using it to say something about a population parameter (i.e. the population
mean).
Hypothesis tests. This is where you can use sample data to answer research questions. For
example, you might be interested in knowing if a new cancer drug is effective. Or if breakfast
helps children perform better in schools.
. For example: Mean: sample mean estimates population mean.
Standard deviationt: Sample standard deviation estimates population standard deviation.
Estimate
Point estimate interval estimate
An estimator of a population parameter is a sample statistic used to estimate or predict the
population parameter.
A point estimate is a single value used as an estimate of a population parameter.
The objective of estimation is to determine the approximate value of a population parameter on
the basis of a sample statistic.
For example, suppose we want to estimate the mean income of statistics students. For n=25
students, the mean income is calculated to be = 40 $/week(point estimate)
Let say, the mean income is between 380 and 420 $/week(interval estimate).
Note:Point estimate is always within the interval estimate
Property of a good estimator
• It should be unbiased: The expected value of the estimator must be equal to the
parameter to be estimated.
• It should be consistent: as the sample size increase, the value of the estimator should
approaches to the value of the parameter estimated.
• It should be efficient: the variance of the estimator is the smallest.
3
• It should be sufficient: the sample from which the estimator is calculated must contain
the maximum possible information about the population.
Hypothesis Testing
Some common terms
A hypothesis is a statement or assertion about the parameter of population (about the true
value of an unknown population parameter).
A statistical test is a statistical rule by which a statistical hypothesis is accepted or
rejected.
p-value: The probability of a test statistic (assuming the null hypothesis to be true). If this
value is very small (e.g. 0.02763) then we reject the null hypothesis. We claim a
significant effect if the p value is smaller than a conventional significance level (such as
0.05). There are two types of hypotheses. i.e Null & Alternative Hypotheses .
• H0 : Null Hypothesis states the Assumption to be tested e
• H1 : Alternative Hypothesis is the opposite of the null. It may or may not be accepted
and it is the hypothesis that is believed to be true by the researcher
General Steps in Hypothesis Testing
1. State the H0
2. State the H1 5. Compute test statistic and p-value
3. Choose α 6. Make statistical decision
4. Set up critical value(s) 7. Express conclusion
4.2 Testing of Hypothesis About One Population Mean
The t-test may be:
1. The one sample t-test
2. The independent samples t-test
3. The paired t-test
One-Sample T-Test
The one-sample t test can be used whenever sample means must be compared to a known test
value. The one-sample t test assumes that the data be reasonably normally distributed. The One-
Sample t-test procedure tests whether the mean of a single variable differs from a specified
constant.
4
To perform One sample t-test:Analysis ® Compare Means ® One Samples t-test
Example 1: A manufacturer of high-performance automobiles produces disc brakes that must
measure 322 millimeters in diameter. Quality control randomly draws 16 discs made by each of
eight production machines and measures their diameters. This example uses the
file “[Link]”. Use One Sample T Test to determine whether or not the mean diameters of the
brakes in each sample significantly differ from 322 millimeters.
Select Brakes as the test variableType 322 as the test value….
The output of the above procedure is given as follows.
One-Sample Statistics
Machine Number N Mean Std. Deviation Std. Error Mean
1 Disc Brake Diameter (mm) 16 321.998514 .0111568 .0027892
2 Disc Brake Diameter (mm) 16 322.014263 .0106913 .0026728
3 Disc Brake Diameter (mm) 16 321.998283 .0104812 .0026203
4 Disc Brake Diameter (mm) 16 321.995435 .0069883 .0017471
5 Disc Brake Diameter (mm) 16 322.004249 .0092022 .0023005
6 Disc Brake Diameter (mm) 16 322.002452 .0086440 .0021610
7 Disc Brake Diameter (mm) 16 322.006181 .0093303 .0023326
8 Disc Brake Diameter (mm) 16 321.996699 .0077085 .0019271
The Descriptives table displays the sample size, mean, standard deviation, and standard error for
each of the eight samples. The sample means disperse around the 322mm standard by what
appears to be a small amount of variation.
The test statistic table shows the results of the one-sample t test.
The t column displays the observed t statistic for each sample, calculated as the ratio of the mean
difference divided by the standard error of the sample mean.
The df column displays degrees of freedom. In this case, this equals the number of cases in each
group minus 1.
One-Sample Test
Machine Number Test Value = 322
t df Sig. (2- Mean Difference 95% Confidence Interval
tailed) of the Difference
Lower Upper
1 Disc Brake Diameter (mm) -.533 15 .602 -.0014858 -.007431 .004459
2 Disc Brake Diameter (mm) 5.336 15 .000 .0142629 .008566 .019960
3 Disc Brake Diameter (mm) -.655 15 .522 -.0017174 -.007302 .003868
4 Disc Brake Diameter (mm) -2.613 15 .020 -.0045649 -.008289 -.000841
5 Disc Brake Diameter (mm) 1.847 15 .085 .0042486 -.000655 .009152
5
6 Disc Brake Diameter (mm) 1.134 15 .274 .0024516 -.002154 .007058
7 Disc Brake Diameter (mm) 2.650 15 .018 .0061813 .001210 .011153
8 Disc Brake Diameter (mm) -1.713 15 .107 -.0033014 -.007409 .000806
The column labeled Sig. (2-tailed) displays a probability from the t distribution with 15 degrees
of freedom. The value listed is the probability of obtaining an absolute value greater than or
equal to the observed t statistic, if the difference between the sample mean and the test value is
purely random.
The Mean Difference is obtained by subtracting the test value (322 in this example) from each
sample mean.
The 95% Confidence Interval of the Difference provides an estimate of the boundaries between
which the true mean difference lies in 90% of all possible random samples of 16 disc brakes
produced by this machine.
Since their confidence intervals lie entirely above 0.0, you can safely say that machines 2, 5 and
7 are producing discs that are significantly wider than 322mm on the average.
Exercise 1: Consider the [Link] data and test whether the house hold income in thousand is
statistically different from 60.
Independent-Samples T Test
The Independent-Samples T Test procedure compares means for two groups of cases. Ideally,
for this test, the subjects should be randomly assigned to two groups, so that any difference in
response is due to the treatment (or lack of treatment) and not to other factors. This is not the
case if you compare average income for males and females. A person is not randomly assigned
to be a male or female. In such situations, you should ensure that differences in other factors
are not masking or enhancing a significant difference in means. Differences in average income
may be influenced by factors such as education (and not by sex alone).
In short:
The Independent-Samples T Test procedure tests the significance of the difference between two
sample means. Also displayed are:
• Descriptive statistics for each test variable
• A test of variance equality
• A confidence interval for the difference between the two variables (95% or a value you
specify)
6
Example 2: An analyst at a department store wants to evaluate a recent credit card promotion.
To this end, 500 cardholders were randomly selected. Half received an ad promoting a reduced
interest rate on purchases made over the next three months, and half received a standard
seasonal.
Output
Independent Samples Test
Equal variances assumed (check the pivot option and select pivot for the assumptions of equality of variance)
Levene's Test for t-test for Equality of Means
Equality of
Variances
F Sig. t df Sig. (2- Mean Std. Error 95% Confidence Interval
tailed) Difference Difference of the Difference
Lower Upper
$ spent during
promotional 1.190 .276 -2.260 498 .024 -71.11095 31.45914 -132.91995 -9.30196
period
a. Since the significance value of the test is less than 0.05, you can safely conclude that
the average of 71.11 dollars more spent by cardholders receiving the reduced interest
rate is not due to chance alone. The store will now consider extending the offer to all
credit customers.
b. The 95% Confidence Interval of the Difference provides an estimate of the boundaries
between which the true mean difference lies in 95% of all possible random samples of
500 cardholders.
Activity 2: consider the [Link] data and test whether the current salary is statistically
significant for the
a. minority classifications?
b. between male and female?
Paired t-test
One of the most common experimental designs is the "pre-post" design. A study of this type
often consists of two measurements taken on the same subject, one before and one after the
introduction of a treatment or a stimulus. The basic idea is simple. If the treatment had no effect,
7
the average difference between the measurements is equal to 0 and the null hypothesis holds. On
the other hand, if the treatment did have an effect (intended or unintended!), the average
difference is not 0 and the null hypothesis is rejected.
The Paired-Samples T Test procedure is used to test the hypothesis of no difference between two
variables. The data may consist of two measurements taken on the same subject or one
measurement taken on a matched pair of subjects.
Additionally, the procedure produces:
• Descriptive statistics for each test variable
• The Pearson correlation between each pair and its significance
• A confidence interval for the average difference (95% or a value you specify)
Example 3: A physician is evaluating a new diet for her patients with a family history of heart
disease. To test the effectiveness of this diet, 16 patients are placed on the diet for 6 months.
Their weights are measured before and after the study, and the physician wants to know if either
set of measurements has changed.
This example uses the file [Link]. Use Paired-Samples T Test to determine whether there
is a statistically significant difference between the pre- and post-diet weights of these patients.
Results
Paired Samples Statistics
Mean N Std. Deviation Std. Error Mean
Weight 198.38 16 33.472 8.368
Pair 1
Final weight 190.31 16 33.508 8.377
a. The subjects clearly lost weight over the course of the study; on average, about 8 pounds.
Paired Samples Correlations
N Correlation Sig.
Pair 1 Weight & Final weight 16 .996 .000
b. the Pearson correlation between the baseline and six-month weight measurements is 0.996,
almost a perfect correlation.
Paired Samples Test
Paired Differences t df Sig. (2-
Mean Std. Std. Error 95% Confidence Interval of tailed)
Deviation Mean the Difference
Lower Upper
8
Pair 1 Weight - Final weight 8.063 2.886 .722 6.525 9.600 11.175 15 .000
c. The Mean column in the paired-samples t test table displays the average difference in weight
measurements before the diet and six months into the diet.
d. The 95% Confidence Interval of the Difference provides an estimate of the boundaries
between which the true mean difference lies in 95% of all possible random samples of 16
patients similar to the ones participating in this study
e. Since p-value is less than alpha, we reject the null hypothesis, implies that there is a grat
difference between means, you can also check from the confidence interval.
Activity 3: consider the [Link] data and test whether there is a significant difference
between the beginning and current salary of employees.
4.3 ANOVA
The analysis of variance (ANOVA) is the most widely used method of statistical analysis of
quantitative data that come from agriculture. It is closely related to Student's t-test, but whereas
the t-test is only suitable for comparing two treatment means the ANOVA can be used both for
comparing several means and in more complex situations.
The ANOVA partitions the total variation into a number of parts such as Treatment, Block, Error
and Total, depending on the design of the experiment.
An analysis of Variance (ANOVA) is used to test the null hypothesis that several population
means are equal. It examines the variability of the observation within each group as well as the
variability between the group means. Based on these two estimates of variability, you draw
conclusions about the population means.
4.3.1 One-Way ANOVA
The One-Way ANOVA procedure produces a one-way analysis of variance for a quantitative
dependent variable by a single factor (independent) variable. Analysis of variance is used to test
the hypothesis that several means are equal. This technique is an extension of the two-
independent sample t [Link] addition to determining that differences exist among the means, you
may want to know which means differ. Post hoc tests is a type of test.
An important first step in the analysis of variance is establishing the validity of assumptions. One
assumption of ANOVA is that the variances of the groups are equivalent.
To test the equality of variance assumption, from the menus choose:
Analyze Compare Means One-Way ANOVA...Select the dependent variable and the
factor variableOptions.
9
4.4 Correlation and Linear Regression
Correlation
Correlation is “a statistical technique used to determine the relationship between two or more
variables”. We use two different techniques to determine score relationships: graphing technique
and mathematical technique called correlation
The values of the coefficient will always range from +1 to -1.
A correlation coefficient near 0 indicates no relationship.
Types of Relationships
“R” indicates…strength of relationship (strong, weak, or none) direction of relationship positive
(direct) – variables move in same direction negative (inverse) – variables move in opposite
directions.
A scatter plot (or scatter diagram) is used to show the relationship between two variables.
Correlation Coefficient
The correlation coefficient ρ (rho) measures the strength of the association between the variables.
Properties of Correlation Coefficient.
10
• Unit free
• Range between -1 and 1
• The closer to -1, the stronger the negative linear relationship
• The closer to 1, the stronger the positive linear relationship
• The closer to 0, the weaker the linear relationship
Hypothesis testing with Correlations
Ho: ρ = 0 (no actual correlation)
Ha: ρ ≠ 0 (there is some correlation)
Example 4: In order to increase sales, motor vehicle design engineers want to focus their
attention on aspects of the vehicle that are important to customers--for example, how important
is fuel efficiency with respect to sales? One way to measure this is to compute the correlation
between past sales and fuel efficiency.
Information concerning various makes of motor vehicles is collected in car_sales.sav. Use
Bivariate Correlations to measure the importance of fuel efficiency to the salability of a motor
vehicle.
Opendata[Link]
Analyze Correlate Bivariate...
Results
Correlations
Sales in thousands Fuel efficiency
Pearson Correlation 1 -.017
Sales in thousands Sig. (2-tailed) .837
N 157 154
Pearson Correlation -.017 1
Fuel efficiency Sig. (2-tailed) .837
N 154 154
The Pearson correlation coefficient measures the linear association between two scale variables.
However, the Pearson correlation coefficient works best when the variables are approximately
normally distributed and have no outliers. A scatter plot can reveal these possible problems.
11
Regression
To use this model, the response variable should be quantitative; the predictor variable can be
either qualitative or quantitative. Linear regression is used to model the value of a dependent
scale variable based on its linear relationship to one or more predictors; Linear Regression
estimates the coefficients of the linear equation, involving one or more independent variables
that best predict the value of the dependent variable.
Dependent variable: the variable we wish to explain.
Independent variable: the variable used to explain the dependent variable.
For example, you can try to predict a sales person's total yearly sales (the dependent variable)
from independent variables such as age, education background, and years of experience. The
linear regression model assumes that there is a linear, or "straight line," relationship between the
dependent variable and each predictor.
Simple Linear Regression Model
• Only one independent variable,x
• Relationship between x and y(dependent variable) is described by a linear function
• Changes in y are assumed to be caused by changes in x
y=β 0 +β 1 x+ε
Interpretation of the Slope and the Intercept
• β0 is the estimated average value of y when the value of x is zero.
• β1 is the estimated change in the average value of y as a result of a one-unit change in x.
Multiple Regression Models
Relationship between one dependent & two or more independent variables is a linear function.
Y = b0 + b1x1 + b2x2 + ... + bPxP + e
b0 = y-intercept {a constant value}
b1 = slope of Y with variable x1 holding the variables x2, x3, ..., xP effects constant
bP = slope of Y with variable xP holding all other variables’ effects constant
The model is linear because increasing the value of the jth predictor by 1 unit increases/decreases
the value of the dependent by β j units. Note that βo the intercept, the model-predicted value of
the dependent variable when the value of every predictor is equal to 0.
12
For the purpose of testing hypotheses about the values of model parameters, the linear regression
model also assumes the following:
a. The error term has a normal distribution with a mean of 0.
b. The variance of the error term is constant across cases and independent of the variables in
the model. An error term with non-constant variance is said to be heteroscedastic.
c. The value of the error term for a given case is independent of the values of the variables in
the model and of the values of the error term for other cases.
1. Analyzeregressionlinearselect dependent and the independent variables
2. Click over statistics and select over estimates, confidence interval and model fits
Coefficient of Determination (R2)
The coefficient of determination is the portion of the total variation in the dependent variable that
is explained by variation in the independent variable. The coefficient of determination is the
square of the correlation coefficient (r). For example, if the correlation coefficient between two
variables is r = 0.90, the coefficient of determination is (0.90)2 = 0.81
Example: look the “[Link]” data and let’s consider the sales in thousand is the dependent
variable and the rest are independent. Then
a. Test each parameters or coefficients
b. find the final fitted regression model
Step in SPSS
1. Open [Link] data
2. Analyzeregressionlinearelect sales in thousands in dependent variables and the rest
in the independent
3. Click over statistics and select over estimates, confidence interval and model fits
Results
Model Summary
Model R R Square Adjusted R Std. Error of
Square the Estimate
1 .582a .339 .292 57.996266
a. Predictors: (Constant), Fuel efficiency, Length, Price in
thousands, Vehicle type, Width, Engine size, Fuel
capacity, Wheelbase, Curb weight, Horsepower
13
As a whole, the regression doesn’t a good job of modeling sales. Only 33.5% of the variation in
sales is explained by the model.
Coefficientsa
Model Unstandardized Coefficients Standardized t Sig. 95.0% Confidence Interval for
Coefficients B
B Std. Error Beta Lower Bound Upper Bound
(Constant) -348.125 160.629 -2.167 .032 -665.676 -30.573
Vehicle type 45.201 19.385 .290 2.332 .021 6.878 83.523
Price in thousands .100 .756 .021 .132 .895 -1.395 1.595
Engine size 31.811 11.157 .484 2.851 .005 9.754 53.869
Horsepower -.491 .248 -.405 -1.983 .049 -.981 -.002
1
Wheelbase 3.723 1.367 .417 2.724 .007 1.021 6.425
Width .846 2.434 .042 .347 .729 -3.967 5.658
Length .761 .829 .149 .917 .361 -.879 2.401
Curb weight -63.752 20.498 -.589 -3.110 .002 -104.275 -23.228
Fuel capacity -1.104 2.760 -.063 -.400 .690 -6.560 4.353
Fuel efficiency .561 2.352 .035 .238 .812 -4.090 5.211
a. Dependent Variable: Sales in thousands
The variables whose [Link] are bold is the significant variables. There are several non-
significant coefficients, indicating that these variables do not contribute much to the model.
14