Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Parametric Tests

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 69

Biostatistics: Data

Analysis: Parametric
Tests

Dr. Saira Mansoor


Department of Community Medicine
Liaquat National Medical College & Hospital
Lesson Objectives

At the end of the session, the learners shall be able to:


• Review definition and classification of data, variable types and associated
measurement scales
• Describe the parametric assumptions for data analysis
• Review basic concepts in descriptive statistics for parametric data
• Define and classify parametric tests
• Explain each of the given the parametric tests in detail with respect to its
definition, uses, assumptions for underlying data, formula for calculation of test
statistic, and a worked example:
• The t-test: one-sample; two-sample independent and paired
• ANOVA – F-test
• Pearson’s r correlation
• The z-test
• Observe the instructor perform parametric tests on SPSS using given practice
dataset
Data & its Description
• Data: • Collected [brought
together]

• Facts • Organized
[classified/arranged]
and/or Which is then
• Figures • Summarized [condensed]
• Analyzed [scrutinized]
• Interpreted [clarified]
• Data: The raw material of statistics is data:
• We usually define data as numbers
• The two kinds of numbers that we use in statistics are:
• Numbers that result from the taking — in the usual sense of the term — of a
measurement (Continuous variables)
• Numbers that result from the process of counting (Discrete variables)
Classification of Data based on type of Variables &
associated measurement scale
Types of Data

Qualitative Quantitative
Data Type
Categorical Numerical

Variable Type / Discrete / Continuous /


Significance Test
Non-parametric Parametric
Type

Associated 1. Nominal 2. Ordinal 3. Interval 4. Ratio


Measurement Named Ordered Classification Interval data
Scale categories; categories; according to a with an
(4 level of classification classification continuum absolute
measurement of according to according to with interval meaningful
data) assignment assignment of equality and zero
of numbers; numbers sub-division For e.g,
defining order sensibility Weight,
For e.g., or magnitude Height,
Ethnicity, For e.g., For e.g., Temperature
Sex, Marital Cancer Temperature (0K), Blood
status, Eye staging, Value (0C, 0F), IQ, pressure,
Figure adapted from Norman & Streiner, 2014
color rating, Time interval Time on 24
Inferential Statistics
Making inferences; extrapolating to unknown based on known;
projecting & predicting
Definition

• Inferential statistics  Drawing the right conclusions from the statistical


analysis that has been performed using descriptive statistics

• Most predictions of the future and generalizations about a population by


studying a smaller sample  come under purview of inferential statistics

• Epidemiological / Clinical experiments usually  study a small sample


population  helps in determining how the population in general behaves

• By designing the right experiment  the researcher draws


conclusions relevant to his study (to answer research question; hypothesis)

• Basic goal of inferential statistics  to determine the probability (or


likelihood) that a conclusion based on analysis of the data is true
Biggest pitfall in inferential statistics

• While drawing conclusions  need to be very careful so as not to draw


the wrong or biased conclusions

• Even though this appears like a science, there are ways in which one
can manipulate studies and results through various means  BIAS /
CHEATING!!!

• For example, data dredging is increasingly becoming a problem  computers


hold loads of information and it is easy, either intentionally or unintentionally,
to use the wrong inferential methods
Inferential Statistics
Method Details

Parameter Estimating the parameters of the population, based on sample


Estimates data
For e.g., Confidence Intervals for population Mean & S.D.
Hypothesis Testing 1. Using sample data to test assumptions & answer research
questions – value of α
2. Testing for relationship between two variables; For e.g.,
a) Difference in sample & population means
b) Differences in two sample means (t-test; χ2- test)
c) Correlation b/w two variables
d) Association
e) Causation
f) Prediction
g) Survival analysis

Effect Sizes If there is a significant measurement, what is its magnitude?


Important part of hypothesis testing – both value of p and effect
size determine significance of the study
Steps in a statistical test
1. Statement of the question to be answered by the study

2. Formulation of the null and alternative hypotheses (H 0 & HA)

3. Decision for a suitable statistical test


4. Specification of the level of significance α (for example, 0.05)
5. Performance of the statistical test analysis: calculation of test statistic & p-
value
6. Compare the calculated test statistic with the tabulated values
7. Statistical decision: for example
a. p < 0.05 leads to rejection of the null hypothesis and acceptance of the alternative hypothesis

b. p ≥ 0.05 leads to retention of the null hypothesis

8. Interpretation of the test result


Hypothesis
Testing –
the p value
Pre-requisite questions to determine type of
significance test
• To choose a statistical test, the following questions need to be asked:

1. How many variables are there?

2. What is the nature of dependent and independent variables (categorical vs.


continuous)?

3. How many categories are there in the categorical variable(s)?

4. Does the continuous variable(s) follow normal distribution?

5. Is there any pairing in the data / variables?


Parametric Test Assumptions
• Parameter: any numerical quantity that characterizes a given population or
some aspect of it
• Most common statistical parameters are mean, median, mode, and standard
deviation
Parametric Criteria – Some Basics

• These criteria must be explored before running ANY inferential statistics

• The Descriptive Statistics  allow us to determine if the criteria have been met

• If these criteria are not met, then  we run the risk of using wrong inferential
tests with an increased risk of errors (type I or type II errors) in the analysis of
data
Data Assumptions for Parametric Tests
• In statistical analysis, it is important that all parametric tests should assume
some certain characteristic about the data  also known as assumptions
• Violation of these assumptions changes the conclusion of the research and
interpretation of the results  all research, whether for a journal article, thesis, or
dissertation, must follow these assumptions for accurate interpretation
• Depending on the parametric analysis, the assumptions vary
• The following are the data assumptions commonly found in statistical research:
1. Random sampling – sample must be randomly selected from population

2. High level data

3. Data should be normally distributed – Gaussian distribution / Bell curve

4. Equal variances assumed for test variables in sample datasets

5. Independence of means and variances of sample


1. Randomness
• Suppose we want to make a claim that increased iron intake increases
scholastic ability in children between the ages of 5 – 10 years
• If we just measured iron status of children enrolled in top-performing
expensive and private schools, their scholastic ability may already improve
due to best teachers, enhanced coaching, better socioeconomic conditions,
and access to overall good nutrition  increased iron-intake may have noting
to do with increased scholastic ability  what we need is an unbiased sample,
randomly selected (i.e., by chance)
• By selecting a random sample  1st criterion is accepted to use inferential
statistics for data analysis, and we can now check for the other 3 criteria
• If random sample is not selected, then  run non-parametric tests
• Most of the statistics assume that the sample observations are random  i.e.,
the data has been collected randomly
• Run Test  used to test the assumption of randomness
2. High level data
• Low level data drawn from a sample is usually crude  does not provide much
useful information about the underlying population and good judgements are hard
to make about a population from a sample
Nominal – named categories:
• E.g., gender (male/female); SES status (low / middle / high income)
Ordinal – rank order categories:
• E.g., Position (1st, 2nd 3rd); Educational attainment (primary, secondary,
matriculation)
• High level data is much better to use  greater information revealed about group
Interval – equal distance between unit measurements / meaningful negative
values / meaningless zero / / +, - functions:
• E.g., 0F & 0C temp. scales (-280F), Psych. questionnaires (IQ; GEQ); time (in dates)
Ratio – equal distances between numbers / meaningful zero / +, -, ÷, x functions:
• Most physiological data  height, weight, time (in mins / secs)
• If we have interval / ratio data  we can accept 2nd rule & test for 3rd & 4th
criteria
3. Assumption of Normality
• Most of the parametric tests require that the assumption of normality be met
• Normality means the distribution of the test is normal (or bell-shaped) with:
• Mean = 0
• Standard deviation = 1
• A symmetric bell-shaped curve
• To test the assumption of normality, the following measures & tests are applied:
• Skewness and Kurtosis: To test the assumption of normal distribution, Skewness should
be within the range ±2. Kurtosis values should be within range of ±7
• Shapiro-Wilk’s W test: Most of the researchers use this test to test the assumption of
normality. Wilk’s test should not be significant to meet the assumption of normality
• Kolmogorov-Smirnov test: In the case of a large sample, most researchers use K-S test
to test the assumption of normality. This test should not be significant to meet the
assumption of normality
• Q-Q plot: graphical method for test of normality – Most researchers use Q-Q plots to test
the assumption of normality. In this method, observed value and expected value are
plotted on a graph. If the plotted value does not vary much more from a straight line, then
the data is normally distributed. If great variation present, then data will not be normally
distributed
Dataset – hsb2-3
(high school &
beyond 2)
Dataset – hsb2-3
(high school &
beyond 2)
4. Assumption of homogeneity (equality) of
variance
• This criterion looks at two characteristics of a sample to see if their variances
are reasonably similar or very different
• Take the smallest variance, double it, and see whether it is smaller or larger
than the larger variance
• If the smallest variance doubled is now larger than the biggest variance, the
two datasets are known as homogenous, and this criterion is accepted
• If the smallest variance doubled is still smaller than the larger variance, the
two datasets are known as heterogenous and this criterion is not accepted
• Suppose our data sets have variances 15 & 28  taking the smaller variance
and doubling it – 15 x 2 = 30 > 28 – homogenous variance  3rd criterion met
• However, variances of 15 & 32 will be heterogenous  non-parametric tests
• Levene’s test: To test the assumption of homogeneity (equality) of variance
 Levene’s test is used
• This test should not be significant to meet the assumption of equality of
variances
Assumptions – bottom line

• These 4 assumptions are of progressive importance


• If these are not met, the results of parametric tests are not correct  use non-
parametric inferential statistics
• Some rules may be violated but, we must justify doing so with supporting
evidence if we are planning to use parametric tests nonetheless
• Some assumptions can be re-run after re-checking and cleaning the data
further
• Suppose the data is not normally distributed and there are many cases (large
sample size)  remove the outliers and extremes and recheck
• Remember to justify it
• Recheck all assumptions then
Parametric Tests
Used for quantitative data; continuous variables; and when data
are measured on approximate interval or ratio scales of
measurement
Statistical Test – What is it?

• These are intended to decide whether a hypothesis about distribution of one


or more populations should be rejected or accepted
• These may be:

Statistical Tests Parametric

Non-
Parametric
Parametric Tests

1. t-test (n < 30)


a. t-test for one-sample
b. t-test for two samples
i. Unpaired (independent) new sample
ii. Paired two-sample

2. ANOVA (Analysis of Variance)


a. One-way ANOVA
b. Two-way ANOVA
3. Pearson’s r Correlation (product moment correlation coefficient)
4. z-test (n > 30)
The t-test
• The t-distributions
• One-sample t-confidence Interval
• One sample t-test
• Two-sample t-test (independent; paired)
The t-distribution

• Compared with the normal distribution,


The t – distributions have:
1. Similar-shaped density curves
2. Greater spread
3. More probability in the tails compared to
the center
• As the degrees of freedom increase,
the t-density curve approaches the
standard normal curve
• The t-distribution table is used for
determining the critical values t* for t
distributions with different degrees of
freedom
Table D

confidence interval C for the mean µ of a


• Suppose we want to construct a 95%

size n = 12; what critical value of t*


Normal population based on an SRS of

should be used?
• In table D, we consult the row
corresponding to df = n – 1 = 11
• We move across that row to the entry that
is directly in the 95% confidence interval
column
• The desired critical value is t* = 2.201

The level C confidence interval is an interval


with probability C of containing the true
population parameter
• C is the area between –t* and t*
• From table D, we find t* for df = n – 1 and
CI
Student’s t test
• Developed by Professor W. S. Gossett in 1908, who published statistical papers
under the pen name of ‘Student’  known as Student’s ‘t’ test

• A t-test compares the difference between two means of different groups to


determine whether that difference is statistically significant

One sample One sample t test

T-test
2 independent
samples t-test
Two samples
Two paired samples
t-test

• Indications for the test:


1. When sample size is small (n < 30)
2. Population variance is not known
Student’s t test
• Uses:
1. Two means of small independent samples
2. Sample mean and population mean
3. Two proportions of small independent samples

• Assumptions:
1. Samples are randomly selected
2. Data for analysis is quantitative
3. Variable follow normal distribution
4. Sample variances are mostly same in both the groups under the study
5. Samples are small, mostly lower than 30
One sample t-test

• We compare the mean of a single group of observations (sample)


with a specified value (population)

• In one sample t-test  Population mean  is known

Steps:
1. A random sample is drawn from the population
2. Comparison of sample mean with population mean is made
3. A statistical decision is made as to whether or not the sample mean is
different from the population
Calculations for one sample t-test

• S2 =

Where:
• = Sample mean Where:
• = Population mean • = Element of sample
• = Standard Error • = Sample mean
• = Degrees of freedom
Decision

significance α (generally it is set at 5% or 1%)


• Now we compare calculated value with table value at certain level of

• If absolute value of ‘t’ obtained is greater than the value t* given in table D,
then we reject the null hypothesis

• If absolute value of ‘t’ is less than the table value t*, we fail to reject the null
hypothesis
Example 1

• Research Problem: Comparison of mean dietary intake of a particular group


of individuals (sample) with the recommended daily intake (population)
• Data: Average (mean) daily energy intake (ADEI) of 11 healthy women over
10 days
Subject 1 2 3 4 5 6 7 8 9 10 11
ADEI 5260 5470 5640 6180 6390 6515 6805 7515 7515 8230 8770
(KJ)

• Mean ADEI value = 6753.6 KJ


• SD ADEI value = 1142.1
• What can be said about the energy intake of these women in relation to
recommended daily intake of 7725 KJ?
Variables in two independent samples t-test

Any characteristic of interest

Independent variable Dependent variable


Categorical – 2 cats Continuous

which constitutes
the DEPENDENT
an INDEPENDENT whose effect is
variable
variable then determined
(For e.g.,
(e.g., drug, vaccine, a by measurement
new procedure, incidence of
of the FINAL
behavior change) disease, survival
OUTCOME
time, recovery
period)

Figure adapted from Norman & Streiner, 2014


Research Hypothesis

State null hypothesis and alternative hypothesis:

• H0 = there is no difference between population mean and sample mean


OR
H0 : µ = 7725 KJ

• HA = there is a difference between population mean and sample mean


OR
HA : µ ≠ 7725 KJ
Calculation of test statistic

• Set the level of significance α = 0.05; 0.01; 0.001

• Calculate the value of the ‘t’ statistic

• t=

• = - 0.2564
State the rule for rejecting the null hypothesis

• Reject H0 if t ≥ +ve tabulated value


OR
• Reject H0 if t ≤ -ve tabulated value

• We can say that p < α


OR

In the above example we have seen:

• p value suggests that the dietary intake of these women was significantly less
• t = - 0.2664 which is < 2.23

than the recommended level (7725 KJ)


Two-sample ‘t’ test – unpaired samples
• We compare the means of two groups of observations (samples)
which are not related to each other

• Unpaired t-test is used when two independent random samples come from
normal populations having unknown or same variance

same i.e., µ1 = µ2 against an appropriate one-sided or two-sided


• We test the null hypothesis, that the two population-means are the

alternative hypothesis

Assumptions:
• Samples are random and independent of each other
• The normal distribution of dependent variable is normal
• The variances are equal in both the groups
Calculations – two independent samples t-test
• The test statistic is given by:

•t=

• Where SE Mean1 – Mean2 =

•S=

• Where and are respectively called Standard Deviations of first and second
group
Weight of babies (in kgs)
born to:
Example – two unpaired samples Non-smoking Heavy
mothers smoking
t-test (n=15) mothers
(n=14)
• Research problem: A study was conducted to 3.99 3.18
compare the birth weights of children born to non-
smoking mothers (n=15) vs. smoking mothers 3.79 2.84
(n=14) 3.60 2.90
• Research Hypothesis: State null hypothesis and 3.73 3.27
alternative hypothesis 3.21 3.85
• H0 = There is no difference between the 3.60 3.52
birthweight (in kgs) of children born to non- 4.08 3.23
smoking and smoking mothers
3.61 2.76
• H1 = There is a difference between the
3.83 3.60
birthweights (in kgs) of children born to non-
3.31 3.75
• Set the level of significance α = 0.05; 0.01; 0.001
smoking and smoking mothers
4.13 3.59
3.26 3.63
3.54 2.38
Decision

• Calculate the value of proper statistic

• State the rule for rejecting the null hypothesis

• If tcal > ttab we can say that p < 0.05

• Decision: We reject the null hypothesis, i.e., children born to non-smoking


mothers are heavier than children born to heavy smokers
Two sample t-test – paired data

(sample) where each element (x) gives a pair of observations (x1 & x2)
• We compare the means of two observations from a single group

• Same individuals are studied more than once in different circumstances,


measurements are made on the same people before and after interventions

Assumptions:
• The outcome variable should be continuous
• The difference between pre-post measurements should be normally
distributed
Calculations

• Where:
• d = difference between x1 and x2
• = Average of d
• SD = Std. deviation for the difference
• n = sample size
Example – two paired samples t-test
Patient Weight
Research Problem: No. (Kgs)
• A study was carried out to evaluate the effect of Before After Diet
a new diet on weight loss. The study population Diet
consists of 12 people who have used the diet for 1 75 70
2 months; their weights before & after the diet
are given 2 60 54
3 68 58
4 98 93
Research Hypothesis:
5 83 78
• State null hypothesis and alternative hypothesis
6 89 84
• H0 = There is no reduction in weight after the diet
7 65 60
• H1 = There is reduction in weight after the diet 8 78 77
9 95 90
• Decision: If we reject the null hypothesis then 10 80 76
there is a significant reduction in weight 11 100 94
Group Statistics

gender of respondent N Mean Std. Deviation Std. Error Mean

female 109 50.6972 9.03850 .86573


science score
male 91 53.2308 10.73217 1.12504

Independent Samples Test


Levene's Test for Equality t-test for Equality of Means
of Variances

F Sig. t df Sig. (2- Mean Std. Error 95% Confidence Interval of


tailed) Difference Difference the Difference

Lower Upper

Equal variances
3.609 .059 -1.812 198 .071 -2.53352 1.39790 -5.29021 .22316
science assumed
score Equal variances not
-1.785 176.555 .076 -2.53352 1.41958 -5.33505 .26800
assumed
How do we compare means for more than two
groups?

Example: • We want to know the effect of 4


• Treatments: A, B, C, D different treatments on the BP level
• Response: BP Level of individuals

How does t-test concept work here? • Instead of using a series of individual
comparisons we examine the
• A versus B
differences among the groups
B versus C
through an analysis that considers
• A versus C B versus D the variation among all groups at
• A versus D C versus D once

So, the chance of getting the wrong result • i.e., ANALYSIS OF VARIANCE
would be:
1 – (0.95 x 0.95 x 0.95 x 0.95) = 26%
Variables in ANOVA

Variable = Any characteristic of interest

Independent variables Dependent variable


Categories > 2 Continuous

which constitutes
the DEPENDENT
an INDEPENDENT whose effect is
variable
variable then determined
(For e.g.,
(e.g., drug, vaccine, a by measurement
new procedure, incidence of
of the FINAL
behavior change) disease, survival
OUTCOME
time, recovery
period)

Figure adapted from Norman & Streiner, 2014


Analysis of Variance (ANOVA)

• Given by Sir Ronald Fisher • Assumptions of ANOVA


• The principle aim of statistical • Sample population can be easily
models is to explain the variation in approximated to normal distribution
measurements • All populations have same Standard
• The statistical model involving a test Deviation
of significance of the difference in • Individuals in population are selected
mean values of the variable between randomly
two groups is the student’s ‘t’ test
• Independent samples
• If there are more than two groups,
the appropriate statistical model is
Analysis of Variance (ANOVA)
• ANOVA compares variances by means of a simple ratio, called F-Ratio

• F = Variance between groups / variance within groups

• The resulting F statistic is then compared with the critical value of F (critic),
obtained from F tables in much the same way as was done with ‘t’

• If the calculated value exceeds the critical value for the appropriate level of α,
the null hypothesis will be rejected
• A F test is therefore a test of the Ratio of Variances

• F test can also be used on their own, independently of the ANOVA technique, to test
hypothesis about variances

• In ANOVA, the F test is used to establish whether a statistically significant difference exists
in the data being tested

One-Way
ANOVA
Two-Way
Types of ANOVA

• One Way ANOVA: • Two Way ANOVA

• Used if the various experimental • Used if the various groups differ in


groups differ in terms of only one terms of two or more factors at a
factor at a time time,
• e.g., A study to assess the • e.g., A study to assess the
effectiveness of four different effectiveness of four different
antibiotics on S Sanguis antibiotics on S Sanguis in three
different groups
Pearson’s Correlation Coefficient

• Correlation is a technique for investigating the relationship between two


quantitative, continuous variables

• Pearson’s Correlation Coefficient (r) is a measure of the strength of association


between two continuous variables

• Assumptions made in calculation of ‘r’


1. Subjects selected for study with pair of values of x & y are chosen with

2. Both x & y variables are continuous


random sampling procedure

3. Both x & y variables are assumed to follow normal distribution


Steps

• The first step in studying the relationship between two continuous variables is
to draw a scatter plot of the variables to check for linearity

• The correlation coefficient should not be calculated if the relationship is not


linear

• For the purpose of correlation only, it does not matter on which axis the
variables are plotted

• However, conventionally, the independent variable is plotted on x-axis and


dependent variable on y-axis

• The nearer the scatter of points is to a straight line, the higher the strength of
association between variables
Types of Correlation

• Perfect Positive Correlation r = +1

• Partial Positive Correlation 0 < r < +1

• Perfect Negative Correlation r = −1

• Partial Negative Correlation 0 > r > − 1

• No Correlation
The Scatter
Plot

World Health Organization,


z-test

• This test is used for testing significance difference between two means (n>30)

Assumptions:
• The sample must be randomly selected
• Data must be quantitative
• Samples should be larger than 30
• Data should be normally distributed
• Sample variances should be almost the same in both the groups of study

• If the SD of the populations is known, a z-test can be applied even if the


sample is smaller than 30
Indications

• To compare sample-mean with population-mean

• To compare two sample means

• To compare sample proportion with population proportion

• To compare two sample proportions


Steps
1. Define the problem

2. State the null hypothesis (H0) & alternate hypothesis (HA)

3. Find the z-value


4. z=

5. Fix the level of significance

6. Compare the calculated z value with the value in z table at corresponding


degree significance level

7. If the observed z value is greater than theoretical z value, z is significant 


reject the null hypothesis and accept alternate hypothesis
One-tailed and two-tailed Z tests

• Z values on each side of mean are calculated as +z or as –z


• A result larger than difference between sample mean will give +z and a result
smaller than the difference between mean will give –z
Example for two-tailed:
• In a test of significance when one wants to determine whether the mean IQ of
malnourished children is different from that of well-nourished children and
does not specify higher or lower, the p value of an experiment group includes
both sides of extreme results at both ends of scale, and the test is called two-
tailed test
Example for one-tailed:
• In a test of significance, when one wants to know specifically whether a result
is larger or smaller than what occur by chance, the significant level or p-value
will apply to relative end only; for e.g., if we want to know whether
malnourished children have lesser mean IQ than the well-nourished, the result
will lie at one end (tail) of the distribution, and this is called a one-tailed test
Conclusions

• Tests of significance play an important role in conveying the results of any


research and thus the choice of an appropriate statistical test is very
important as it decides the fate of outcome of the study

• Hence emphasis is placed on tests of significance in clinical / epidemiological


research must be tempered with an understanding that they are tools for
analyzing data and should never be used as a substitute for knowledgeable
interpretation of outcomes

You might also like