You are on page 1of 50

ABR-Quantitative

Data Analysis – Tests of Differences


Hypothesis Tests Related to Differences
Tests of Differences: T Statistic
• t test: A univariate hypothesis test using the t distribution, which is
used when the standard deviation is unknown and the sample size is
small.
• t statistic: A statistic that assumes that the variable has a symmetric
bell-shaped distribution, the mean is known (or assumed to be
known), and the population variance is estimated from the sample.
• t distribution: A symmetric bell-shaped distribution that is useful for
small sample (n < 30) testing, when the mean is known and the
population variance is estimated from the sample.
Tests of Differences: T Statistic

• Parametric tests assume that the variables of interest are measured on at least
an interval scale.
• The most popular parametric test is the t test used for examining the
hypotheses about means.
• t Statistics (aka student t-test)
• Assumption: Random variable X is normally distributed with mean μ and unknown
population variance σ2, which is estimated by the sample variance s2 . The standard
deviation of the sample mean is estimated as Sx = S / √n.

t
 x  
• Then is t distributed with (n - 1) degrees of freedom.
sx
• For large samples of 30 or more the t distribution is similar to a normal distribution.
Comparing t and z
distributions

The normal distribution assumes


that the population standard
deviation is known.
The t-distribution does not make
this assumption. The
t-distribution is defined by the
degrees of freedom. These are
related to the sample size.
T Statistic: Procedure
1. Formulate the null (H0) and alternate (H1) hypotheses.
2. Select the appropriate formula for the t statistic.
3. Select the significance level (e.g. 95%).
4. Take one or two samples and calculate the mean and standard
deviation for each sample.
5. Calculate the t statistic assuming H0 is true.
6. Calculate the degrees of freedom and estimate the probability p of
getting a more extreme value of the statistic from the table for t
distribution
7. If p ˂ α, reject H0 (where α = .05 with 95% confidence interval)
T Statistic – One Sample
• Assumptions:
• The dependent variable must be continuous
(interval/ratio).
• The observations are independent of one another.
• The dependent variable should be approximately
normally distributed.
• The dependent variable should not contain any
outliers.
Some Examples with One Sample Only
When making strategic and tactical plans, marketers may wish to know if:
• The market share for a new product will exceed 15 percent;
H0: μ ≤ 15%; Ha: μ ˃ 15%
• at least 65 percent of customers will like a new package design;
H0: μ ˃ 65%; Ha: μ ≤ 65%
• 80 percent of dealers will prefer the new pricing policy.
H0: μ ≠ 80%; Ha: μ = 80%
• These statements can be translated to null hypotheses that can be tested
using a one-sample test, such as the t test or the z test.
• In the case of a t test for a single mean, the researcher is interested in testing
whether the population mean conforms to a given hypothesis (H0).
Working Example: Data File: Attitude towards tATT_iATT.sav

• Test the hypothesis that the mean familiarity rating exceeds 4.0, the
neutral value on a 7-point scale, that is, we want to see whether
there is familiarity, in general, about internet.
H0 : μ ≤ 4
H a: μ ˃ 4
Normality Check
Analyze Descriptive Statistics Explore
• Select continuous dependent variable (familiar)
• In ‘Plots’, select ‘Normality plots with tests’.
• Select ‘Both’ in Display. Press OK.

• Also the following:


Analyze Descriptive Statistics Frequencies
• Select continuous dependent variable (familiar)
• In ‘Charts’ select ‘Histograms’ and tick ‘Show normal curve on histogram’.
• Click continue then click OK.
K-S test reports that sample distribution is
significantly different from normal
distribution (p = .003), therefore, it is not
equal to normal distribution.

Is it an estimation of normal then?


Normal Q-Q plot shows the distribution of the data No outliers. Negatively skewed: more data towards
against the expected normal distribution. For normally the left tail
distributed data, observations should lie approximately
on a straight line. Here, the observations are very close
to expected values
An approximation of normal
distribution?
Assuming Normal Distribution
Computation: One-Sample T Test
(Parametric Test)

Analyze Compare Means One Sample T Test

• Select continuous dependent variable (familiar)

• Specify the estimated value for population mean: in our case it is 4,


the mid-point of the scale
H0 : μ ≤ 4
H a: μ ˃ 4
Since p value (0.020) is less than 0.05 (α) we reject null hypothesis. the probability
Of getting a more extreme value than 2.471 is less than 0.05.

Reporting: With a positive t value, the data suggests a high level of familiarity
with internet usage (M = 4.72, SD = 1.579), t(28) = 2.470, p = .020.
Assuming that the Distribution is not Normal
Non-Parametric Alternative: One Sample: Wilcoxon Signed-Rank
Test
• Assumes data is on a continuous scale.
• Analyze Nonparametric Tests One Sample
• Under ‘Fields’ Select “Use custom field assignments” and in ‘Test Fields’
add Familiarity
• Under ‘Settings’ select “Customize tests” and choose “Compare median
to hypothesized (Wilcoxon signed-rank test).
• In “Hypothesized median” write 4.
• Click Run
• OR
• Analyze Nonparametric Tests Legacy Dialogs 1-Sample K-S
In both cases, with and without Lilliefors correction, the null
hypothesis of mean familiarity being less than or equal to 4
Is rejected.
One Sample Z-Test
• Not available on SPSS Copy-paste this text into new Syntax
**syntax created by how2stats
**This syntax performs a one sample z-test in SPSS
**Simply enter the four relevant values in the line below underneath the 'begin data' command
**The first number is the sample size (35), the second number is the sample mean (105),
**the third number is the population mean (100)
**and the fourth number is the population standard deviation (15)
**Replace the four values below with your own.
**The p value that is reported is based on a two-tailed test.
**To obtain the one-tailed p value, simply divide the two-tailed p value by 2.
**As an extra, this syntax also calcuates Cohen's d as estimate of effect size.

data list list / n sample_mean population_mean population_sd.


begin data
35 105 100 15
end data.

Compute mean_difference = sample_mean - population_mean.


Compute square_root_n =SQRT(n).
Compute standard_difference = population_sd/square_root_n.
Compute z_statistic = mean_difference/standard_difference.
Compute chi_square = z_statistic*z_statistic.
Compute p_value = SIG.CHISQ(chi_square, 1).
Compute cohens_d = mean_difference/population_sd.
EXECUTE.
Formats z_statistic p_value cohens_d (f8.5).
LIST z_statistic p_value cohens_d.
Independent Samples and Paired Samples
Examples: Independent samples examples
• In an experiment, subjects are assigned to two groups. Group 1 is exposed to
an ad copy of the brand with a humor appeal and Group 2 is exposed to an ad
copy with slice of life appeal. After the viewing, attitudes towards the brand
are measured on a Likert scale for both groups. A comparison is made to
evaluate which ad copy resulted in a more positive attitude towards the brand.
Each group is measured only once

• From a survey data, groups of users and non-users are identified and a
comparison is made to evaluate which group has a more positive attitude
towards the brand.
Each group is measured only once
Examples: Paired samples examples
• In an experiment, subjects’ attitude towards a product are measured at time
T1. Then they are given the product for use and their attitudes measured again
after a month, at time T2. A comparison is made to evaluate if there has been
a change in attitude after usage
Same group of people measured twice

• In a survey, respondents are measured on their level of awareness of a brand,


and also measured on their attitude towards the brand. A comparison is made
to evaluate whether high level of awareness is accompanied by more positive
attitude towards the brand
Same group of people measured twice
Independent Sample T Test: 2 Independent Groups
Independent Sample T Test: 2 Independent Groups
• Tests the difference between two means:
• Are males and females alike in their preferences?
• Do users and nonusers of a brand differ in terms of their perceptions of the
brand?
• Do high-income consumers spend more on entertainment than low-income
consumers?
• Is the proportion of brand-loyal users in segment I more than the proportion in
segment II.
• Independent means: each person has only been measured once
• Dependent variable is continuous scale, usually interval/ratio but often
ordinal as well (e.g. Likert)

• Alternative nonparametric test: Mann Whitney U test.


• You need two t values to calculate t test:
• Calculated t value
• Critical t value (from t distribution table with specific degrees of freedom)
• If calculated t value ≥ critical t value then reject the null hypothesis of
no differences in means of two independent populations (SPSS does
this for us)
H0 : μ 1 = μ 2 H1 : μ 1 = μ 2
Working Example: Data File: Attitude towards tATT_iATT.sav

• Suppose we wanted to determine whether Internet usage was different


for males as compared to females.
• A two-independent-samples t test will be conducted.
Analyze Compare Means Independent-Sample T Test
• Select ‘Internet Usage Hrs/Week in ‘Test variable/s’
• Select ‘Sex’ in ‘Grouping variable’
• Click ‘Define Groups’
• Write 1 for Males in ‘Group 1’ and 2 for Females in ‘Group 2’
• Click ‘OK’
The test first checks if both groups have equal variances Since p value (.000) is less than 0.05 (α) we reject null
through Levene’s test for equality of variances. Test hypothesis. the probability of getting a more extreme
Is more robust if variances are same. value than 4.492 is less than 0.05.
H0: Variances are equal. σm2 = σf2. Here, variances are Reporting: With a positive t value, the data suggests
Significantly different, therefore, we will look at data in that internet usage is significantly higher among males
the last line: Equal variances not assumed (M = 9.33, SD = 4.402) as compared to females (M =
3.87, SD = 1.685), t(18.014) = 4.492, p = .000.
Nonparametric Test for Independent-Sample t-test: Mann-
Whitney U (2 samples) Test
• H0 : μ M = μ F

Analyze Nonparametric tests Independent Samples


• Under ‘Fields’ and in “Test Fields” select ‘Internet usage Hrs/week’ and
in “Groups” select ‘Sex’
• Under ‘Settings’ select “Customize tests” and “Mann-Whitney U (2
samples)
• Click ‘Run’
Nonparametric Alternative: Reporting of Mann-Whitney U Test

• Ranks are not reported in Mann-Whitney U Test. You need to


calculate median:
Analyze Compare means Means
• In Dependent List box, add your continuous variable (e.g. Internet usage
Hrs/week).
• In Independent List box, add your categorical variable (e.g. sex).
• In Options, select Median in the Statistics section and move into the Cell
Statistics box.
• Remove Mean and Standard Deviation from the Cell Statistics box.
• Click on Continue.
• Click on OK
Reporting Mann-Whitney U Test:
A Mann-Whitney U Test revealed
significant difference in internet usage of
males (Md = 9, n =15) and females (Md =
3, n = 15), U = 31, z = –3.406, p = .000, r =
0.62.

Effect size: SPSS does not provide an effect size statistic, but the value of z that
is reported in the output can be used to calculate an approximate value of r.
r = z / square root of N where N = total number of cases.
Paired-Samples T Test: Same Sample 2 Measures
Paired-Samples T Test: Same Sample 2 Measures
• The two sets of observations relate to the same respondents.
• A sample of respondents may rate two competing brands, indicate the
relative importance of two attributes of a product, or evaluate a brand at
two different times.
• The difference in these cases is examined by a paired samples t test.
• H0 :μ1 – μ2 = 0;
• OR μ1 = μ2;
• OR μD = 0 where μD is the difference in means

• Nonparametric alternative: Wilcoxon test


Working Example: Data File: Attitude towards tATT_iATT.sav
• Do the respondents differ in their attitude toward the Internet and attitude
toward technology.
Analyze Compare Means Paired-Samples T Test
• Add ‘Attitude towards internet’ to ‘ ‘Variable 1’
• Add ‘Attitude towards technology’ to ‘Variable 2’
• Click ‘OK’
• Results show that the respondents have a more favorable attitude toward
the Internet as compared to technology in general.
• An implication, if this were a large and representative sample, would be that
Internet service providers should not hesitate to market their services to
consumers who do not have a very positive attitude toward technology and
do not consider themselves to be technologically savvy.
Positive correlation: higher scores on
one tend to be related to higher scores
on other. The larger the correlation,
and positive, the lower the standard
error would be in testing Hypothesis.

Reporting: Results indicate significant


differences between consumers’
attitude towards internet (M = 5.17;
SD = 1.234) and attitude towards
technology (M = 4.10; SD = 1.398), t
(29) = 7.059, p > 0.05
Nonparametric Alternative: Wilcoxon Signed
Rank Test
• Also referred to as the Wilcoxon matched pairs signed
ranks test) is designed for use with repeated measures
• Non-parametric alternative to paired samples t test
• Instead of comparing means the Wilcoxon converts
scores to ranks and compares them at Time 1 and at
Time 2 or for different characteristics of the same
sample
Wilcoxon Signed Rank Test-Example: tATT_iATT.sav
• Do the respondents differ in their attitude toward the Internet and
attitude toward technology.
• Analyze Nonparametric Tests Legacy Dialogs 2 Related Samples
• Variable 1: Attitude towards internet; Variable 2: Attitude towards
technology
• Make sure that the Wilcoxon box is ticked in the Test Type section.
• Click on the Options button. Choose Quartiles (this will provide the
• median scores for each time point).
• Click on Continue and then on OK
Npar Tests
Wilcoxon Signed Rank Test

Effect size calculation on next slide


Reporting: A Wilcoxon Signed Rank Test revealed a statistically significant
difference between attitude towards internet and attitude towards technology, z =
–4.207, p < .001, with a large effect size (r = .54). The median score on attitude
towards internet was higher (Md = 5) than the median score on attitude towards
technology (Md = 4).
Wilcoxon Signed Rank Test: Effect Size
• SPSS does not provide an effect size statistic, but the value
of z that is reported in the output can be used to calculate
an approximate value of r (ignoring the -, + signs).
• r = z / square root of N where N = the number of
observations over the two time points, not the number of
cases.
• In this example, Z = -4.207, N = (30+30); therefore r = .54,
indicating a large effect size using Cohen (1988) criteria of
.1 = small effect, .3 = medium effect, .5 = large effect.
Alternatively
Analyze Nonparametric Test Related Samples

Z value is the same as previously


Reporting is the same
One-Way Analysis of Variance (Between Groups)
One-Way Analysis of Variance (Between Groups)
• Tests for statistically significant differences between the means of two
or more independent (unrelated) groups
• Nonparametric alternative: Kruskal Wallis Test
• Omnibus test which tells us that at least two means are different but
does not specify which ones
• Like Kruskal Wallis, we need to conduct post hoc tests to specify
relationship
• Compares means of the groups and determines whether there are any
statistically significant differences
H0: µ1 = µ2 = µ3 =………= µk
where µ is the group mean and k is the number of groups.
Mutually exclusive unrelated groups
of participants split randomly
Mutually exclusive unrelated groups
of participants split on between-
subjects factor ’X’
One-Way ANOVA: Assumptions
• Dependent variable should be interval or ratio (i.e. continuous).
• Independent variable should consist of two or more categorical,
independent groups.
• There should be independence of observations: there should be no
relationship between the observations in each group or between the
groups themselves.
• Dependent variable should be approximately normally distributed
for each category of the independent variable.
• There needs to be homogeneity of variances.
What are we Doing in ANOVA
• Calculating differences in means of groups: between group variances: SSb
therefore degrees of freedom are k – 1 (where k = no. of groups)
• Calculating differences in means of participants in each group to account for
variance within group: SSw therefore degrees of freedom are N – K (where N
is the total sample size).
• These unsought variances will cause an error in our calculation of differences
between groups and increase the overall variance
Total variance = SSb + SSw with N – 1 degrees of freedom
In this design, within-group variability (SSw) is defined as the error variability (SSerror). Following
division by the appropriate degrees of freedom, a mean sum of squares for between-groups
(MSb) and within-groups (MSw) is determined and an F-statistic is calculated as the ratio of
MSb to MSw (or MSerror), as shown below:
Source SS Df MS F Sig.
Between SSb k-1 MSb = SSb / k-1 F = MSb / MSw p--value
Within SSw N-k MSw = SSw /N-k
Total SSb + SSw N-1

An example:
Source SS Df MS F Sig.*
Between 91.476 2 45.733 4.467 .021
Within 276.400 27 10.237
Total 367.867 29

Reporting: There was a statistically significant difference between


groups as determined by one-way ANOVA (F(2,27) = 4.467, p = .021).

*P-value calculator: http://www.socscistatistics.com/pvalues/fdistribution.aspx


One-Way ANOVA: SPSS Procedure 1
• Randomized post-test only with control group
R X1 O
R X2 O
R C O
(X1 – C) (X2 – C) (X1 – X2)
• Research question: Will there be significant mean differences in
depressive symptoms (CES-D scores) across the depression treatment
programs (CBT, IPT, Control) following treatment implementation?
• Alternate hypothesis: Ha: (μ1 ≠ μ2) ˂ μ3
• Null hypothesis: H0: μ1 = μ2 = μ3

You might also like