t-tests and anova
DESCRIPTION
T-tests and ANOVA. Statistical analysis of group differences. Outline. Criteria for t-test Criteria for ANOVA Variables in t-tests Variables in ANOVA Examples of t-tests Examples of ANOVA Summary. Criteria to use a t-test. Criteria to use ANOVA. Main Difference: 3 or more groups . - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/1.jpg)
T-tests and ANOVAStatistical analysis of group differences
![Page 2: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/2.jpg)
Outline
Criteria for t-test Criteria for ANOVA Variables in t-tests Variables in ANOVA Examples of t-tests Examples of ANOVA Summary
![Page 3: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/3.jpg)
Criteria to use a t-test
![Page 4: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/4.jpg)
Criteria to use ANOVA
Main Difference: 3 or more groups
![Page 5: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/5.jpg)
Variables in a t-test
Null hypothesis () Experimental hypothesis () T-statistic P-value (p<0.05) Standard Deviation Degrees of Freedom(df)= sample size(n) – 1
![Page 6: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/6.jpg)
Standard Deviation vs Standard Error Standard Deviation= relationship of individual values of the sample Standard Error= relationship of standard deviation with the sample
mean How it relates to the population
![Page 7: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/7.jpg)
One-tailed and Two-tailed
![Page 8: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/8.jpg)
Variables in ANOVA
F-ratio= Sum of Squares: Sum of the variance from the mean [ ] Means of Squares: estimates the variance in groups using the sum of
squares and degrees of freedom
![Page 9: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/9.jpg)
Example : One Sample t-test
≠ 0An ice cream factory is made aware of a salmonella outbreak near them. They decide to test their product contains Salmonella. Safe levels are 0.3 MPN/g
![Page 10: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/10.jpg)
Example: Two Sample t-test
≠
In vitro compound action potential study compared mouse models of demyelination to controls. Conduction velocities were calculated from the sciatic nerve (m/s).
![Page 11: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/11.jpg)
Example of Within Subjects ANOVAA sample of 12 people volunteered to participate in a diet study. Their BMI indices were measured before beginning the study. For one month they were given a exercise and diet regiment. Every two weeks each subject had their BMI index remeasured
![Page 12: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/12.jpg)
Example of Between Subjects ANOVAAM University took part in a study that sampled students from the
first three years of college to determine the study patterns of its students. This was assessed by a graded exam based on a 100 point scale.
![Page 13: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/13.jpg)
Summary of MatLab syntax
T-test [h, p, ci, stats]=ttest1(X, mean of population) [h, p, ci, stats]=ttest2(X)
ANOVA [p,stats] = anova1(X,group,displayopt) p = anova2(X,reps,displayopt)
http://www.mathworks.co.uk/help/stats/
![Page 14: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/14.jpg)
Types of Error
Type 1- Significance when there is none Type 2- No significance when there is
![Page 15: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/15.jpg)
Summary
![Page 16: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/16.jpg)
Correlation and Regression
![Page 17: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/17.jpg)
CorrelationCorrelation aims to find the degree of relationship between two variables, x and y.
Correlation causality
Scatter plot is the best method of visual representation of relationship between two independent variables.
![Page 18: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/18.jpg)
Scatter plots
![Page 19: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/19.jpg)
How to quantify correlation?
1) Covariance2) Pearson Correlation Coefficient
![Page 20: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/20.jpg)
Covariance
Is the measure of two random variables change together.
n
yyxxyx
i
n
ii ))((
),cov( 1
![Page 21: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/21.jpg)
How to interpret covariance values?
Sign of covariance
(+) two variables are moving in same direction
(-) two variables are moving in opposite directions.
Size of covariance: if the number is large the strength of correlation is strong
![Page 22: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/22.jpg)
Problem?
The covariance is dependent on the variability in the data. So large variance gives large numbers.
Therefore the magnitude cannot be measured.
Solution????
![Page 23: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/23.jpg)
Pearson Coefficient correlation
Both give a value between -1 ≤ r ≤ 1
-1 = negative correlation 0 = no correlation
1 = positive correlation r² = the degree of variability of variable y which
is explained by it’s relationship with x.
yxxy ss
yxr ),cov(
![Page 24: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/24.jpg)
Limitations
Sensitive to outliers Cannot be used to predict one variable to other
![Page 25: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/25.jpg)
Linear RegressionCorrelation is the premises for regression. Once an association is established can a dependent variable be predicted when independent variable is changed?
![Page 26: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/26.jpg)
Assumptions
Linear relationship Observations are independent Residuals are normally distributed Residuals have the same variance
![Page 27: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/27.jpg)
Residuals
![Page 28: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/28.jpg)
• a = estimated intercept• b = estimated regression
coefficient, gradient/slope• Y = predicted value of y for
any given x• Every increase in x by one
unit leads to b unit of change in y.
Linear Regression
![Page 29: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/29.jpg)
Data interpretation
Y 0.571(age) + 2.399 P value (<0.05)
![Page 30: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/30.jpg)
Multiple Regression
Use to account for the effect of more than one independent variable on a give dependent variable.
y = a1x1+ a2x2 +…..+ anxn + b + ε
![Page 31: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/31.jpg)
Data interpretation
![Page 32: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/32.jpg)
General Linear Model
GLM can also allow you to analyse the effects of several independent x variables on several dependent variables, y1, y2, y3 etc, in a linear combination
![Page 33: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/33.jpg)
Summary
Correlation (positive, no correlation, negative) No causality Linear regression – predict one dependent variable y through x Multiple regression – predict one dependent variable y through more
than one indepdent variable.
![Page 34: T-tests and ANOVA](https://reader035.vdocuments.net/reader035/viewer/2022062310/5681673f550346895ddbf218/html5/thumbnails/34.jpg)
?? Questions ??