Statistical analysis Students ttest and Linear regression Students

  • Slides: 15
Download presentation
Statistical analysis Student’s t-test, and Linear regression

Statistical analysis Student’s t-test, and Linear regression

Student’s t-test • Does a drug treatment provide the typical time to symptoms relief

Student’s t-test • Does a drug treatment provide the typical time to symptoms relief or is it different? • Does a new drug treatment differ in time to relief from the standard treatment? • Compare the means of two sets of data and assess if they are significantly different from each other • -Small size

Assess the difference of means in relevance to the spread of the variability of

Assess the difference of means in relevance to the spread of the variability of their scores

How do we use it? • -Compute the t-value • -Compare with known distributions

How do we use it? • -Compute the t-value • -Compare with known distributions to check the statistical significance • -Choose level of significance(p=o. o 5) and accept or reject null hypothesis • -one sample: comparison of the sample men to the population mean • -paired samples: repeated measures • -two independent samples: two separate sets of independent and identically distributed samples

Assumptions • -Normally distributed samples • -> Normality tests: Shapiro-Wilk or Kolmogorov-Smirnov • -Same

Assumptions • -Normally distributed samples • -> Normality tests: Shapiro-Wilk or Kolmogorov-Smirnov • -Same variances • ->if not: Welch’s t-test • -Independent samples

One/two-tailed tests One-tailed test: testing differences among many different experimental conditions Two tailed-test: comparing

One/two-tailed tests One-tailed test: testing differences among many different experimental conditions Two tailed-test: comparing each mean with each of the other means

Linear regression • What is it used for? • What are the possible experiments?

Linear regression • What is it used for? • What are the possible experiments? • How do I calculate it?

What are the possible experiments and what is it used for? • Linear regression

What are the possible experiments and what is it used for? • Linear regression is used when you need to show a correlation between two variables. Your variables must be numeric and continuous, and you must be able to put them under the form of coordinates. For example, correlation between age and height in children between 2 and 8 (x being the age and y being the height)

Considerations • Attention: the linear regression is correct only on the used interval, any

Considerations • Attention: the linear regression is correct only on the used interval, any other prediction is mere speculation. For example, the correlation on height and age on children between 2 and 8 does not apply for teenagers and adults. Speculation is evil, pay attention!

How do I calculate it? • We want to adjust the distribution of (X;

How do I calculate it? • We want to adjust the distribution of (X; Y) to a linear function like Y= a. X + b This is called linear regression of Y on X. (X 1; Y 1), (Xn; Yn)…. . The coordinates of the singular points. • We want to determine a and b in order for the function d(a; b)= sum[1 N](a. Xk +b –Yk)^2 to have a global minimum on R^2 • This minimum is attained only at one critical point: a= (r(X, Y)σ(Y))/(σ(X)) and b= μ(Y)-aμ(X)

a= (r(X, Y)σ(Y))/(σ(X)) and b= μ(Y)-aμ(X) • a= (r(X, Y)σ(Y))/(σ(X)) and b= μ(Y)-aμ(X) •

a= (r(X, Y)σ(Y))/(σ(X)) and b= μ(Y)-aμ(X) • a= (r(X, Y)σ(Y))/(σ(X)) and b= μ(Y)-aμ(X) • “a” is the slope of the linear regression, while b is the starting point. • “r” is the correlation coefficient, and r=(1/n-1)((Σx*Σy((x-μx)(y-μy)))/(σx*σy)) r goes from 0 to 1, the more r is close to 1, the more the points are correlated, and the linear regression accurated. • σ=sqrt((Σ(x-μx)^2)/(n-1)) • X and Y being the coordinates of the points

Example • We have three points: (3; 3), (3; 2) and (6; 4) and

Example • We have three points: (3; 3), (3; 2) and (6; 4) and we want to see if X and Y are correlated. • First we calculate μ: μx=4 and μy=3 • Then it’s the standard deviation σ: σx=1, 73 and σy=1 • Finally we calculate r: r=0. 87 here. • a=0, 5 • b=1 • R^2=0. 75

Visual representation of a linear regression 4. 5 4 R 2 = 0. 75

Visual representation of a linear regression 4. 5 4 R 2 = 0. 75 3. 5 3 y 2. 5 Series 1 2 Linear(Series 0) 1. 5 1 0. 5 0 0 1 2 3 x 4 5 6 7

How can a linear regression be calculated? • Excel: first column = x second

How can a linear regression be calculated? • Excel: first column = x second column=y create a chart (scatter points) then add the linear trend line, and show r^2 and display equation on chart, you will have your linear regression in less than 2 minutes. • By hand: you will have more luck in Russian roulette, but just use the presented formulas.