Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basics of Group Analysis

Similar presentations


Presentation on theme: "Basics of Group Analysis"— Presentation transcript:

1 Basics of Group Analysis
FreeSurfer Course Spring 2016 Emily Lindemer

2 Outline Objective Types of questions Linear algebra review
Statistics review Example

3 objective To create a model that can describe patterns of interactions and associations The parameters of the model provide measures of the strength of associations A General Linear Model (GLM) focuses on estimating the parameters of the model such that they can be applied to new data sets to create reasonable inferences.

4 What kinds of questions are we interested in?
Does a specific variable have a significant association with an outcome? If we control for the effects of a second variable, is the association still significant? Is there a group difference in outcome? Does a specific variable affect individual outcome differently between groups of individuals?

5 Linear algebra review (stay calm…)
x

6 Linear algebra review (stay calm…)
We can put this in matrix format: -One row per data point -Add column of 1’s for the offset term (b) -One set of parameters y1 y2 y3 y4 x1 1 x2 x3 1 x4 y b m m = * b Design Matrix Regression Coefficients x

7 matrix multiplication
y1 y2 y3 y4 x1 1 x2 x3 1 x4 b m = * y1 = 1*b + x1*m y2 = 1*b + x2*m System of Linear Equations y3 = 1*b + x3*m y4 = 1*b + x4*m

8 Error y1 = 1*b + x1*m + r1 y2 = 1*b + x2*m + r2 y3 = 1*b + x3*m + r3
BUT… if we have the same m and b for all data points, we will have errors: y b m y1 = 1*b + x1*m + r1 y2 = 1*b + x2*m + r2 y3 = 1*b + x3*m + r3 y4 = 1*b + x4*m + r4 GOAL: minimize the sum of the square of error terms when estimating our m and b terms There are lots of ways to do this! (Beyond the scope of this talk, but FreeSurfer does it for you!)

9 Forming a hypothesis Null hypothesis: m = 0
Now, we can fit our parameters, but we need a hypothesis Simple example: Is there a significant association between age and memory? Formal Hypothesis: The slope of age v. memory (m) is significantly different from zero memory Null hypothesis: m = 0 age

10 Testing our hypothesis
Once we fit our model for the optimal regression coefficients (m and b), we need to test them for significance as well as test the direction of the effect We do this by forming something called a contrast matrix that isolates our parameter of interest We can multiply our contrast matrix by our regression coefficient matrix to compute a variable g, which tells us the direction of our effect In this example, since our hypothesis is about the slope m we will design our contrast matrix to be [0 1] If g is negative, then the direction of our effect (slope) is also negative memory1 memory2 memory3 memory4 age1 1 age2 age3 1 age4 b m b m = * g = [0 1] *

11 Testing our hypothesis
This t-value corresponds to a p-value that depends on your sample size. This p-value is between 0 and 1, values closer to 0 indicate a more significant result.

12 Putting it all together
We used our empirical data to form a design matrix: X We fit regression coefficients (b and m) to our x,y data We created a contrast matrix: C to test our hypothesis for: Direction of effect: g = C*β Significance of effect: t-test

13 Example: using 2 groups What if we have two groups? (i.e. does age effect memory different in men and women?) Real data: Age Sex Memory Score 74 M 28 75 68 30 81 24 79 26 65 F 77 27 80 69 29

14 Example: using 2 groups What will linear equation look like now? How will this change our design matrix? y = m1x1 + b1 + m2x2 + b2 Each group will now get it’s own set of regression coefficients and our design matrix will look as follows: female male female age male age Age Sex Memory Score 74 M 28 75 68 30 81 24 79 26 65 F 77 27 80 69 29 #columns = #groups * #parameters to estimate

15 Example: using 2 groups 45.5 60.3 -0.24 -0.44 28 30 24 26 27 29
Age Sex Memory Score 74 M 28 75 68 30 81 24 79 26 65 F 77 27 80 69 29 28 30 24 26 27 29 45.5 60.3 -0.24 -0.44 b1 b2 m1 m2 = *

16 Example: using 2 groups 45.5 60.3 -0.24 0 0 1 -1 -0.44 DOF = 6
How do we test if the slopes are significantly different? Null hypothesis: The difference in slopes between men and women is zero. Regression coefficients: 45.5 60.3 -0.24 -0.44 Contrast matrix: DOF = 6 p<0.0001 Null hypothesis is FALSE = 14.14

17 Next…. If you understand the basics of this talk, you can test much more complex hypotheses We will cover more difficult examples in the formal group analysis talk later this morning Quiz: what would your design and contrast matrices look like if you wanted to test for a significant association between age and memory, while controlling for IQ? 1 age1 IQ1 1 age2 IQ2 1 age3 IQ3 1 age4 IQ4 IQ age QUESTIONS?


Download ppt "Basics of Group Analysis"

Similar presentations


Ads by Google