G89 2247 Lecture 2 www psych nyu edu couples G2247 Repeated Measures Analysis An Example Math tools Notation Expectations Matrix operations ANOVA approaches Example Revisited G89 2247 Lecture 2 1 Repeated Measures Analysis An Example 68 persons preparing for the bar exam provided information about anxiety in the month prior to the exam We calculated for each person four weekly POMS anxiety scores Here is a summary of the results that does not take advantage of the repeated measures POMS Anxiety Mean Anxiety over four weeks 2 50 2 00 POMS lb ub 1 50 1 00 0 50 0 00 1 2 3 Week G89 2247 Lecture 2 4 2 A one sample test of change 2 time points Could the scores from week 4 differ from those in week 3 simply by sampling fluctuations One sample paired t test problem Call Time 4 Y4 and Time 3 Y3 Formal Statement Let D Y4 Y3 H0 D 0 Compare the sample mean of D with the standard error of D Under usual assumptions the ratio is distributed as a t statistic G89 2247 Lecture 2 3 Practical Computation Means SD SE Sample of 68 respondents T3 1 658 888 108 T4 1 979 897 109 D 0 321 493 060 Paired or One sample t test t df 67 321 060 5 35 Under the null hypothesis that the true mean difference is zero this value of t is very unusual We reject H0 and conclude that on the average true change occurred G89 2247 Lecture 2 4 A two sample comparison of change A comparison group with no upcoming exam POMS Anxiety Two Groups Anxiety over Four Weeks 2 5 2 1 5 Exam 1 Comp 0 5 0 1 2 3 4 Week G89 2247 Lecture 2 5 A two sample comparison of change One could ask whether merely filling our a daily diary makes one more sensitive to moods and perhaps induces change A comparison group was recruited via paper and e mail postings and couples were recruited Complete data were available for 67 persons One can compare the two trajectories G89 2247 Lecture 2 6 A two sample comparison of change Formal analysis might ask Do the groups differ in their average anxiety On the average across groups is there an effect of time Does the effect of time vary across the two groups Choices of analysis include Mixed model ANOVA groups time fixed persons within groups random Contrast based trajectory ANOVA Multivariate ANOVA G89 2247 Lecture 2 7 Some notation We need to keep track of which anxiety scores come from different persons and times and which persons come from different groups Different texts use different notation We will include a glossary in each lecture Diggle Liang and Zeger Yhij h is group ranging from 1 to g g 2 here i is individual ranging from 1 to mh m1 68 m2 67 j is time ranging from 1 to n n 4 here G89 2247 Lecture 2 8 Math tools Expectations Yhij is a random variable It is often useful to think about the distribution of random variables before we collect data A Random Variable can be thought to be a blank cell in a spreadsheet waiting for an observation The numbers that go there have a distribution Lower and upper values Expected average Expected variability G89 2247 Lecture 2 9 Rules for Expectation operators E X x is the first moment the mean Let k represent some constant number not random E k X k E X k x E X k E X k x k Let Y represent another random variable perhaps related to X E X Y E X E Y x y E X Y E X E Y x y Putting these together E X E X1 X2 2 1 2 2 The expected value of the average of two random variables is the average of their means G89 2247 Lecture 2 10 Variance Expectations E X x 2 V X x2 Let k represent some constant number not random V k X k2 V X k2 x2 V X k V X x2 Let Y represent another random variable that is independent of X V X Y V X V Y x2 y2 V X Y V X V Y x2 y2 More generally let Y and X be two random variables with known covariance Cov X Y E X x Y y x y xy V aX bY a2 V X b2 V Y 2ab Cov X Y a2 x2 b2 y2 2ab x y xy G89 2247 Lecture 2 11 Numerical Example Means Var and SD in Sample of 68 examinees Y1 3 1 658 789 888 Y1 4 1 979 805 897 If I added 10 to each POMS score the results would be Y1 3 11 658 789 888 Y1 4 11 979 805 897 If instead I multiplied each score by 10 the results would be Y1 3 16 58 78 9 8 88 Y1 4 19 79 80 5 8 97 G89 2247 Lecture 2 12 Math tools Vectors and Matrices With multiple time points and multiple persons the notation can get cumbersome It is often convenient to use lists of numbers for each person or each variable Lists are called vectors Lists of vectors are arrays called matrices E g Yhi1 Y Yhi hi 2 Yhi 3 Y hi 4 G89 2247 Lecture 2 13 Vector definition operations Definition A vector is an ordered list of numbers aT a1 a2 ap Transpose If a is a vector with p elements in a column then aT is a vector with the same elements arranged in a row Vector Addition If a and b are two vectors with p elements ai bi then a b is a new vector with elements given the the respective element sums a b i ai bi G89 2247 Lecture 2 14 Vector Operations Continued Vector Multiplication If a and b are two vectors with p elements ai bi then aTb aibi a1b1 a2b2 apbp Example aT 0 0 1 1 Y Y1 Y2 Y3 Y4 Then aTY Y4 Y3 This is an example of a contrast vector G89 2247 Lecture 2 15 Matrix operations Matrix definitions A matrix can be viewed as a collection of vectors E g a data matrix is made up of n rows of p variables The transpose of a matrix makes rows columns and vice versa Matrix Addition A B ij aij bij 1 2 4 3 5 1 3 4 3 2 0 6 Matrix Subtraction A B ij aij bij G89 2247 Lecture 2 16 Matrix Multiplication A B ij p ai kbkj k 1 1 2 4 2 2 0 3 4 3 1 0 2 An Identity matrix I is a square matrix with ones on the diagonal and zeros on the off diagonal A I A If a matrix A is square and full rank nonsingular then its inverse A 1 exists such that A A 1 I G89 2247 Lecture 2 17 Some facts about matrix multiplication In general AB BA Commutative principle does …
View Full Document
Unlocking...