### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# ADVANCED PSYCHOLOGICAL STATISTICS I PSYC 502

Rice University

GPA 3.55

### View Full Document

## 9

## 0

## Popular in Course

## Popular in Psychlogy

This 290 page Class Notes was uploaded by Morris Rolfson on Monday October 19, 2015. The Class Notes belongs to PSYC 502 at Rice University taught by Michael Byrne in Fall. Since its upload, it has received 9 views. For similar materials see /class/224985/psyc-502-rice-university in Psychlogy at Rice University.

## Popular in Psychlogy

## Reviews for ADVANCED PSYCHOLOGICAL STATISTICS I

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/19/15

Advanced Psychological Statistics I Psychology 502 The Normal Distribution September I 1 2007 Overview Questions on probability or the chapter 3 reading Especially the last homework Probability distributions More binomial distribution As N gets large what happens The Normal distribution The Standard Normal in Tables Zscores Interpolation Start on sampling distributions l The Central Limit Theorem Probability Distributions Probability function x is a number pX fX For any X 0 SfX 1 Sum of fx for all values of x is 1 Two kinds Discrete Continuous Probability 025 020 015 010 005 000 Discrete Probability Distribution 0123456789101112 Number of Successes Continuous Probability Distribution Continuous Distributions Cannot meaningfully compute the probability of a single number f5 f500000000000 In any real situation you don t have infinite precision o What you can do however is compute the area of a region p50 lt X lt 55 How do you do this 9 Compute area under the curve 55 x2 1 50ltxlt55 e2 p JO TE Why Probability Distributions If a given probability distribution is an accurate description of something in the world It allows us to make inferences about the likelihood of certain events For example Can compute the probability of 22 or more heads on 30 flips of a fair coin Can compute the probability that an error that should occur 5 occurs 15 or more times The Binomial and the Normal are simply two of many probability distributions You ll see lots of others 1 F chisquare Binomial N 12 p 05 Probability 025 020 015 010 005 000 0 1 2 3 4 5 6 7 8 9 Number of Heads 1011 12 Binomial N 20 p 05 Probability 018 016 014 012 010 008 006 004 002 000 O 1 2 3 4 5 6 7 8 91011121314151617181920 Number of Successes Binomial N 30 p 05 Probability 016 014 012 010 008 006 004 002 000 OFNmeCDNCOCUOV NCOVLDCONQCUOF 1 1 1 1 I FFFFFF Number of Successes Binomial N 30 p 07 Probability 016 014 012 010 008 006 004 002 000 OFNO JV LOCONCOOO39I NC OV39LOCONmev 1 NN FFFFFFFFF Number of Successes Normal Distribution 1 20 fX 0me uisthe mean 02 is the variance Properties of the Normal o Symmetric Continuous Wellunderstood Relevance Many realworld data sets are normally or nearnormally distributed Standardized test scores People s height Many real probability distributions are wellapproximated by the normal when sample size is large The Binomial is one Others you haven t seen yet eg the tdistribution Theory of normal distribution of error Single most important Sampling distribution of the mean is normally distributed in More on this later Standard Normal 1 X e 2 427 fX Mean is zero Standard deviation is 1 Any other normal distribution will take on this form when transformed to zscores Note that if the distribution is not normal to start with z score transform does not make it normal But will produce same mean 0 and standard deviation 1 as standard normal Table in the back of your textbook contains information about this distribution Using the Normal You have a pool of all the SATVerbal scores out there You select one at random What s the probability that the score is gt 690 How do we solve Convert 690 to a zscore Look up on the table Mean 500 sd 100 what s the zscore for 690 Now use the table in the back of your book it What s the probability of a zscore gt 19 Second Example If IQ39s are perfectly normally distributed how many people in the US have IQ s between 105 and 121 Assume Mean IQ is 100 standard deviation is 15 N 280 million How do we solve Compute zsoores for 105 and 121 a Look up probabilities on the table Subtract to get probability multiply by N Solution 1 z105 033 z121 14 1 pz lt 033 629 pz lt14 919 it 2928O million 812 million Third Example Height is approximately normally distributed U 8 Male 5 645 inches 50 691 inches Female 50 64 inches 975 689 inches What s the standard deviation in each case How do we solve Percentiles can be mapped to zscores With two zscores we can solve for sd For males m 50 corresponds to zscore of O 5 corresponds to zscore of 165 Thus 165 sd 46 inches 645 691 it Therefore 1 sd 279 inches Using the Normal Approximation to the Binomial Recall our toast machine example from last time with N 12 We computed region of rejection by adding up probabilities from the tails Becomes very cumbersome to compute when N gets large With N gt 20 normal approximation works fine How would we actually use this Repeat toast machine experiment with N 30 Important things to know Mean of Binomial is Np 9 Variance of Binomial is Npq Q We know distribution of standard normal from back of text Region of Rejection Let s say we want to be really confident alpha 001 Want to reject it presult more extreme lt 001 How do we use the normal for this First what values on the standard normal cut off a total of 1 of the distribution on both ends z 196 z 233 t z 258 What if alpha was 005 010 What if the test were onetailed Text gives lots of examples of computing probabilities of regions of the normal Normal to Binomial Thus we need to find the values on the Binomial that correspond to z 258 and z 258 What does 2 258 signify Mean of Binomial is Np 30O5 15 Standard deviation is sqrtNpq sqrt300505 2739 Converting z to Binomial t z 258 gt 15 2582739 z 22 z 258 gt 15 2582739 z 8 When would we reject If we obtain 22 or more X5 or 8 or less Xs Linear Interpolation Everybody know what this is A refresher Basic idea You have a table of y values for some function of x need the y for some x not on the table Assume Function is linear between all table values Example table a X X g 126 379 127 386 What s the Y corresponding to an X of 1268 Difference in X s 127 126 01 Proportion of X distance 008 O1 08 g Convert to Y 379 08386 379 3846 Sampling Distributions De nition Consider some population eg Heights of all 18year olds in the US In that population there is a probability distribution of values That is the probability that a randomlyselected member of the population will have a particular value for all values in the population Take a sample from that population of size N Compute a sample statistic Repeat this an infinite number of times Distribution of the obtained values is the sampling distribution of that statistic Sampling Distributions There is some population gt Take samples of size N mm M X Compute sample statistic Relevance of Sampling Distributions If we know something about the sampling distribution we can make inferences about values in it Compute the probability that a sample statistic will take on some value Compute the probability that a sample statistic will be within a particular range For unbiased estimators the mean of the sampling distribution is the population parameter value The standard deviation of the sampling distribution is known as the standard error i Formal notion of efficiency comes from this Smaller standard error more efficient Sampling Distributions There is some population gt Take samples of size N mm M X Compute sample statistic Sampling Distributions We will mostly discuss the mean but statistics other than the mean have sampling distributions Mode Median Mean equal to population median Standard error z 12530sqrtN for normal populations Standard deviation N1 estimate Mean equal to population standard deviation Standard error z 071 osqrtN for normal populations 9 Test statistics also have sampling distributions Things like F t and Chisquared t You ll see more of these soon Sampling Distributions Demo Launch a Web browser Safari Firefox etc Go to httponlinestatbookcomrvlshtml Click on SimulationsDemonstrations Click on Sampling Distribution Simulation Wait for things to load Click the Begin button This will allow you to simulate the sampling process and will show you examples of sampling distributions If you re having trouble understanding sampling distributions suggest you look at this again later Sampling Distribution of the Mean There is same population gt Take samples of size N X Central Limit Theorem Population with mean u and variance 52 The sampling distribution of the mean approaches a normal it Always Regardless of distribution in the population Furthermore The mean of the sampling distribution is u T The variance is 0le 0 Thus standard error of the mean is what When N is large the sampling distribution is extremely close to a perfect normal i This is really key and another reason why the normal is so important More on the CLT What s the deal with approaching a normal as a function of N How much N Depends on the population distribution If the population distribution is normal the sampling distribution of the mean is perfectly normal regardless of the size of N Consider the case where N 1 Otherwise the degree of normality is a function of g Shape of the population distribution N For symmetric unimodal distributions small N works great For weird shapes sometimes more N is necessary Using the Sampling Distribution of the Mean If we know the population parameters we can make probabilistic statements about sample means For example given 14500 0100 N 25 What s the probability we draw a sample with a mean of 560 or greater How do we use the sampling distribution to do this Using the Sampling Distribution of the Mean Sampling distribution is normal with mean of 500 Standard deviation 7 100 20 W 42 5 9 What is the probability that a score of 560 or greater would be obtained from a distribution with those properties We recently discussed this procedure 0 Using the Sampling Distribution of the Mean Must convert 560 to a zscore VVhy u is 500 for both population and sampling distribution What do we use for G 3 H ZM ZM 7M 560 500 20 What s the probability of a zof 3 or more How does this relate to the original question So What So why would we care about this For Next Time Read Howell 41 45 on sampling distributions Homework 3 due on Friday Advanced Psychological Statistics Psychology 502 Power 2 Eilir lhiil39 2f WU Overview Questions Another example Power for the paired ttest Discussion O O 9 Another Power Example The diet center problem A diet center claims to have a great new weight loss program that really works Here39s there evidence ten people came in and had their weight measured before and after being on the diet program for one week For each person a change in weight was computed The average change was a loss of 311 pounds but we magically know 5 to be 562 or is 005 twotailed The basic questions What s the null and how would we test it A What was effect size What was the power How many subjects in replication to have power of 090 Now what if s not 0 is 562 O O O O O Paired ttest Power Two ways to think about a paired ttest Difference scores x Compute difference score Test whether that difference is equal to zero How do we do power This is the singlesample case 8 dfN f N W This is very straightforward There is another way to think of paired ttests however which requires correlation O O O O 0 Correlation and Paired ttest The two dependent variables in a paired situation are normally correlated The standard deviation of the difference score is a function of the covariance CD 4012 a 200V12 But note that the covariance is really cov12 0102p12 Now what if we assume that the two variances are equal 0D 2 4202 00p 2 o 21 p Can estimate parameters from a sample O O O 9 Using Correlation SD 6 21 p gt SD s 21 r What is 0D if p 0 What is 0D if p gt 0 Use this standard deviation to compute d IH1 H2I gt dzlf172 c7D SD d What are the implications of the correlation between the two observations for power a That is what happens to power if the correlation is high VVhy Paired t Power Once you have d you can do power calculations as normal Given N and effect size compute power A Given effect size and power compute N If the correlation between paired observations is zero then this will be the same as the independent t test In most situations Pairs are multiple observations on the same subject Responses are correlated RTs Fast subjects in one condition still tend to be fast in other conditions Any other individual difference that has some stability Howell s Discussion Scenario Prentice amp Miller 1992 Page 229 in your text Some research focused on minimizing effects and still finding a difference In the studies we have described investigators have minimized the power of an operationalization and in so doing have succeeded in demonstrating the power of the underlying process 0 What did you think of this Is that really a minimal power situation Is this approach reasonable a Is it always important to find large effects When might it be critical to find very small effects Power Discussion 0 Increasing N Pro Always works Con Often infeasible Requires additional time More subjects may not be available Other costs Money patience etc Increase effect size How 0 Use large differences between conditions Use sensitive or lowvariance measures Pro Often cheap Con Not always possible Con May make manipulation obvious Withinsubjects Designs 0 Pros Efficient More data per subject High power Cons Not all studies are workable withinsubjects Can make experimental sessions long Other pros and cons Poor Power 0 Consequences of poor power Never good to be in a situation where you re unlikely to succeed even when you re right Wasting time energy money etc Really can t say anything useful about null Many times you can t help but have low power Should at least be aware of the situation High Power Consequences of high power In principle none In practice Technically null hypothesis is always false Can draw criticism for finding easy results For Next Time Homework 7 will be due Oct 8th No class next week For the following Tuesday Whatever we didn t finish today Discussion about hypothesis testing as a practice Talk about how to properly report statistics Talk about how to handle outliers Midterm handed out No homework while midterm is out Advanced Psychological Statistics Psychology 502 Hypothesis Testing 2 lL llttvli Hi 2 39 Overview Issues in hypothesis testing Directional testing Failing to reject Statistical significance Which hypothesis o QampA on the midterm O O O 9 Issues Not everything in the world of inferential statistics is cut anddried This is not calculus or trig Many issues in the use and interpretation of inferential statistics that cannot be settled by mathematics No formulae to grind No right or wrong answers But there are poorlyconsidered ones You have to actually think about them Thinking is widely regarded as errorprone and therefore dangerous a I m willing to take that chance O O O O Directional Hypotheses Two types of hypothesestests Directional Nondirectional Which one should we use Why Directional test has better power But only when true difference is in hypothesized direction Statistics packages generally report twotailed tests Discussion Howell seems to fall on the side of the twotailed Do you agree Why or why not O O O Failing to Reject Multiple interpretations of what to do when rejection of the null is not called for No logical justification for accepting the null If null hypothesis is true then there s a 5 chance that test statistic will be of a certain extremity Analogous to PgtQ P is null hypothesis Q is distribution of test statistic Observing Q and concluding P is a fallacy Fisher took hard line on this Absolutely cannot accept the null Behave as if you now know NOTHING different than before you did the test O O NeymanPearson NeymanPearson Sometimes the pragmatic thing to do is not always the logically justified thing to do Don t conclude null is true but behave as is if null is true Power Notions of power assist NeymanPearson s position Allow us to make probabilistic statements about the probability of rejecting the null Discussion In practice many people speak in Fisherlike terms eg fail to reject but behave in NeymanPearson terms treat null as true What s your take on this Why O O Bayesian Perspective A much different perspective Don t even consider accept or reject Instead consider level of belief in some hypothesis H1 as a probability pH1 Prior belief in the null pHO is 1 pH1 a Consider the data obtained as evidence E Consider this probability pE HQ a What is it How can we compute it With Bayes s Theorem now compute pH1 E O O O Bayesian Perspective Plug in the terms from the last slide we can compute our new level of belief in H1 given our new evidence PEH1IPH11 PEH1PH12PEH0IEH0 There are clear conceptual advantages of this vs traditional significance testing K Such as However this is not typically done Why not PH1E O O 9 Statistical Signi cance When a value for the test statistic is found in the region of rejection the test is said to be statistically significant at the alpha level For example the difference is significant at the 005 level The adjective statistical is often dropped Dictionary definitions of significant Important in effect or meaning Deserving to be considered momentous Do those have anything to do with statistical significance No not necessarily O O O 9 Signi cance Example Someone claims the income of a particular group is on average 10 million Null hypothesis u 10000000 Alpha level 005 two tailed reject if z gt 196 The test Collect a sample of 20000 Discovered mean is 10000100 Standard deviation is 7000 sEM 7000sqrt20000 4949 z 1004949 202 202 gt 196 reject null Is this difference significant O O 0 Choice of Terminology Statistical significance is a technical term Should not be confused with importance or validity Quote from Hayes Highly analyzed and significant results are often confused with good results What does a p value really represent Probability that result obtained would have occurred by chance if null is true It s a statement about reliability In significance testing a p of 00001 is treated the same as a p of 0049 Is this reasonable Suggestion Use term statistically reliable or reliable rather than significant O O O O Marginal Signi cance Sometimes you ll see a paper refer to a p value between 05 and 10 as marginal significance What is that supposed to mean This is technically incorrect According to some being marginally significant is like being marginally pregnant Do you ever read any references to pvalues only slightly better than 05 as marginally insignificant Cannot have it both ways If you re hypothesis testing it s either significant or it isn t x If you re not then you shouldn t be using the term significant anyway Testing Hypotheses Definition of hypothesis My dictionary A tentative explanation that accounts for a set of facts and can be tested by further investigation Judd et al Relations between constructs and relations between constructs and observable indicators Hertzog An empricallytestable assertion of truth Scientific method The systematic empirical investigation of hypotheses Test the empirically observable consequences of the hypotheses Levels of Hypotheses A testable assertion about the state of the Substantive world typically aimed at the level of constructs Hypothesis Construct A causes construct B for population X in condition Y H Empirical Operationalization of the Substantive Hypothesis Hypothesis constructs manifested as observable measures f Statistical Probabilistic statement about the likelihood of an Hypothesis event class usually a null hypothesis Examples o Substantive Strategy training improves performance on standardized tests for high school students 9 Empirical Two hours of training on the Foo strategy improves SAT scores in a group of high school students relative to a control group receiving general knowledge training 0 Statistical The mean SAT score of the group receiving general knowledge training the mean of the group receiving strategy training Operationalization O The process of moving from substantive to empirical is called operationalization That is constructs are operationalized as measures In the previous example performance on standardized tests was operationalized as SAT score Most examples in psychology are much less trivial Working memory capacity Selfesteem Behaviorism was a rejection of constructs among other things in part because of operationalization issues 9 O O O O O O Inference Issues Construct Validity Are the measures true measures of the constructs Are there really constructs Alternative hypotheses In principle alternatives always exist Impossible to rule out all of them a Best we can do Generate plausible alternatives Rule them out Logical entailment is not supplied by scientific method Best we can do is show something is false and even that s tricky O O 9 Statistics and Science Science is really about substantive hypotheses Even better substantive and maybe even quantitative theories Essentially all we can do with statistics is shed some light on the likelihood of particular statistical hypotheses r Just because you do statistics and get significant results does not mean you re doing science 4 Similarly failure to generate significant results does not mean you re not However probably best to be wary of people who make strong scientific claims without strong theoretical or empirical basis Statistics is a critical piece of the puzzle in psychology as a science but it is not the only piece For Next Time Finish the midterm For next Tuesday read Howell 111 117 QampA on the Midterm So we have some time for questions Advanced Psychological Statistics Psychology 502 Factorial ANOVA 2 Overview 9 Questions Other factorial basics Contrasts and posthocs on main effects Magnitude of effects Interpreting interactions Simple main effects Contrasts Posthocs 0 Power Higherorder designs 9 O O Results Hard Medium Easy Athlete 302 178 3147 College 378 214 3200 4160 3400 1960 3173 C N i Athlete College Population I Results SPSS versmn Tests of BetweenSubjects Effects Depend entVari able SCORE Typelll Sum Source 0 Squares df Mean Square F Sig Corrected Model 580 85333 5 1161707 97531 000 Intercept 604 20267 1 604 20267 507 2597 000 POP 4267 1 4267 358 552 Dl FF 499 4133 2 249 7067 2096 42 000 POP Dl FF 810133 2 405067 34007 000 Error 643200 54 11911 Tdal 668 72000 60 Corrected Total 6451733 59 3 R Squared 900 Adjusted R Squared 891 Magnitude of Effects Effect size Proportion of variance measures As used in power calculations Proportion of variance accounted for Sample has some variability The question How much of that variability can be accounted for on the basis of the independent variables The sum of squares for a particular effect represents variability you can predict Why Because you know the values of the V s for any particular observation Like for oneway ANOVA EtaSquared Conceptually the proportion of variance accounted for would be The sum of squares for an effect Divided by the sum of squares total The population parameter for this is n2 R2 is the sample statistic that estimates n2 SSW R SSA R Rim S S total S S total SStotal The problem R2 is a biased estimator Systematically overestimates the population parameter O O O O OmegaSquared There is more than one way to adjust this estimate to remove bias Omegasquared is one but it s a reasonably common one in the ANOVA context 602 SSA deMSe A SS MSE total Similar for B and for the interaction of A and B Same issues as for oneway ANOVA O O O Omegasquared Example From the motor skill athletes vs college experiment For effect of A population 2 SSA deMSe 427 1119 coA 001gt 00 SSWl MSE 64517 119 For effect of B difficulty 0 SS3 de MSe 499413 2119 SS MS 64517119 For interaction 2 SSW dexBMSe 81013 2119 3 SS MS 64517 119 069 total 2012 total O O O O Contrasts What if you have a hypothesis about a main effect which is more specific than some marginal mean is different than the grand mean Can still do contrasts in factorial designs Two kinds of contrasts a Main effects contrasts Interaction contrasts Main effects contrasts Can do contrasts on each factor ignoring the other factors For example could contrast hard vs quotmediumquot and easy with contrast 2 1 1 Independent of other factors O O 0 Main Effects Contrasts Again these are particularly useful if you have specific hypotheses in advance Same kind of contrast statements as with oneway ANOVA UNIANOVA score BY pop diff CONTRASTdiff SPECIAL 1 o 1 CONTRASTdiff SPECIAL 2 1 1 CONTRASTpop SPECIAL 1 1 Slight complications 1 Must remember how your means are ordered in the data file 1 Should adjust for multiple comparisons Treat each factor as a family SPSS Contrast Output Contrast Results K Matrix Dependent SCORE e2 2 000 Hypotheslzed Value 0 DlFF Speoal Contrast Ll Difference ESIlrnateyl lypotheslzed 42000 Std Error 109 000 724188 if 9812 95 Confidence lrlterval forlefererioe Upper Bound Low er Bound Test Results Depend enWaiable SCORE Source Mean Square 4840 000 M 91 r F Co rltra St 4840 000 l 406 343 Error 643 200 54 0 You ll get two tables for each contrast this is the set from the first contrast Just like with oneway ANOVA O O O 9 Main Effect Posthocs What if we 1 Didn t have prior hypotheses 2 Found a reliable main effect 3 Wanted to look for differences in marginal means Same procedures as in oneway ANOVA Do a posthoc Can do posthocs on marginal means or cell means Marginal means for main effects Cell means for interactions Marginal means are easy UNIANOVA score BY pop diff POSTHOC diffQREGW Runs the REGW on the marginal means Main Effects Posthoc Output SCORE RyanEinot GabrielWelsch Ran gea Subset DI FF N 1 2 3 Easy 20 19600 Medium 20 34000 Hard 20 41600 1000 1000 1000 Means for grou ps in homogeneous subsets are displayed Based on Type III 81m of Squa res The error term is Mean SquareError 11911 8 Alpha 050 Note that all three marginal means are different Interpreting Interactions I Hard Medium I Easy Athlete College Population Many ways to interpret most interactions A viable interpretation here might be Effect of difficulty occurs only when the population is athlete Interpreting Interactions 45 I Athlete 40 I College 35 Hard Medlum Easy Difficulty 0 Alternative interpretation 3 Effect of population is reversed for high difficulty General Problem There is no cutanddried formula for interpreting interactions 9 There are three reasonably common approaches Eyeball it Simple main effects Interaction contrasts Can also do posthocs on the cells Eyeballing it the interocular trauma test What does the interaction look like You must plot the means for this Probably the most common Probably the worst But even if you plan on doing something more sophisticated you should always start with this a I a Simple Main Effects Turn your multiway ANOVA into a bunch of oneway ANOVAS For our example there are two ways you could do this Two oneways One for college population One for athlete population Each one of these has three levels Looking for one to be reliable and the other to not be That is effect of difficulty for one group but not the other Thee oneways One for each of the three levels of difficulty Each of these oneways would have two levels Looking for differences in reliability between the three Simple Main Effects Caveats For this to really work out you have to do something that isn t really kosher which is Accept the null Further complicated by this fact SME ANOVAs have less power than the overall factorial ANOVA VVhy Can help correct for this by using overall MSE Still might not help interpretation VVhy 9 Despite all this sometimes this still works Simple Main Effects Lmka ww pwmwm TEMPORARY SELECT IF pop 0 UNIANOVA score BY diff LWKWWmhmmypwmwm w TEMPORARY SELECT IF pop 1 UNIANOVA score BY diff Looking for one to be reliable and one to not be reliable ght College Population Tests of BetweenS ubjects Effects Depend entVai able SCORE Type II Sum Source of Squares df Mean Square F Sig COHECted MOdel 4113867a 2 2056933 175973 000 Intercept 297 04533 1 29704533 2541262 0 DI FF 4113867 2 2056933 1759 73 EITOI 315600 27 1168 9 Total M1 34000 30 Co me cted Total 442 9467 29 a R Squared 929 Adjusted R Squared 923 Effect of difficulty is reliable among those subjects in the boHege popma on Athlete Population Tests of BetweenS ubjects E ects Depend entVariabIe SCORE Type II Sum Source of Squ ares df Mean S anr e F Sig Corrected Model 169 0400a 2 845200 69659 000 Intercept 307 20000 1 307 20000 253 1868 000 DI FF 169 0400 2 845200 69659 ErTor 327600 27 12133 TOtal 327 38000 30 Co me cted Total 201 8000 29 8 R Squared 838 Adjusted R Squared 826 Reliable here as well Thus not especially helpful O O O 0 Interaction Contrasts Think of design as a giant oneway Generate a contrast on factor A Generate another contrast of factor B Interaction contrast would be the product of those two Interaction A A A C C C Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 2 1 1 2 1 1 Interaction Contrasts A A A C C C Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 Interaction 2 1 1 2 1 1 o This tests the second interaction hypothesis that I proposed 1 Effect of population is reversed for high difficulty hard 9 Does everyone see why Another Interaction Contrast A A A C C C Linear difficulty 1 O 1 1 O 1 Athlete vs College 1 1 1 1 1 1 Interaction 1 O 1 1 O 1 o Tests a different hypothesis First contrast is linear effect of difficulty Interaction contrast is the linear effect of difficulty different at the different levels of population Everybody see why Contrasts as Tables Hard Medium Easy Athlete 2 1 1 1 College 2 1 1 1 2 1 1 A A A C C C Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 interaction 2 1 1 2 1 1 Contrasts as Tables Again Hard Medium Easy Athlete 1 0 1 1 College 1 0 1 1 1 0 1 A A A C C C Linear difficulty 1 Ci 1 1 D 1 Athlete VS College 1 1 1 1 1 1 Interaction 1 O 1 1 O 1 Polynomial Interaction Contrasts Icon Search I Simple Complex 4 Blank Response time sec of icons on display Icon experiment three types of icons Reliable interaction of icon type and set size 9 Increase in slope is uniform linear too Building the Contrast icons 6 12 18 24 Simple 3 1 1 3 1 Cmplx 0 0 0 0 0 Blank 3 1 1 3 1 3 1 1 3 Linear contrast on display size is 3 1 1 3 9 Linear contrast on icon type is 1 0 1 The idea a Line best fits effect of display size The lines for different icon types have different slopes That s an interaction Another Example o What would we want to test 0 What would that contrast look like Another Example Group 1 2 3 4 5 1 2 1 O 1 2 1 2 2 1 O 1 2 1 3 2 1 O 1 2 1 4 2 1 O 1 2 1 2 1 0 1 2 o Tedious but doable 0 Everyone clear on this idea Another Example What would we want to test 0 What would that contrast look like Another Example Group 1 2 3 4 5 1 2 1 2 1 2 1 2 2 1 2 1 2 1 3 2 1 2 1 2 1 4 2 1 2 1 2 1 2 1 2 1 2 o Tedious but doable 0 Everyone clear on this idea 9 Interaction Contrast Pros and Cons Pros Allow you to test very specific interaction effects Good power Overall error term is still the same MSE No loss of degrees of freedom Generally easier to interpret Cons Can still have trouble finding one that makes sense Can be hard to explain clearly even when you do find them a Can still find more than one is reliable Can still find none are reliable Most sophisticated and sensitive method O O O 9 Interaction Contrasts It turns out that SPSS will not run an interaction contrast correctly with UNIANOVA Best strategy is to break it into a oneway Need a new variable cell which represents the six cells BE CAREFUL Make sure that the cell numbering and your contrast weights match up a Very Common error Useful to compute the contrast by hand to make sure output is right Forming the CELL Variable 0 Assume pop is coded 0 1 and diff is coded 0 1 2 Here s the SPSS code to make this happen long way w COMPUTE cell IF IF IF IF IF IF POP POP POP POP POP pop 0 Here s the short way COMPUTE cell r Where d the 3 come from Could we have used 10 Would this still work if data were coded 1 2 and 1 2 3 O l l OO l and and 0 diff 0 THEN cell diff 1 THEN cell diff 2 THEN cell diff 0 THEN cell diff 1 THEN cell diff 2 THEN cell diff 3pop U IiFLONl O Interaction Contrasts olhmdoamewwonmme wcmm bwmwmt UNIANOVA score BY cell CONTRASTcell CONTRASTcell SPECIAL1 0 SPECIAL 2 1 ContrastRes Ilts K Matrix 1 10 1 1 2 1 1 CE LL Special 00 ntrast De pend ent Variable 30 OR E Contrast Btimate Hypolhesized Value Difference Esli rrahe Hypothesized Std Sig 95 Con den ce Error Lower B ound Inherv al for Diffe rence U pper B ound 304 00 0 304 00 3781 379 80 228 20 Interaction Posthocs Essentially want to do posthocs on individual cells Harder to do Must use the CELL variable that represents the individual cells Run a oneway ANOVA Do posthocs Code a UNIANOVA score BY cell POSTHOC cellQREGW Cell Posthoc Output SCORE RyanEinotGabrielWelsoh Ran gea b Subset CELL N 1 2 3 4 2 10 1780 0 5 10 2140 0 1 10 30200 3 10 38800 4 10 37800 0 10 48400 sig 069 1000 889 1000 Means for groups in homogeneous subsets are displayed Based on Type III Sim oquJares The error term is Mean SquareError 11 911 a Critical values are not monotonic for these data SLbstitutions hav e been made to ensure monotoni city Type I error is therefore smaller 13 Alpha 050 o How helpful is this in interpreting the interaction O O 0 Power All the usual stuff applies Changing or changes power Changing effect size changes power Absolute size of effects Variance Changing N or n changes power Not much different than oneway designs Recall the oneway 2 P k0 V Power computed separately for each factor and the interaction O O O 9 Power Equations Power for Factor A 2 05 I P 2 A PA Kn Joe2 Power for Factor B I 23982 J PB K02 BZ B Jquot Power for interaction 2 2 043 Png 2 JK 2 PAxB PAxB I 08 Same conventions for p39 Small 010 medium 025 large 040 Power Example Once you have I can compute power Use noncentral F table in your book Example Power for interaction from our example study P 20432 506235321532 I 8094 B I JKoj V 23MSe 61184 png 21067 PM PijZ 2106745 2 338 o How many df o Resulting power is extremely good Why HigherOrder Designs Can have more than two independent variables as well Consider three factors A B amp C Lots of effects and lots of null hypotheses Main effect of A Main effect of B Main effect of C Interaction of A and B Interaction of B and C Interaction of A and C Interaction of A B and C o Fourway and fiveway designs happen too 0 Interpreting higherorder interactions can be very difficult 3way ANOVA Effects Gets ugly very quickly J is levels of A K is levels of B L is levels of C 702 SSA Kano 1an 2 SSAxC 1012205731 2 10122 701 75 00 71 2 SSAxBxC quot2220437011 quot2220 ka C O j k yz O jk 7kz ayl39i2 Same basic ideas Mseffect SSefffect d39f39 efffect One MSerror computed from within cells 1 Form Fratios by dividing MSefffect by MSerror ThreeWay Example C1 B1 B2 B3 C2 B1 B2 B3 A1 22 19 40 27 A1 23 20 30 24 A2 9 26 50 28 A2 9 28 41 26 A3 27 14 37 26 A3 25 15 29 23 19 19 42 27 19 21 33 24 0 Grand mean 255 9 There are marginals that matter that aren t even in these tables Marginals for A and B Marginals for AB 0 Those marginals might matter If an AxB interaction appears then you ll need to look at those O HigherOrder Interactions Can be very difficult to interpret Simple main effects Often become simple interaction effects i For example Break up a threeway into two twoways See if the interactions are the same in both twoways Posthocs on interaction marginals Must recode to collapse across one or more factors Interaction contrasts can be arbitrarily complex But very specific No standard way no strict formula to follow Even more so than for twoway designs C1rA Iii 5 B n I 3way Interaction gtltgtlt A2 0 SPSS code UNIANOVA dep BY a b c For Next Time Finish whatever we didn t get to today plus new stuff like Higherorder designs unbalanced designs fixed vs random effects magnitude of effects If you haven t read chapter 13 please do so HW10 due next week Tuesday Advanced Psychological Statistics Psychology 502 Factorial ANOVA O O O O O O 9 Overview Finish up posthocs Overview of simple ANOVA procedures Factorial ANOVA Basic concepts Sums of squares Interpreting interactions Simple main effects Contrasts a Posthocs Probably won t get through all of it which is fine O O O O Dunnett Test Something in between a posthoc and a planned comparison Compare all other groups against a control group ZMSE CV rd J H Table for td in the textbook p 688 Need 0 k and dfe If the difference between a treatment and the control group exceeds the critical value reject a Conclude that treatment differs from control O O 9 More on Dunnett Good power but very specific requirements Will not test whether treatment groups differ from one another SPSS and others do it as a posthoc you have to tell it which group is the control group O O O O Posthoc Contrasts What if you don t have specific hypotheses but after you run the ANOVA you come up with some Example You run an experiment with an ordinal independent variable No real hypothesis other than conditions will be different a Overall ANOVA is reliable But it appears that means increase across the conditions Linear contrast seems appropriate but doing it after you ve seen the data will not preserve Type I error rate I This is cheating However there is an adjustment O O Scheff If the overall ANOVA F test is reliable then there is some contrast that will be reliable The Scheff adjustment controls familywise error rate for all possible contrasts What is the adjustment a Compute the Fvalue for the contrasts How many contrasts As many as you want Orthogonal not orthogonal doesn t matter lt But use a different critical value for F Find the critical value for the omnibus ANOVA Multiply that by k 1 Compare the F for the contrast to this new critical value More Scheff o The Scheff procedure is conservative The criterion is extreme A Power isn t necessarily great in many situations On the plus side It is incredibly flexible Power is not bad if you re testing for a specific pattern that is actually present 9 Scheff is fine for specific and complex contrasts But the computer generally won t do the adjustment for you Howell on Scheff Note that SPSS and others have a posthoc caed Scheff in them This generates the set of contrasts that test each individual pair of means eg 1 1 O 0 and uses that to find pairwise differences a This is not the same as a Scheff adjustment to the critical Fvalue for a more complex contrast Howell recommends against Scheff What he s really objecting to is Scheff as a method for pairwise tests This is reasonable As a general point though this is a bit extreme Scheff is fine for more specific contrasts Posthocs in SPSS Both ONEWAY and UNIANOVA support posthocs ONEWAY recall BY cond POSTHOC SNK TUKEY LSD QREGW ALPHA 05 UNIANOVA recall BY cond POSTHOCcondSNK TUKEY LSD QREGW COND tells it which V to do posthocs on The names are different posthoc tests LSD is Fisher s LSD SNK is StudentNewmanKeuls TUKEY is Tukey s HSD QREGW is RyanEinotGabrieIWelsch i There are bunches of others 0 Usually you ll only supply one not all of them Pairwise Output Multiple Comparisons Difference Based on observed means The mean difference is significant at the 050 level Subsets Output RECALL 2 10 1 10 Means for groups in homogeneous subsets are displayed Based on Type III Sum of Squares The error term is Mean SquareError 19837 8 Uses Harmonic Mean Sample Size 10000 b Alpha 050 Interpreting Groupings Sometimes the output of the posthoc procedures is less than totally helpful Example What can you say from this Means 1 and 2 are different from Means 4 and 5 Can t say anything about Mean 3 though This can often be difficult to interpret particularly when there are many cells and multiple overlapping groupings of means Putting It Together We ve seen a lot of different things to do in ANOVA How should these all be combined If you have specific hypotheses you should use planned comparisons Bonferroni or Sidak error rate adjustments are appropriate Some people have argued that if all the contrasts are orthogonal the Bonferroni adjustment is not necessary Common in practice Technically you should do Bonferroni adjustments for orthogonal contrasts A For nonorthogonal contrasts Technically should do Sheff Must at least do Bonferroni Putting It Together If you do not have specific hypotheses in advance just do the omnibus ANOVA If the overall Ftest is not reliable you re done testing Maybe compute power for observed effect size If the omnibus ANOVA is reliable Look for pairwise differences with some kind of posthoc procedure Which one Up to you but like Howell recommend the Ryan et al procedure You will see some of the other ones a Or do contrasts with Scheff adjustments Test whatever the heck you want As many as you want O O Factorial ANOVA Basic Concepts Still only one dependent variable More than one independent variable Each variable has two or more levels a Each independent variable is called a factor Start with two factors A and B Goal is to asses a Effects of factor A has J levels I Effects of factor B has K levels Interactions of A and B What is an interaction O O O Interactions When the effects of one independent variable depend on the level of another independent variable they are said to interact Annn Example 3500 3000 2500 lnterpreting the meaning of an interaction can be tricky 2WD 1500 Hasponse Tlma ms 1000 Groupl Groupz I I I 6 12 18 24 Set Size O 9 Linear Model xijk aj k 0 jk eijk Each observation is a function of a Grand mean Effect of being in levte of factor A i Effect of being in level k of factor B Effect of being in both levte of factor A and level k of factor B Normally distributed error mean of zero Standard deviation of as The question a Which of these sets of terms best describes the data O O O Null Hypotheses No effect of factor A x1x20c3XJ0 Olj j M No effect of factorB BfBZBSmBKO k H k H No interaction X511 04512 XBJK 0 a jk ij lJ O j k How do we evaluate these Same general idea as overall ANOVA An estimate of population variance for each effect Compare with withincells population variance estimate O O 9 Example ctional Looking at performance on a gamelike task involving motor skill High scores indicate better performance Two populations of subjects a Professional athletes College students Three levels of task difficulty Hard medium easy The harder the task the more difficult it is to score When scores are earned they re higher High risk high reward O O O 0 Questions 60 total subjects 10 per cell Does difficulty affect performance A Perhaps performance is not affected by difficulty in a kind of speedaccuracy tradeoff Does the population affect performance Pro athletes actually better Do they interact 7 For example maybe pro athletes are only better in the higherrisk higherreward conditions Results Hard Medium Easy Athlete 464 302 178 3147 College 368 378 214 3200 4160 3400 1960 3173 Mean Score Athlete College Population Evaluating the Model How do we evaluate these three hypotheses Conceptually Compute an error term from withincells variance Need to assume homogeneity Compute terms for main effects Average over other variable that is pretend it doesn t exist Then do the same as the oneway and compute the sum of squares between Compute terms for interaction If no interaction can predict cell means based on main effects Take difference between predicted cell mean and actual cell mean Convert to a sum of squares Sums 0f Squares Sum of squares total Sum of all squared deviations from the grand mean Sum of squares for factor A Sum of all squared deviations of each marginal mean from the grand mean SSW SST 222 m2 Weighed by the number of observations contributing Why is this K and not J SSA 2101092 2 K1125 72 Getting J vs K Bl B2 B3 A1 10 1O 10 30 A2 10 1O 10 3O 2O 2O 2O 6O 9 Consider this simple design Number in each cell is n for that cell Note that there are 30 observations at each level of A 20 at each level of B More Sums 0f Squares Sum of squares for factor B lsomorphic to factor A Sum of all squared deviations of each marginal mean with from the grand mean lt Weighed by the number of observations contributing SSB ZJni JnZO ck 702 0 Sum of squares for interaction Adjusted deviation of each cell mean from grand mean a Corrected for marginals weighting for n SSAXB 2221104311 quotEEO le 75 Ck 32 Still More Sums 0f Squares Sum of squares for error Sum of squared deviations of each individual observation from its cell mean SSe 222Ejk 3102 Once again they add up SS 2 SSA SSB SSAB SS8 total However this all depends on the n s in each cell being equal a Things get messier when they aren t we ll get to that later O O O O 9 Degrees of Freedom How many total degrees of freedom N 1 How many degrees of freedom for A J 1 How many degrees of freedom for B K 1 For the interaction 1 J 1K 1 For error Everything that s left NJK O O 9 Mean Squares Each also has a mean square Sum of squares divided by degrees of freedom Expected value of mean square error represents the same thing in factorial ANOVA as it does in oneway ANOVA Same value whether null is true or not EltMSEgt a What about mean square for A 11206 J 1 EMSA a a What will this be when the null is true O O 0 More Mean Squares Expected value of the mean square for B 1 EMSBo K Expected value of the mean square for interaction or AxB nZZa fk 2 EMSM 02 J1K1 We have four estimates of the error variance One is stable regardless of the status of the null a The others are not O O O O O Fratios Form Fratios by dividing mean square for each effect by the mean square for error Consider the Fratio for A MSA MS 6 FJ 1N JK 2 Now expected values 2 101206 0 EMSA 3 J 1 EMSe 0 2 e E021 What happens when the null is true When it s false Sampling distribution under the null conforms to standard F distribution Results Hard Medium Easy Athlete 464 302 178 3147 College 368 378 214 3200 4160 3400 1960 3173 Athlete College Population O O O O 0 Sum of Squares for A Population Grand mean is 3173 Marginals are 3147 and 320 n10J2 K3 SSA an a K1126 if Estimated 01 31 47 31 73 026 Estimated 02 2 SS A K1125 if 310 0262 0262 ssA 4056 O O O 9 Sum of Squares for B Dif culty Marginals 4160 340 1960 Estimated 31 4160 3173 987 Estimated 32 340 31 73 227 Estimated 33 1960 31 73 0 987 227 1214 SS3 2 mien 702 SSE 2109872 2272 12142 4 998988 Sum of Squares for Interaction Est 0161 464 3147 4160 3173 506 Es 04312 302 3147 3400 3173 353 Es 01613 178 3147 1960 3173 154 Est 0162 368 3200 4160 31 73 507 Est 01622 378 3200 3400 31 73 353 Es 011323 214 3200 1960 3173 153 o o SSW nEEa fk nEEOTJk cj 7ck 32 SSW 105062 3532 1532 809428 O O 9 Sum of Squares Error To get this we d need either Individual observations Standard deviations for the cells Sum of Squares Total What would we do it we had 88ml Add up the other three sums and subtract If we get individual standard deviations SS 22an 1s k n 1gt22s k Say we re given SStotal 645173 886 645173 4056 4998998 809428 886 639248 ANOVA Table Source g f MS E A pop SSa J1 SSaJ1 MSaMSe B diff SSb K1 SSbK1 MSbMSe AXB SSaxb J1 K1 SSadtaxb MSaxbMSe Error SSe NJK SSeNJK Total SSt N1 Source g g MS E A pop 4056 1 406 034 B diff 4998998 2 249950 21114 AXB 809428 2 40471 3419 Error 639248 54 1184 Total 6451 73 59 Factorial ANOVA in SPSS Label the variables ADD VALUE LABELS pop 0 quotCollegequot ADD VALUE LABELS diff 0 quotEasyquot Start with UNIANOVA UNIANOVA score BY pop diff PLOT PROFILE diffpop PLOT PROFILE popdiff PRINTDESCRIPTIVES 9 quotAthletequot 1 quotHardquot 1 quotMediumquot 6 O You should probably already have seen this with EXAMINE to look for unequal variance or outliers o The PLOT is a quickie for getting at interactions 2 The DESCRIPTIVES will print out basic descriptive stuff Output Part I Tests of BetweenS ubjects E ects Depend entVai able SCORE Type III Sum Source of Squ ares df Mean S anre F Sig Coneded Model 58085333 5 1161707 97531 000 Intercept 004 20267 1 604 20267 5072597 000 POP 4267 1 4267 552 D1 FF 499 4133 2 249 7067 209642 000 POP DI FF 810133 2 405067 34007 000 Error 6432 00 54 Total 668 72000 60 Conededrmal 6451733 59 8 R Squared 900 Adjusted R Squared 891 o Ignore corrected model intercept and total use corrected total Output Part 2 Estimated Marginal Means of SCORE 50 40 m c 3quot E 30 Tu E C s m E 20 E POP m g 393 All llele 395 1 Lu 10 College Hard Medium Easy DIFF Output Part 3 Estimated Marginal Means Estimated Marginal Means of SCORE 50 40 30 DIFF 20 a Hard a Medium 10 393 Easy Athlete College POP Interpretation Interaction is reliable At least one ocBJk is not zero Main effect of population is not reliable Main effect of difficulty is reliable At least one 5k is not zero What does all this mean Often a sticky problem Many most stats folks would argue that you should worry about the interaction first and only consider main effects in the context of any interactions Going back to the example should help Interpreting Interactions I Hard Medium I Easy Athlete College Population Many ways to interpret most interactions A viable interpretation here might be Effect of difficulty occurs only when the population is athlete Interpreting Interactions 45 I Athlete 40 I College 35 Hard Medlum Easy Difficulty 0 Alternative interpretation 3 Effect of population is reversed for high difficulty General Problem There is no cutanddried formula for interpreting interactions There are three reasonably common approaches Eyeball it Simple main effects a Interaction contrasts Eyeballing it the interocular trauma test What does the interaction look like You must plot the means for this Probably the most common Probably the worst But even if you plan on doing something more sophisticated you should always start with this n a Simple Main Effects Turn your multiway ANOVA into a bunch of oneway ANOVAS For our example there are two ways you could do this Two oneways One for college population One for athlete population Each one of these has three levels Looking for one to be reliable and the other to not be That is effect of difficulty for one group but not the other Thee oneways One for each of the three levels of difficulty Each of these oneways would have two levels Looking for differences in reliability between the three Simple Main Effects Caveats For this to really work out you have to do something that isn t really kosher which is Accept the null Further complicated by this fact SME ANOVAs have less power than the overall factorial ANOVA VVhy Can help correct for this by using overall MSE Still might not help interpretation VVhy 9 Despite all this sometimes this still works Simple Main Effects Lmka ww pwmwm TEMPORARY SELECT IF pop 0 UNIANOVA score BY diff LWKWWmhmmypwmwm w TEMPORARY SELECT IF pop 1 UNIANOVA score BY diff Looking for one to be reliable and one to not be reliable ght College Population Tests of BetweenS ubjects Effects Depend entVai able SCORE Type II Sum Source of Squares df Mean Square F Sig COHECted MOdel 4113867a 2 2056933 175973 000 Intercept 297 04533 1 29704533 2541262 0 DI FF 4113867 2 2056933 1759 73 EITOI 315600 27 1168 9 Total M1 34000 30 Co me cted Total 442 9467 29 a R Squared 929 Adjusted R Squared 923 Effect of difficulty is reliable among those subjects in the boHege popma on Athlete Population Tests of BetweenS ubjects E ects Depend entVariabIe SCORE Type II Sum Source of Squ ares df Mean S anr e F Sig Corrected Model 169 0400a 2 845200 69659 000 Intercept 307 20000 1 307 20000 253 1868 000 DI FF 169 0400 2 845200 69659 ErTor 327600 27 12133 TOtal 327 38000 30 Co me cted Total 201 8000 29 8 R Squared 838 Adjusted R Squared 826 Reliable here as well Thus not especially helpful 9 O Contrasts Can still do contrasts in factorial designs Two kinds of contrasts Main effects contrasts Interaction contrasts Main effects contrasts Can do contrasts on each factor ignoring the other factors For example could contrast hard vs medium and easy with contrast 2 1 1 Independent of other factors 0 O O Main Effects Contrasts 0 Same kind of contrast statements as with oneway ANOVA UNIANOVA score BY pop diff CONTRASTdiff SPECIAL 1 o 1 CONTRASTdiff SPECIAL 2 1 1 CONTRASTpop SPECIAL 1 1 0 Must remember how your means are ordered in the data file SPSS Contrast Output Contrast Results K Matrix Dependent DiFFSpedai Contrast SCORE L1 72 2 000 Hypothesized Vaiue 0 Difference Estimateri iypothesized 722000 Std Error 1 091 000 95C0nf1denoe Lower Bound 724188 inteNaiforDifferenoe UpperBound 49W Test Results Depend ent Varabie SCORE Surn of Source Squares or Mean Square 9 Contrast 4840 000 1 4840 000 400 343 000 Error 043 200 54 11 911 0 You ll get two tables for each contrast this is the set from the first contrast t Just like with oneway ANOVA O O O 9 Interaction Contrasts Think of design as a giant oneway Generate a contrast on factor A Generate another contrast of factor B Interaction contrast would be the product of those two A A A C C C Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 Interaction 2 1 1 2 1 1 Interaction Contrasts A A A C C C Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 Interaction 2 1 1 2 1 1 This tests the second interaction hypothesis that I proposed Effect of population is reversed for high difficulty hard Does everyone see why Another Interaction Contrast A A A C C C Linear difficulty 1 O 1 1 Q 1 Athlete vs College 1 1 1 1 1 1 0 1 1 0 1 Interaction 1 o Tests a different hypothesis First contrast is linear effect of difficulty Interaction contrast is the linear effect of difficulty different at the different levels of population Everybody see why Contrasts as Tables Hard Medium Easy Athlete 2 1 1 1 College 2 1 1 1 2 1 1 Hard vs others 2 1 1 2 1 1 Athlete vs College 1 1 1 1 1 1 Interaction 2 1 1 2 1 1 Contrasts as Tables Again Hard Medium Easy Athlete 1 0 1 1 College 1 0 1 1 1 0 1 A A A C C C Linear difficulty 1 0 1 1 0 1 Athlete vs College 1 1 1 1 1 1 Interaction 1 O 1 1 O 1 Polynomial Interaction Contrasts Icon Search I Simple Complex Blank Response time sec of icons on display Icon experiment three types of icons Reliable interaction of icon type and set size Increase in slope is uniform linear too Building the Contrast icons 6 12 18 24 Simple 3 1 1 3 1 Cmplx 0 0 0 0 0 Blank 3 1 1 3 1 3 1 1 3 Linear contrast on display size is 3 1 1 3 0 Linear contrast on icon type is 1 0 1 The idea Line best fits effect of display size The lines for different icon types have different slopes 1 That s an interaction Another Example o What would we want to test 9 What would that contrast look like Another Example Group 1 2 3 4 5 1 2 1 O 1 2 1 2 2 1 O 1 2 1 3 2 1 O 1 2 1 4 2 1 O 1 2 1 2 1 0 1 2 Tedious but doable 0 Everyone clear on this idea Interaction Contrast Pros and Cons Pros Allow you to test very specific interaction effects Good power Overall error term is still the same MSE No loss of degrees of freedom 1 Generally easier to interpret Cons A Can still have trouble finding one that makes sense v Can be hard to explain clearly even when you do find them Can still find more than one is reliable Can still find none are reliable Most sophisticated and sensitive method Interaction Contrasts It turns out that SPSS will not run an interaction contrast correctly with UNIANOVA Best strategy is to break it into a oneway Need a new variable cell which represents the six cells BE CAREFUL Make sure that the cell numbering and your contrast weights match up Very Common error Useful to compute the contrast by hand to make sure output is right 9 O O O Forming the CELL Variable 0 Assume pop is coded 0 1 and diff is coded 0 1 2 9 Here s the SPSS code to make this happen long way COMPUTE cell 0 IF pop O and diff 0 THEN cell 0 IF pop O and diff 1 THEN cell 1 IF pop O and diff 2 THEN cell 2 IF pop l and diff 0 THEN cell 3 IF pop l and diff 1 THEN cell 4 IF pop l and diff 2 THEN cell 5 Here s the short way COMPUTE cell diff 3pop Where d the 3 come from Could we have used 10 Would this still work if data were coded 1 2 and 1 2 3 Interaction Contrasts olhmdoamewwonmme wcmm bwmwmt UNIANOVA score BY cell CONTRASTcell SPECIAL1 o 1 1 o 1 CONTRASTcell SPECIAL 2 1 1 2 1 1 ContrastRes Ilts K Matrix Depend ent Variable 30 OR E 304 00 0 CELL Special Contrast Contrast Btimate Hypothesized Value Difference Esiirrahe Hypothesized 60400 Std Error Sig 95 Con den ce Lower Bound 379 80 Inherv al for Difference UpperBound 22820 3781 Posthocs Same procedures as in oneway ANOVA Candoposmocsonrnwgmalmeansorcdlmeans Marginal means for main effects Cell means for interactions Marginal means are easy u UNIANOVA score BY pop diff POSTHOC diffQREGW Runs the REGW on the marginal means Main Effects Posthoc Output SCORE RyanEinotGabrielWelsdw ngea Subset DI FF N 1 2 3 Easy 2 19600 Medium 2 34000 Ha rd 2 41600 Sig 1000 1000 1000 Means for groups in homogeneous subsets are displayed Bsed onType lll Sim oquJares The error term isMean SquareError 11911 a Alpha 050 Note that all three marginal means are different Interaction Posthocs Essentially want to do posthocs on individual cells Harder to do Must use the CELL variable that represents the individual cells Run a oneway ANOVA Do posthocs Code UNIANOVA score BY cell POSTHOC cellQREGW Cell Posthoc Output SCORE RyanEinotGabrieIWelsoh Ran gea b Subset CELL N 1 2 3 4 2 10 1780 0 5 10 2140 0 1 10 30200 3 10 38800 4 10 37800 0 10 48400 sig 069 1000 889 1000 Means for groups in homogeneous subsets are displayed Based on Type III Sim oquJares The error term is Mean SquareError 11 911 a Critical values are not monotonic for these data SLbstitutions hav e been made to ensure monotoni city Type I error is therefore smaller 11 Alpha 050 How helpful is this in interpreting the interaction For Next Time Finish whatever we didn t get to today plus new stuff like Power higherorder designs unbalanced designs fixed vs random effects magnitude of effects If you haven t read chapter 13 please do so HW10 due next week Tuesday Advanced Psychological Statistics Psychology 502 Factorial ANOVA 3 and Repeated Measures 1 Mn mixer l1 Slim Overview Questions Finish up factorial ANOVA Power Higherorder designs Unbalanced design stuff Fixed vs random effects Start repeated measures ANOVA Basic ideas Expected mean squares Example Power 9 All the usual stuff applies Changing or changes power Changing effect size changes power Absolute size of effects Variance Changing N or n changes power Not much different than oneway designs Recall the oneway 212 qj 2 kae O W 0 Power computed separately for each factor and the interaction Power Equations Power for Factor A 0 gig X maxim JG2 6 9 Power for Factor B 2E ww K06 Power for interaction 0 wa 206 AxB AxBquot JKO e 0 Same conventions for q Small 010 medium 025 large 040 Power Example Once you have I can compute power Use noncentral F table in your book Example Power for interaction from our example study ab 20652 5062 3532 1532 I 8094 B I JKaj V 23MSe 61184 gm 1067 M gangxZ 1067JE 338 o How many df o Resulting power is extremely good Why HigherOrder Designs Can have more than two independent variables as well Consider three factors A B amp C Lots of effects and lots of null hypotheses Main effect of A Main effect of B Main effect of C Interaction of A and B Interaction of B and C Interaction of A and C Interaction of A B and C o Fourway and fiveway designs happen too 0 Interpreting higherorder interactions can be very difficult 3way ANOVA Effects Gets ugly very quickly J is levels of A K is levels of B L is levels of C 702 SSA KLnEa KLnE 2 2 7 7 2 SSAXC Kn22xjl X39 Oj 39l SSAxBxC quot22205137 112220ij Caj k l z a jk l ki al ji2 Same basic ideas Mseffect SSeffect d39f39 effect One MSerror computed from within cells 1 Form Fratios by dividing MSeffect by MSerror ThreeWay Example C1 B1 B2 B3 C2 B1 B2 B3 A1 22 19 40 27 A1 23 20 30 24 A2 9 26 50 28 A2 9 28 41 26 A3 27 14 37 26 A3 25 15 29 23 19 19 42 27 19 21 33 24 0 Grand mean 255 9 There are marginals that matter that aren t even in these tables Marginals for A and B Marginals for AB 0 Those marginals might matter If an AxB interaction appears then you ll need to look at those O HigherOrder Interactions Can be very difficult to interpret Simple main effects Often become simple interaction effects i For example Break up a threeway into two twoways See if the interactions are the same in both twoways Posthocs on interaction marginals Must recode to collapse across one or more factors Interaction contrasts can be arbitrarily complex But very specific No standard way no strict formula to follow Even more so than for twoway designs I B B3 3way Interaction gtltgtlt O I A2 SPSS code for basic ANOVA UNIANOVA dep BY a b c O O O Unbalanced Designs So far we ve assumed that n is equal in every cell What happens when it isn t Conceptually things get messy Pragmatically this isn t great But it changes very little about how you run the ANOVA on the computer and how you interpret the printouts If you only remember one thing remember this w Use Type III sums of squares O O O The Problem When the n are equal in the cells all effects are independent That is effect of factor A does not depend on effect of factor B And vice versa Interaction does not depend on either A or B When the n s are not equal then the effects become dependent xj s can depend on Bk s If you do the standard computations this equality does NOT hold SS total SSA SSB SSAB SS O O O O O The Solution Conceptually Compute sum of squares for all effects called mode Compute SStotal and 88e normally compUte 88model 88total 39 SSe Compute 88 for each invidual effect by subtraction 39 SSAxB SSmodel 39 SSA 39 88B r 88A SSmodel 39 SSB 39 SSAxB 39 888 SSmodel 39 SSA 39 SSAxB Note that SSmodel gt SSAxs SSA SSB This is called Type III sums of squares We ll walkthough an SPSS example of this This is not exactly how the computer does it but it s close in concept You ll get into this more next semester O O 0 Example Consider a design with these n s B1 B2 B3 B4 5 5203565 352411575 40 29 31 40140 A1 A2 Look at cells A281 and A182 They contribute to all three ANOVA effects But they re much different in size To which effects should their 88 go Can tell stats packages to count them in certain ways Type I Sum of Squares A rst SPSScoda UNIANOVA dep BY a b METHOD SSTYPE1 DESIGN a b ab Tests of BetweenSubjects Effects 1 4688616 11437823 1 11437823 42846 3 9791066 3263689 12226 3 165361 619 35237260 132 266949 140 a R Squared 381 Adjusted R Squared 349 Type I Sum of Squares B rst SPSScoda UNIANOVA dep BY a b METHOD SSTYPE1 DESIGN b a ab Tests of BetweenSubjects Effects 1 4688616 17521425 3 5840475 21879 1 3707465 3707465 13888 3 165361 619 35237260 132 266949 140 a R Squared 381 Adjusted R Squared 349 Type III Sum of Squares SPSScode UNIANOVA dep BY a b METHOD SSTYPE3 DESIGN b a ab Tests of BetweenSubjects Effects 1 684649175 2564720 7287905 3 2429302 9100 1 3119292 11685 3 165361 619 35237260 132 266949 1 3119292 a R Squared 381 Adjusted R Squared 349 Why the Fuss If we re just reading the printout the same anyway why worry about this Powe When the design is balanced the Type sums of squares and Type III sums of squares are equal Type III sums of squares are always 5 Type sums of squares But the same error term is used This means smaller Fvalues Some of the sum of squares for the effects end up being thrown away Why Because it s impossible to tell which effect they belong to O O O O O O O O O Weighted vs Unweighted Means Horrible choice of terminology Consider two groups G1 3 4 5 G21516171819 MeanotG1is4meanotG2is17 What s the mean of the two groups a Weighted mean is sum of all observations divided by N 3451516m1812m5 Unweighted mean is the mean of the two group means 41n21o5 Can think of Type III sums of squares as ANOVA with unwdgMedmeww O Weighted Means SPSS code UNIANOVA dep BY a b PRINT DESCRIPTIVE Descriptive Statistics 1069286 856158 144850 124839 197862 1164315 1041855 162732 121939 160930 1147931 922051 829232 161508 151605 193068 Unweighted Means SPSS code UNIANOVA dep BY a b EMMEANS TABLESa EMMEANS TABLESb EMMEANS TABLESa Depende t Variable DEP 95 Con dence Interval Std Error 2826 82792 93971 2455 96321 106032 101176 More Unweighted Means Depende t Variable DEP B Mean Std Error 1 87136 3906 2 111680 4016 3 94901 3067 4 85398 3906 3 A B Dependent Variabl DEP 95 Con dence Interval A B Mean Std 3 Lower Bound Ugger Bound 1 1 7888 7307 64429 93336 2 106929 7307 92475 121382 3 85616 3653 78389 92843 4 82 098 2762 76635 87561 2 1 95390 2762 89927 100853 2 116432 3335 109834 123029 3 104186 4926 94441 113930 4 88698 7307 74244 103152 O O 0 Usage It is the general expectation that when you report Ftests for an unbalanced ANOVA you report the tests based on Type III sums of squares This is SPSS s default behavior u Generally use unweighted when SPSS gives you a choice on contrasts Using anything else is less conservative so you d better have a good reason These come up only rarely However most descriptives are reported using weighted means ie the raw data O 9 Handling Extra Factors Let s say you have a threeway design A B C You have a reliable BxC interaction x You do simple main effects but should you do TEMPORARY SELECT IF B EQ 0 UNIANOVA dep BY c Or TEMPORARY SELECT IF B EQ 0 UNIANOVA dep BY a c 0 What s the difference and why does it matter 1 Especially when unbalanced 0 Don t leave out factors Fixed vs Random Effects Independent variables often have an infinite or very large number of possible levels Delay number of icons dosage etc When you choose the levels of the independent variables used in a study the effects are said to be fixed a This is by far the most common situation When you randomly sample to determine the levels of the independent variable to be used effects are said to be random a lmplies that levels of the independent variable will change from study to study Not especially common 9 O O Random Effects Factorial ANOVA does not work the same way for randomeffects designs It does for oneway ANOVA though Why Because Expected values of the Mean Squares change MSA no longer estimates of effects of A a Thus MSerror is not always the appropriate error term for the Fratio To do random effects ANOVA Need to know what the expected values of the mean squares are a This allows you to choose the proper error term Msimerac on is often the appropriate error term O O O O Drawbacks of Random Effects Interaction terms are generally not great error terms Few degrees of freedom This results in low power There are workarounds which involve assuming no interaction and pooling MSinteraction and MS a Greatlyimproves power A dubious practice accepting null of no interaction Thus random effects designs require Thorough knowledge of MS expected values When to pool error terms Not recommended in general But some situations do call for it error O O O 9 Repeated Measures Rather than assigning subjects to conditions assign all conditions to each subject That means each subject is measured more than once Each measurement must be of the same quantity RT motivation ratings whatever Change in approach Used to assume independence of all observations Thus individual differences go into the error term Now assume observations are correlated Individual differences are now used to reduce the error term Something for Nothing Obvious advantages 9 Q Run fewer subjects High statistical power Not quite a free ride Many research questions do not lend themselves to repeatedmeasures designs Slightly more difficult to analyze Makes more stringent and complex mathematical assumptions Can make data collection more difficult Generally recommended it your research question will allow you to do so O O O Hypothetical Study Familiarity and humor Show cartoons to 1st 2nd 3rd children collect humor 1 6 5 2 433 rating 2 5 5 4 467 Do children find the 3 5 6 3 467 cartoons less funny over time 4 6 5 4 53900 5 7 3 3 433 6 4 2 1 233 7 4 4 1 300 8 5 7 2 467 525 4625 250 4125 O O O O O O 9 Linear Model XijMJTiTjJITij 617 x is the individual observation u is the grand mean m is the effect of being subject i 1 is the effect of being in conditionj m is the interaction e is random error like always normal mean zero Distributional assumptions Subject effects are normal with mean of zero Subject by condition interactions normal mean zero O O O O O Null Hypotheses Again multiple null hypotheses No differences between subjects n1rr2rri0 No differences between conditions it 12 17i0 No interactions 7171711 75121 m 0 We will only be testing one of these 11 12 17i0 Sums of Squares As usual each effect has a sum of squares 2 SSSMbjem K xi x SSwnditions n2 J C2 SSW x0 7c 17 if SSW 220g if SSsubjecls SSCOrzdilians SSSXC SSlalal Each also has a degrees of freedom Subjects n 1 Conditions K 1 Interaction n 1K 1 Total nK 1 And thus a Mean Square Expected Mean Squares Not quite as conventional as for betweensubjects ANOVA 2 022 2 2 L 2 O am 1 11 1 quot 1K 1 T 2 2 2 2 2 EMSsubjects Ge K071 EMScanditians Ge 0m no EUmOG o Technically there is no MSE 239 That is there is no term that estimates just 092 9 So how do we test hypotheses Fratios Two variance estimates will form an Fratio But want one that under the null should be more or less 1 How can we form that for this design 9 O 9 MS conditions 2 2 2 F 08 01 1101 conditions 2 2 MSSXC 08 am Q If null hypothesis of all quotCS 2 0 is true then both the numerator and denominator estimate the same thing Under the null this is distributed as an F with K1 and n 1K 1 degrees of freedom 9 Other Effects EMS 2 2 2 2 2 subj m 08 Kayr 09 0m quot0 conditions EMSSXC of a What about the effect of subjects Can we test it Why or why not Do we care What about the interaction of subjects and conditions Can we test it Why or why not K Do we care 0 Note subjects is a random as opposed to fixed effect Analysis of the Example Here are the data 9 433 467 467 500 433 233 300 467 again 1st 2nd 3rd Marginals of subjects 1 6 5 2 Will define the m s 2 5 5 4 Marginals ot the days 3 5 6 3 Will define the 17 s 4 6 5 4 Multiple ways to 5 7 3 3 compute interaction 88 6 4 2 1 7 4 4 1 8 5 7 2 525 4625 250 4125 Example SS Sum 01 Squares for condition Est rj s are 525 41251125 4265 4125 05 25 4125 1625 811252 052 16252 3325 Sum of squares subjects Est Ici s are 433 4125 02083 467 4125 05417 etc 3O20832 054172 054172 18625 0 Sum of squares for the interaction or error SSSxC 88total 39 SSsubjects 39 SScondition x SStotal 6 41252 2 41252 68625 55ch 68625 3325 18625 1675 AN OVA Table Source g g MS E Subjects SSs n 1 SSsn1 Condition SSc k 1 SSck1 MScMSsxc Interaction SSsxc n1 k1 SSidfi Total SSt nk 1 Source g g MS E Subjects 18625 7 2661 Condition 3325 2 16625 1390 Interaction 1675 14 1196 Total 68625 23 0 What s the critical value for F2 14 What should we conclude Sphericity Repeatedmeasures ANOVA makes somewhat more complex assumptions Variance of each condition is equal This is the same as betweensubjects ANOVA a Covariances between all variables are equal Remember covariance Think of it this way 1 Create difference scores between all pairs of variables Variance of all those difference scores is assumed to be equal Howell notes this is technically compound symmetry but most folks call this sphericity O O O O Violating Sphericity What happens when the sphericity assumption is violated Type I error rate is not preserved Like a t test with unequal variances and unequal n a Not merely a power issue The Ftest for the effect of conditions is not distributed as F with k 1 and n 1k 1 degrees of freedom However it is still distributed as an F Worstcase scenario is F with 1 and k 1 degrees of freedom Very conservative Can we do better O O O 9 Identifying Nonspherical Data There s a measure called epsilon s More than one way to compute epsilon GreenhouseGeisser HuynhFeldt Howell provides equations pp 454 amp 455 When assumptions are perfectly met epsilon either one will be 10 Violations of assumptions reduce epsilon The more severe the violation the smaller epsilon is Minimum bound is 1K 1 What is the minimum when K 2 K 1 is also what Correcting How nonspherical do the data have to be to require a correction Opinions on this subject differ A One way of defining a violation Severe violation GG epsilon lt 065 Mild violation HF epsilon lt 085 o The correction Multiply both df by epsilon Will df get larger or smaller This will yield fractional dfs Compute new critical value or pvalue based on the new degrees of freedom The good news stats packages will do this for you Contrasts Can again have contrasts on the levels of the within subjects variables However contrasts work somewhat differently mathematically in repeatedmeasures designs A contrast can actually be thought of as an entirely new variable Consider d1 d2 and d3 are the dv s s Trends eg linear quadratic on these are reasonable However we can do the contrast on each subject rather than on means of groups of subjects t Then test if the mean of the new contrast variable is zero How do we test if the mean of a variable is zero 0 O O O Example 1st 2nd 3rd Linear Quad 1 6 5 2 4 2 2 5 5 4 1 1 3 5 6 3 2 4 4 6 5 4 2 0 5 7 3 3 4 4 6 4 2 1 3 1 7 4 4 1 3 3 8 5 7 2 3 7 525 4625 250 275 15 mean 104 334 S The Tests 3 zN l i SM sM N 9 Linear 275 7 748 104 E Quadratic 15 7 127 334 E There is also an Ftest version of this with 88 Other Contrast Properties Good power for specific hypotheses Can be used a priori Bonferroni correction may be appropriate Can be used posthoc Use Scheff adjustment 0 No sphericity issues only one variable 0 Easy to construct confidence intervals For Next Time Read chapter 14 Homework 11 posted tonight or tomorrow Due next week Tuesday Advanced Psychological Statistics Psychology 502 Correlation and Regression Sepicmher ILL 2007 Overview Questions Finish up ttest stuff Covariance Correlation Regression O O O O Heteroscedasticity aka unequal varlances OK back to the detection problem Levene Ftest which is provided by SPSS and other packages is weak Very conservative But if it says the variances are unequal then they almost certainly are Howell mentions other procedures Compute absolute deviation scores do f test on those If you reject that null conclude variances are different Compute squared deviation scores do f test on those There are even more complex procedures a Compute O Brien r scores do f test on those O O O Hetereoscedasticity Decision Before running ttest look at standard deviations If you suspect they are different Compute absolute deviation squared deviations or O Brien s r Perform t test on those If you reject the null of this t test then conclude variances are unequal in original populations Go back and conduct original ttest If you earlier concluded variances were unequal then use the unequal variances row in the output a Will have smaller degrees of freedom Heteroscedasticity Example o EXAMINE VARIABLESraven BY smoker PLOT BOXPLOT COMPARE GROUP STATISTICS DESCRIPTIVES Case Processing Summary More SPSS Output Descriptives SMOKE Stat1st1c Std Error ean W 95 Con dence 1nterva1 Lower Bound 2930 for Mean Upper Bound 6642 5 annrned Mean 4706 Med1an 4500 Vanance 10335 Std Dev1at1on 3215 1n1rnurn 1 Max1rnurn 10 ange 9 1nterquart11e Range 6250 Skewness 226 597 Kurtos1s 71502 1154 1 ean 4857 595 95 Con dence 1nterva1 Lower Bound 3402 for Mean Upper Bound 6312 5 annrned Mean 4841 Med1an 5000 Vanance 2476 Std Dev1at1on 1574 Mwnwrnurn 3 Max1rnurn 7 Range 4 1nterquart11e Range 3000 keWness 7037 794 Kurtos1s 71684 1587 More SPSS Output CD as 4 m RAVEN SMOKE Computing New Scores Need to know mean N and variance for each group Need to define some new variables COMPUTE m0 478 COMPUTE n0 l4 COMPUTE varO 1034 COMPUTE ml 486 COMPUTE nl 7 COMPUTE varl 248 Now want to compute absolute difference scores 0 COMPUTE absdif IF smoke EQ 1 EXECUTE ABSm0 raven absdif ABSm1 raven Computing New Scores Squared difference is easy COMPUTE sqrdif absdifabsdif o O Brien s r nj 15njxlj 32 05s nj 1 7 n 1nj 2 0 Computing O Brien s rin SPSS COMPUTE obr nO l5n0sqrdif O5var0n0 1 nO 1 n0 2 IF smoke l obr nl l5nlsqrdif O5varlnl 1 nl 1 n1 2 EXECUTE New Scores Messy but doable Now do ttest on new variables T TEST GROUPSsmoke0 1 VARIABLESabsdif sqrdif obr Complete SPSS code COMPUTE m0 4 78 COMPUTE n0 14 COMPUTE varO 1034 COMPUTE absdif ABSmO raven IF smoke EQ l absdif ABSml raven COMPUTE sqrdif absdifabsdif COMPUTE obr nO l5n0sqrdif 05var0n0 1 n0 1 n0 2 IF smoke l obr nl l5nlsqrdif 05varlnl 1 nl 1 n1 2 EXECUTE T TEST GROUPSsmoke 0 l VARIABLESabs di f sqrdi f obr SPSS Output Group Sratistics Independent Samples Test Std Error Equa vanances not 15982 4592 Equar vanances not 15384 21343 29353 Equar vanances not 16016 24274 27138 O O O O Interpreting the Results Which one to use In reality results will not often differ O Brien s ris probably best You will have to cite O Brien 1981 if you do this Reference is in Howell What s the slightly odd drawback Note that if you do assume unequal variances and correct the df you may have to include a footnote about what you did When you re reading the results of someone else s t test and the variances look very different be aware that they might be violating an assumption O O O O 0 Correlation and Regression What we ve done so far applies when the dependent variable is continuous and the independent variable is categorical more specifically binary Correlation and regression applies to cases where both variables are continuous Still assumes that all observations are independent Meaning what Correlation concerns how closely related the two variables are and the direction of that relationship Involves covariance Regression concerns the form of that relationship The two are themselves closely related O O O Covariance An attempt to measure the extent to which two variables vary together Call the two variables X and Y A X is the independent variable Y is the dependent variable Consider the equation for variance 52 Zoe if Zx 7cx c quot N l N l Here s the formula for covariance Zx 7cy i N 1 0ny Sxy O O O 9 Correlation Coef cient Solves units and scaling Range is 10 to 10 Absolute value measure degree of relationship Zero indicates no relationship v Sign indicates direction r 1lt1 rgt2ltN 1gt 139 N 2 r is a biased estimator of p Strangely the biased value is the one most commonly reported Strong Positive Correlation O O O O 0 Sampling Distribution Imagine populations of related variables Take a sample Compute r Repeat infinitely The sampling distribution of ris normal But you need to know the variances of the related populations to know which normal Fortunately we can estimate normal parameters If we know the sampling distribution is normal and we can estimate its variance what does this mean we can form And what can we do with that O O O O tratio for r Estimated standard error for r 1 r2 amp N 2 Thus we can form a tratio Z w s W Can use that to test hypotheses because we know sampling distribution of t What other piece of info do we need to do the test What hypothesis does this test Why Note that the test for r c where c i 0 requires correction because sampling distribution is not quite normal Confidence intervals are a little wonky because of this O O O 9 Example An instructor gives a quiz and then an exam and wants to know how well performance on the quiz predicts performance on the exam Quiz Mean 49 s 304 Exam Mean 484 s 1916 60 students in the class who took both quiz and exam What else do we need to compute correlation The covariance VVhy Covariance 4660 O 9 Example Compute the correlation coefficient COVW 4660 7 s sy 3041916 x Pretty high but is it reliable a How do we test that Form a t ratio Compare to critical value for t For how many degrees of freedom a What s the 001 twotailed critical value for 1158 r rxlN Z 080s58 6093 t58 1016 Sr 1r2 41 064 060 Correlation in SPSS Coding in SPSS CORRELATIONS VARIABLESsatV satm gpa PRINTTWOTAIL NOSIG 0 Example output WWW Sig Ztailed Sig Ztailed Sig Ztailed o recommend that you never do just this Regression Basic correlation assumes that the relationship between the two variables is linear 0 Not like this What Line to Use What Line to Use 72mm yey Reswdua s dwfferenoe between y Va ue of pomt on the hne and the amua data pomt The standard hne 5 generated sudw that ms quarmty s mmvmzed gt207 CaHed the sum of squares for reswdua s The eduauon has theform The Line b 2 a bx SX COVX cov quot y X yi y 2 30 2 xi 6 X Turns out that the sampling distributions of both a and b are normal And we know how to estimate standard error 9 Can therefore test hypotheses and form confidence intervals for a and b tratio for b sX1 s l r2 N1 y N 2 y N 2 S s 2 b sXJN l t bstN l sh SW 0 For simple regression this tratio will equal the one for r O O O RSquared Total variability in dependent variable y 2 SSy 2o y Rsquared is proportion of variance explained by the regression r2 2 SS SSresidual SSy It all points are perfectly on the regression line then every residual will be zero and rsquared will be 10 2 COV r2 2 xy sC sy O O O O 0 Back to our Example Want to compute the regression line First compute slope bi b covxy 4660 s2 3042 x 504 Then compute the intercept a a y b 484 50449 2370 80 final regression equation is exam score 2370 504quiz score We could do a t test for b 0 What would the result be Why Regression Miscellany If both X and Y are standardized certain properties emerge a O b r b is then denoted as 5 Not the same as Type II error rate Called standardized regression coefficient Note that statistical tests of whether two fs are equal or two US are equal are possible see your text 9 Assumptions Homogeneity of variance Normal distribution of residuals Exam sco re Rule 1 Plot the Data Notice intercept and slope See any assumption issues here i 1 2 3 4 5 6 7 B 9 1 0 Quiz score Regression in SPSS REGRESSION DEPENDENT exam METHOD ENTER quiz Variables Entered lRernovecF M odd 5 Variables Variables mmaly Enter ad Rem ave d Method Adiusted 5 Std Error or Snare n Model is RSuare t eEstimate a All reooe sted variables entered b DependentVariable EXAM a Predictors Constant QUIZ ANuAquot Sum of I I I Model dr Mean Square r Sig 1 Regression 13549540 1 13549540 102573 0003 Residual 7505 560 55 1346 30 Total 215 55400 59 a 39 QUIZ b DependentVariable EXAM Coef cientsa Unstandardized Standardized Coef cients Coerrio39ents Model 5 I Std Error Beta t Sig 1 Constant 23705 2555 5294 000 QUIZ 5039 497 500 10143 000 a Dependent Variable EXAM Following Rule 1 Graphing in SPSS GRAPH SCATTERPLOTBIVARquiz WITH exam 4 Once the graph comes up you may want to tweak it to get the regression line drawn Click on the little compass icon chart options In the dialog box click Total under Fit Linequot What to look for Nonlinearity Heteroscedasticity Grouping SPSS Output EXAM N o QUIZ Even Better Graphing HNWQm megmmH memwdmabagmmsmn But to lookfor problems better to plot the residuals What s a residual REGRESSION DEPENDENT exam METHODENTER quiz SCATTERPLOTZRESID ZPRED SCATTERPLOTZRESID quiz First Scatterplot Scatterplot Dependent Variable EXAM 3 E 2 3 I E a B 0 l I E I 5 I I l l E I g 1 C n N I u 2 72 9 V g 73 9 a 74 720 715 71 0 7 5 00 5 10 15 20 Regression Standardized Predicted Value Second Scatterplot Scatterplot Dependent Variable EXAM 3 E 2 x E a m l xv I I E l 5 0 I I I 5 I I a a I u 71 393 m u 72 g 73 3 x74 7 0 2 4 6 8 10 12 QUIZ Simpson s Paradox For Next Time Homework 5 due next Monday Homework 6 due next week Friday Read Howell chapter 8 for Tuesday Advanced Psychological Statistics Psychology 502 ANOVA 2 l quott iul nxt quot Liill 39 Overview Questions Power software Heteroscedasticity Relationship between F and t Transformations Start on contrasts O 0 Power Software Remember our results from last time Effect size of 063 N 30 n 10 per group A Computed power to be 084 To have 09 power in replication n 12 N 36 Go to httpwwwpsychouniduesseldorfdeabteilungenaap gpower3downloadandregister Link is also on the Notes Web page For these machines download the Mac PPC version There is a Windows version and a Mac Intel version as well A Note that this software is free O O O O GPower Under Test Family select F tests For Statistical test make sure it says ANOVA Fixed effects omnibus oneway First compute power for our effect size and N For Type of power analysis select Post hoc For Effect size f enter 063 For Total sample size enter 30 t For Number of groups enter 3 Click Calculate in the lower right Note critical F of 3354 2 and 27 degrees of freedom And power is what O O O O GPower Now compute the N needed for a power of 09 For Type of power analysis select A priori For Power enter 90 Click Calculate Note df of 3 and 33 Total sample size this is N is 36 That s 12 per group O O O O O Heteroscedasticity for ANOVA ANOVA obviously relies on the assumption that variances are equal in all groups With few groups and equal n s failure to meet this assumption simply costs power However with unequal n s this can inflate the Type I error rate The more groups there are the worse this is If n s are equal then you can afford to be a little more liberal Rough guideline is 4 to1 ratio for highest to lowest cell variance If not consider something more like 3to1 or 2 to1 Detecting Heteroscedasticity It you are worried about it you should test for it Ftests for equality of variances aren t very good SPSS ONEWAY does provide one though The recommendation Compute O Brien s r scores for your data set Do an ANOVA on those If this test recommends rejecting the null conclude you have unequal variances What can you do about it Correctin foq Heterosce ast1c1ty The ultraconservative approach Use a different critical value for F you ll need the table F1 n1 If n s aren t equal use arithmetic mean and round down The Welch procedure Compute a new F statistic Fquot n I Wk 2 ZwkXkX2 St k 1 Fl 206 2 1 Wk 2 Zkak 1 k21 zwk Welch Procedure continued Also compute a degrees of freedom adjustment for degrees of freedom within df df k21 2 32nk1 11 vk Compare Fquot with critical value based on Fk 1 df Accept or reject based on that Why 1 Better power than the more conservative approach NOT done by most stat packages O O O O Fvst Consider independent samples 2 groups Null hypothesis for ttest H1 H2 Null hypothesis for Ftest ANOVA T1 132 0 H1 H2 They are equivalent hypotheses Are the tests equivalent Yes if the t test is twotailed There is no directional hypothesis in ANOVA ttest Output Here s the output from a ttest Group Statistics GENDER Std Error Mean HElGHT 0 7 54000 3512 1327 1 58071 3452 923 Independent Samples Test Std Error 77596 Equal Variances not 1617 ANOVA Output Here s the corresponding ANOVA output ANOVA HEIGHT I I Sum of Squar I df I Mean Square i Sii I Between Groups 77357 77357 w Within Groups I 228929 12049 Total 306286 0 Same dt for error as ttest dt Same p value What s the relationship between the Fvalue and tratio 0 Also look at MSE O O O O F and t equivalence An ANOVA with two groups is equivalent to a twotailed ttest 20q 1 3OQ 1 665D2L 342 Sp 212034 19 Does that number look familiar Hint consult previous slide There s a little rounding error Pooled variance estimate and MSE all are equivalent estimate of population variance Often called the error term O O O O 0 Data Transformations Howell spends a great deal of time discussing transformations on data Log Square root etc Why do this a Heterogeneous variances a Outliers Howell provides some justification Some people strongly object VVhy What do you think Is transforming OK O O O O 9 Multiple Comparisons Recall our example ANOVA experiment Research question Does the synchrony of the audio and visual signals affect how we perceive speech Experiment with three conditions Show a video tape with someone speaking Speech a little after visual slow a Speech in sync with visual normal w Speech a little before visual fast Measure retention of words that were heard ANOVA null hypothesis T1 12 13 O We rejected this null O O The Problem What are the true empirical questions the researcher is after Are the fast and slow conditions different than the normal condition If so are the fast and slow conditions different from each other Does the ANOVA null hypothesis represent any of these The ANOVA null hypothesis often called the omnibus hypothesis is incredibly general Cannot ask specific questions O 9 9 Solutions What some people will do is run an ANOVA and then eyeball the means Technically this is not kosher A But you will see this done even by people who should know better ttests a Can do a t test between fast and slow but this is less than optimal Why Can we do a t test on the more central hypothesis which is control vs treatments Need something better O O O 9 Linear Combinations You want to test some fairly specific null hypothesis you d like to test H2iu4 s Ziu1J3 3 2 Do some algebra 2 2n4 zus 3n1 3n3 341 2H2 3H3 24 25 0 We shorthand the contrast as 3 2 3 2 2 The value of the contrast termed L is the sample means times the vector coefficients La1x1a2x2 akxk zzajxj Contrasts 0r Planned Comparlsons We want a technique that will allow us to generate specific null hypotheses but will not throw out data A contrast does this 0 What is a contrast A number formed by multiplying the sample means by a set of weights Set of weights a1 a2 ak Weights must sum to zero Set of weights is a vector Contrast has a value Lalxlazx2 akxk Zajxj Contrasts How does this solve anything Cells with like numbers are compared For example the contrast 1 1 1 3 compares the mean of the fourth group with the means of the first three Cells with a weight of zero are excluded Contrast practice Assume 5 cells What do each of these contrasts represent 41 1 1 1 2 2 2 3 3 1 What is the appropriate contrast for these comparisons Cells 1 and 2 vs cells 4 and 5 Cells 1 3 and 5 vs cells 2 and 4 Cell 3 vs cells 4 and 5 Sampling Distribution o The sampling distribution of L is known And it s surprise normal given assumptions met And we know the variance 2 a a 2a varc 027 1 Which term there is error variance What s our best estimate of error variance Inferences with Contrasts If we have a statistic and an estimate of the standard error for that statistic what can we form L L We L MSEE j n J What hypothesis does this allow us to test What else does this allow us to do Hint Kira20M For Next Time o Read Howell 121 126 Homework 8 due on Monday Advanced Psychological Statistics Psychology 502 Descriptive Statistics 3Lll fli7iquot1i 3 Overview Questions on the text Notation Other Means Why the arithmetic mean Dispersion Degrees of freedom Zscores Rules 1 and 2 Introduction to SPSS O O O O O O O O O From the Reading What kind of scale nominal ordinal interval ratio are each of the following Malefemale a Response time Low medium high Temperature SAT score Earned Run Average ERA lntroversionextroversion Besttoworst rank ordering Number of errors Answers to what s your sign 5 w a Any Questions on the Reading More From the Reading What s the difference between a statistic and a parameter What are dependent and independent variables If a distribution is positively skewed which is higher the mean or the median a If you have a ceiling effect what kind of skew will that generate Properties of estimators Efficiency Sufficiency Bias a Resistance or robustness O O O O Notation n m n 2392 ZEXUgtZXU l j1 i1 Population Statistic Mean y X or M X Variance 02 5 2 Standard deviation 0 S 0 Capital N is sample size Sampling We get from a population to a sample by of course sampling What kind of sampling is assumed in inferential statistics What defines this kind of sampling How practical is this kind of sampling in psychology Something to keep in the back of your mind 9 O O O O Other Means Harmonic Mean Less sensitive to extreme values than arithmetic mean N x Geometric Mean Log of geometric mean is the average of log of the X values I Z quotXG XIXZ quot xn J Why Use the Arithmetic Mean Lots of reasons mentioned Mean is unbiased sufficient and relatively efficient Center of mass analogy others Signed deviation di Xi 9 6 Difference between observation and mean Mean signed deviation is zero The real reason mathematical convenience Algebra with means is direct Arithmetic mean is the expectation value for probability distributions more on this later The clincher the statistical properties of the arithmetic mean are wellunderstood In particular it has a wellbehaved sampling distribution 9 O O What s Wrong with the Mean Despite all the positives there are drawbacks The arithmetic mean is sensitive to extreme values It is not particularly robust A Harmonic and geometric means are also sufficient estimators and more robust But slightly less efficient There are many lay misunderstandings about means Average man phenomenon This problem often affects other measures of central tendency as well 9 O O O Dispersion Average deviation from the mean is not a useful measure of dispersion Why not Conceptually straightforward Seems downright obvious in fact i The real problem Mathematically inconvenient The solution Instead of using absolute values of deviations K Use the square Average absolute deviation xi x N Variance Why two forms 8 big 8 seems more natural But 8 is a biased estimator What s bias again s little s is not s little 3 is usually what s actually used and reported Standard Deviation Standard deviation is the square root of the variance There is a biased and an unbiased version Why use standard deviation Variances are in square units eg ms Hard to interpret squared units 9 Also used in computation of the coefficient of variation CV CV std dev mean Why In practice variance and therefore stdev often correlated with the mean CV provides a uniform scale Statistical Arithmetic Let s say you have some random variable x You add 15 to that variable Does the shape of the distribution change at all What s the new mean What s the new median What s the new variance What s the new standard deviation You multiply that variable by 2 Samefive questions O O O O Combining Statistics Let s say you have two measurements on each subject SATQuantitative SATVerbal You create a combined score by adding them What s the new mean What s the new median Mode What s the new standard deviation You create a difference score by subtracting them What s the new mean Median Mode What s the new standard deviation Something to think about for later O O O 9 Degrees of Freedom df Suppose N 4 in some sample Your task Guess tour deviations from the mean Guess d1 Guess d2 Guess d3 What is d4 d4Od1d2d3 Why Thus there are N1 degrees of freedom in estimating the variance df is an important concept in statistics and we ll see it a lot O O O O O ZScores Also called standardized scores You re told Greg Maddux has an ERA of 321 and you know nothing about baseball Is that good bad or what It depends on how everyone else did What s the average ERA What s the dispersion How can you compare from one year to another A solution zscore O O O O ZScores Take a sample and transform it into zscores What s the mean of the new set of scores What s the standard deviation Zscore transformation does not change the underlying distribution just the scale However this does allow for certain useful operations Comparison of relative position in different samples Combination of scores on different scales Anything else There are other standardizations Tscore mean of 50 stdev of 10 SATstyle mean of 500 stdev of 100 Rule 1 0 Why are there so many histograms in the text So why don t you see them in journal articles Rule 1 ALWAYS plot your data Histogram or stemandIeaf Box plot o Why Find miscoded or other oddball observations Get an idea for the shape of the distribution Visualization supports different kinds of inferences than seeing just numbers For example skew The skew statistic isn t meaningful for most people but skew is often immediately apparent visually Histograms 2100 m10 n020 2030 p040 4050 5060 6070 7080 8090 90100 BOX Plots Varf Var2 O O O O 0 Rule 2 Despite the fact that we re going to spent nearly all of the semester on inferential statistics Descriptives are still more important It is pointless to say something like the difference in means is statistically significant if you haven t communicated what the difference in means actually is Inferential statistics support drawing conclusions from descriptives but they should not replace descriptives When presenting results always present the relevant descriptive statistics first A Provides necessary context for inferentials O O O O For Next Time Next week we ll do probability theory Loads of fun but some people find it impenetrable Read Howell chapter 5 We ll get back to chapters 3 and 4 later Homework 1 is due Tuesday Just FYI There will possibly be homework both Tuesday and Thursday next week O O O 0 Introduction to SPSS First I highly recommend that you always maintain at least one copy of any data you have as tabdelimited text ASCII Data sets for homework and exams will be distributed this way A warning When we do stuff on the computer I tend to go fast STOP ME if you get lost Everybody launch SPSS Go to ApplicationsOwlnetAppicationsSPSS Also launch a Web browser probably Safari Advanced Psychological Statistics Psychology 502 Miscellany lik lul w 39 llil Overview Questions Finish off stuff on power Reporting statistics 0 Outliers Graphing o The Midterm Withinsubjects Designs 0 Pros Efficient More data per subject High power Cons Not all studies are workable withinsubjects Can make experimental sessions long Other pros and cons Consequences of Poor Power Never good to be in a situation where you re unlikely to succeed even when you re right Wasting time energy money etc Really can t say anything useful about null Many times you can t help but have low power 3 Should at least be aware of the situation Consequences of High Power In principle none In practice Technically null hypothesis is always false Can draw criticism for finding easy results Reporting Statistics When you write up analysis of data there are conventions to follow on how you report inferential statistics defined by APA Generally you include Degrees of freedom and test statistic to two decimal places Label for test statistic in italics pvalue to two decimal places No leading zero p in italics Sometimes three decimal places 7 Right around 05 and 01 Very small pvalues are lt 001 Some tests ask for additional information after that Reporting Statistics Correct usage Z 341 plt 001 1115 201 p 048 R2 31 168 p 54 MSE 131 Incorrect what s wrong with each t18 431562 p 0000 r172 008 p gt 005 t Z 433 p 0002 Q Do this from now on for homework and exams That is in the writeup part You will lose points if you don t do this right Outliers o What is an outlier An exceptional point Definitions of exceptional vary 1 3 standard deviations from the mean is common 0 Why are outliers a problem Measurement May be measuring something different than what was intended Measuring a missed mark in a questionnaire Measuring RT including a sneeze 1 Statistical The mean and variance are highly sensitive to the presence of outliers Anybody remember Rule 1 Outlier Example Data from a fictional experiment with reaction time measure 2 groups Group Statistics GROUP Std Error Mean RT 0 HZ 2000 62 093 H4 504 i 30 9092667 i7i2308 3i2623 Independent Sample Test L n sTestfor Equaiit ofVariances HestforEquaiit of Me ns F 51g 1 df 51g2rta11ed Mean Difference 6 2397 127 1946 59 070 2199333 Eqw W mes quot0 1946 33267 074 2199333 assumed Plot Your Data r m u 993 400039 300039 200039 034 100039 32 E o N 30 30 0 1 GROUP Removing the Outlier Use SPSS s features to select part of the data It you use the SELECT command that selects a subset otmedmamrmHMUmcommamb You can also tell SPSS to select a subset just for the nextconunanderso TEMPORARY SELECT IF rt lt 3000 EXAMINE VARIABLESrt BY group PLOT BOXPLOT COMPARE GROUP STATISTICS DESCRIPTIVES Without the Outlier 39I 60quot 140039 120039 1000 800 39 600 39 RT 4 00 N 29 30 GROUP Rerun the ttest TEMPORARY SELECT IF rt lt 3000 TTEST VARIABLES rt GROUPS group0l Group Statistics GROUP Std Error Mean 39 I 39 I H 39 1 30 9092557 1712308 312523 Independent Samples Test Std Error 2169 52696 1120782 516328 Issues Howtode neanoumer What s the problem with 3 sd s from the mean 9 Alternatives A Use a different measure of dispersion Use interquartile range IQR Use mean absolute deviation Use a trimmed standard deviation Instead of filtering for outliers perform some kind of transformation on your data Log transform 1xtransform etc More on this when we get to ANOVA Must be able to defend your choice Both outlier removal and data transforms are controversial O O O O The Interquartile Range IQR Compute the cutoffs for the first quartile Q1 and the third quartile OS of the data To do this you can perform three median splits A Of and OS are often called the hinges IQR Q3 Q1 Why is the IQR possibly a better measure of dispersion Some people define any points greater than 15 lQRs outside the hinges as outliers A more conservative definition is 3 lQRs outside of the hinges x I would recommend the more conservative definition Bonus SPSS box plots print a dot for 15 IQR outliers and asterisks for 3 IQR outliers O O O O Trimmed Standard Deviation The problem with the mean and sd is sensitivity to extreme values 80 discard all of upper and lower tails of the distribution which is called trimming The trimmed standard deviation Trim 5 of the distribution 25 from top 25 from bottom Compute standard deviation based on this Remove all points from the original complete data set more than 35 trimmed sd s from the original mean SPSS reports 5 trimmed mean with EXAMINE but not trimmed sd So you have to do this kind of manually Handling Outliers o What to do with an outlier Remove This is common for betweensubjects designs Less so for withinsubjects designs why Replace What would you replace the outlier with and why I ll let you think about that more as we proceed Back to Rule 1 We re now in the situation where we re comparing multiple groups How to graph multiple groups Score 56 52 48 44 Which Effect Appears Larger Score Animation No Animation Animation No Animation Condition Condition O O 9 Problems with Simple Graphs Easy to inflate apparent differences with axis tricks and other clever visual nonsense Visual size of difference isn t necessarily related to true Can also obscure or just make more difficult the perceiving of differences For example 3D graphs statistical difference Doesn t reflect N or standard deviation at all O O O 9 Axis Breaks Less potentially deceptive Still a little odd Not supported by all graphing packages can be ugly Doesn t solve issues with N and standard deviation Score Animation No Animation Condition O O O 9 Error Bars Can provide information about sample size and standard deviation But what do the error bars represent Not standardized t Standard error of the mean Confidence interval Even those can be unclear VVhy Score 0 I I Animation No Animation Condition Score SEM vs 95 Con dence Interval iiii Animation No Animation Condition Score Animatio I n No Animation Condition Score SEM vs Pooled Standard Error of Difference iiii Animation No Animation Condition Score Animation No Animation Condition Score Axis Tricks with Error Bars Score ml I Animation No Animation Animation No Animation Condition Condition O O O 9 Publication Quality Graphs You ll see this term from time to time What does it mean A graph that would be acceptable for publication in an APA journal Properties incomplete No color grayscale Reasonable English axis labels a Reasonable axis starts and stops Good tick marks and legends a Clear symbols on line graphs No titles or extraneous text on the graph that s for the caption No tiny graphs Minimum 4 x 4 x Not Publication Quality Mean HEIGHT CO N DTN Also Not Publication Quality EXAM N o O QUIZ O O O O 0 Graphs You have to learn how to produce acceptablelooking graphs sooner or later Might as well be now Options Learn how to get Excel to produce decent graphs Acquire and learn a decent graphing package eg DeltaGraph Igor etc Learn to beat SPSS graphs into shape Slow and tedious but sometimes possible Will start to sometimes require these on HW and exams One last thing bar graphs vs line graphs Use line graphs only when xaxis is an interval or ratio scale O O O O Midterm Due two weeks from today 100 pm v No electronic handin all paper will be thick You do not need to type hand computations but you do need to include them Must follow formatting requirements These are requirements not suggestions Please read it ASAP There is a forum on Blackboard to post questions Don t freak out Ask questions l want to help a However I won t be very sympathetic to a sudden flurry of questions in the last two days You get two weeks for a reason O O For Next Time No new reading or homework Work on the midterm Do not wait until the last minute No office hours tomorrow or next Monday Need to ask questions electronically Next class will be October 18th That s next week Thursday QampA on midterm Issues in hypothesis testing Advanced Psychological Statistics I Psychology 502 Power 1 Overview Questions on reading or homework A simple hypothesis test Power factors Examples using the normal Effect size Noncentrality Examples using the t Assumptions 9 O O O 6 O O 0 Power What is the definition of power Can we in principle know the power of a statistical test in advance lt How about in practice The initial plan Look at an example situation Make a key assumption Compute power Change some factors see how they affect power If you get lost STOP ME Make me reexplain or draw more pictures O O O 9 Simple Hypothesis Test Substantive hypothesis People who take SAT preparation courses do better than average Empirical hypothesis A random sample of people drawn from the class rosters from local Kaplan and Princeton Review courses is taken and their scores computed Statistical hypothesis H0 u s 500 H1 ugt 500 Other details 0c001 N25 And remember 0 is known to be 100 6 O O 0 When to Reject Critical value of z is what 233 Thus we will reject the null when we get what When we get a sample mean that corresponds to a zof 233 or greater E u z o MGM Which do we use and why 5M 100 sqrt25 20 Thus we will reject the null if we get a sample mean of 5466 or higher 25mm 0 zMGM 500 23320 5466 Q If the Null Is True If we obtain a sample mean of 5466 or greater we will reject Ho lt If H0 is actually true what happens if we obtain a sample mean of greater than 5466 gt Reject Null E E 500 Don t Reject j O 0 If the Null Is False u gt 500 but it must be some other number Let s say u 550 Question What is the probability that we will fail to reject the null This would be a Type II error Sampling distribution is still normal but now has mean of 550 same GM of 20 What s the probability of obtaining a value of 5466 or less in this situation O O 0 O 6 If the Null Is False What s the probability of obtaining a value of 5466 or less in this situation To answer this find the the zscore that 5466 corresponds to under H1 not under the null 5466 550 Z 017 20 xcritical ul 0M What s the probability of a zscore of less than 017 It s 043 Thus the probability of a Type II error 3 is 043 What s our power Pow er am Samphng dwstnbuuon underH F550 4 ontRejen O RejeaNuH a 50 3 Power m r 5 m ms Case 0 57 The pvobauhtythat We w coneclwvejectthe nuu Putting It Together Samphng dxstnbuuon under HE Samphng dwstnbuuon under H m 550 6 O O O 0 Factors In uencing Power Alpha level Decreasing alpha level less power Location of H1 Larger difference between H0 and H1 yields more power Larger effect size more power Standard deviation of sampling distribution Function of 5 and N Larger 5 less power Larger N more power Which of these things can you control You can guesstimate the rest O O O O 0 Changing Alpha Let s say we want to be really conservative or 0002 What happens to critical value 206 288 New critical value will reject if sample mean is 5576 or larger What s the power now LLl 5576 550 20 x critical z 038 M 0M What s pzgt 038 Power drops to 035 drops by almost 02 Changing Alpha Sampling p or distribution under HO 7396 39 gt Don t Reject Reject Null l l p B j p 1 B Sampling distribution l under H1 H1 550 550 39 Don t Reject Reject Null A Change in H1 Back to or 001 What it the true mean is 570 Still reject it we find a sample mean of 5466 or greater 0 What s the power now t1 2M2417 x critical Z M 0M 20 What s pzgt 117 Power increases to 088 6 O O O O 6 Changing N Back to original 0 of 001 and H1 of u 550 What if we decrease N to 16 Changes critical value 100 7 25 7 M W 4 576mm 2 zaO39M u0 23325 500 55825 What s the power now p1 55825 550 25 ZM xcritical c7M What s pzgt 033 Power drops to 037 O O O O O 0 Back In the Real World We don t know 0 We don t know H1 Would also like unitless measure Effect size Ratio of difference in means to standard deviation d 2 W1 HO 0 How do you know effect size Based on prior research v Minimum useful difference Guesstimate Cohen 1988 is the bible for this stuff 6 O O 6 Effect Size Standards Cohen 1988 Real distributions overlap Small effect d 020 Approximately the size of the difference in mean height between 15 and 16year old girls Medium effect d 050 Magnitude of the difference in mean height between 14 and 18year old girls Large effect a d 080 a Mean estimated IQ difference between PhD holders and average college freshlings O 9 Primary Uses of Power Selecting N You the researcher get to choose N If you have an idea about effect size you can control the probability you get a reliable result Statements about null Suppose you run an experiment study and cannot reject Or you see published results that fail to reject Can compute the actual effect size found Can then compute power According to many statements implying acceptance of the null are meaningless without power computations a a One Other Problem 0 So far all of our examples have used the normal When can we directly use the normal for hypothesis tests When do we have to use the finstead Unfortunately not as simple in the tcase Practically we d need a much more complete table Mathematically it turns out the distribution of the f statistic unlike the mean is not the same shape when H0 is false 0 Uses another known distribution called the noncentrat N oncentrality Howell calls the noncentrality parameterquot 8 5 is a function of effect size and N 5 dfN fN is different for different statistical tests For onesample t tests O O O fN m For equal N independent samples fNn1 For unequal N independent samples 6 O NH fN 7 Using 5 o Harmonic mean Remember 8 dfN 8 can be found in the table in your text p 678 If you know the power you want Forthat level of power look up 5 Usually use that to solve for N Or if you want to find power can compute 8 Find that 5 in the table That will tell you the power Power Example Back to the animation experiment Noanimation M 47 s 153 N 22 Animation M 55 s 149 N 30 o The question Assuming a twotailed test what was the power to detect an effect of that size What do we need Effect size d Difference in means Estimated standard deviation Harmonic mean of N s or level assume 005 Computing Effect Size gzd E dzJz Hizf2 J 2 0 s p S2 N11812N2 1S p N1N2 2 21 1532 29 1492 s 2227 50 d2x2 31255 472053 sp 227 This is roughly a mediumsized effect Computing 5 and Power 52d1 2 2 2N1N2 22230 i LN1N2 2230 5 0531 i238 189 2538 1 N2 What was the power 9 Approximately 048 Furthering the Example Assume we want to replicate the experiment but this time We want equal sample sizes We want power of08 One tailed test Retain or of 005 How many subjects do we need in each condition x Everybody write down your guess With power of 08 for a onetailed test what s our 6 Which column should you use How Many Subjects azd 2 2 2 nzz j 24 24450 1 053 0 Can we actually have 445 subjects in each group Of course not x Need 45 subjects per group or 90 total O O O O O Assumptions Howell s table assumes Normal sampling distributions which two Homogeneous variances lt It s also approximate What happens when assumptions are violated Remember the ttest is relatively robust to violation of assumptions with respect to Type I errors Relatively nonnormal sampling distributions do not cause an increase in Type errors a Exception Heterogeneous variance with unequal N s What about Type II errorspower w Table will overestimate for invalid assumptions See Cohen J 1988 for the best treatment of this O O O 6 Quick Review Power is a function of what Which of those do you control When do you compute power based on the normal and when do you use the noncentral 2 Can you use d when computing power with the normal If not why not If so how If I gave you or d and the desired power level could you solve for o Another Power Example The diet center problem A diet center claims to have a great new weight loss program that really works Here39s there evidence ten people came in and had their weight measured before and after being on the diet program for one week For each person a change in weight was computed The average change was a loss of 311 pounds but we magically know 5 to be 562 or is 005 twotailed Same kinds of questions What s the null and how would we test it What was effect size What was the power How many subjects in replication to have power of 090 Now what it s not 0 is 562 For Next Time Reread chapter 8 Or read it a first time it you haven t read it Homework 6 due Friday Advanced Psychological Statistics Psychology 502 Sampling Distributions and Hypothesis Testing Scptcsnlwr L 201le Overview Questions What is a sampling distribution Using the CLT Testing statistical hypotheses Example test Confidence intervals Type II errors Start the tratio O O O O O O O Sampling Distributions There is some population b Take sampies of size N Maud M x Central Limit Theorem Population with mean it and variance 0392 The sampling distribution of the mean approaches a normal Ways Regardiess of distribution in the popuiation Furthermo e The mean of the sampiing distribution is H The variance is TEN When N is large the sampling distribution is extremely close to a perfect normal O O O O 0 Using the Sampling Distribution of the Mean If we know the population parameters we can make probabilistic statements about sample means For example given H5oo 5100 N 25 What s the probability we draw a sample with a mean of 560 or greater How do we use the sampling distribution to do this 560 500 20 What s the probability of a 201 3 or more ZM ZM O 9 Sampling Distribution of a Difference Let s say we re sampling from two populations which we ll call population 1 and population 2 Sample from both populations size N1 and N2 Compute two means M1 and M2 Subtract them How might this ever come up What s the sampling distribution look like for this difference score Turns out it s also normal yay Mean of in pg 1 Standard error 2 a onW 071 N1 N2 Hypotheses Let s talk in general about statistical hypotheses o Null Nondirectional H0 u 100 Directional H0 us 100 or H0 u 100 Alternative Nondirectional H141 100 Directional H1 ugt 100 or H1 ult 100 Decision Rule What do our hypotheses generally concern Means When do we conclude the null hypothesis is false If under some assumptions the probability of the null being true is small What s our threshold for small called What do we need to do to in order to enable that Must have the ability to make probabilistic statements about the null hypothesis And what allows us to make such statements about means 1 Knowledge of the sampling distribution 9 O O O O 9 Basis for Decision If the null hypothesis is true certain other things follow Such as Parameters for the sampling distribution of the mean That enables what Probabilistic statements about means How Sampling distribution is normal with known parameters We know a lot about normal distributions O O O 9 Normal Distributions The standard normal N01 is a special case of a normal distribution All other normals have the same fundamental probability distribution but Different location mean Different dispersion variance or std dev Any probabilistic statement made about the standard normal can be generalized to other normal distributions How Thus based on the standard normal we can make probabilistic statements about means based on the sampling distribution of the mean O O O O Hypothesis Testing Example Form some statistical hypothesis Such as u 0 Two ways to go Compute region of rejection and compare sample statistic to that Compute probability of sample statistic and compare that to alpha These are equivalent Then we either reject the null or we don t Let s walk through an example using both methods O O O 9 Problem Statement everything ctional A headphone manufacturer call them Y claims that their new headphones are better than company H s competing headphones And thus more expensive Standard headphone rating system on a scale from 1 to 20 has a known standard deviation of 52 Collect two samples askthem to rate the headphones A Headphone Y N 25 M 170 v Headphone H N 15 M 143 Company Y advertises that they re better because the average score is 19 higher basically true 1888 But is the claim of better credible Why might it not be O O O 0 Method A Compute Region of Rejection Pick an alpha level Onetailed or twotailed What does that mean and why do we care What s the null hypothesis Score mean of Y mean of H u s 0 What s the appropriate ztor our alpha level What do we do with that z Convert it to a score on the relevant distribution a What s the relevant distribution Sampling distribution for the difference in means Why O O O 9 Sampling Distribution That sampling distribution is normal Mean of zero why Standard deviation 6 ofo d M N1 N2 Our critical value for 2 was 165 Need to map this onto our sampling distribution 522 2 5392 21698 5 25 X M ZM Tc zMaMdl u 16516980 2802 GMdi Actual difference in means is 27 What do we conclude O O O O 9 Computing a Probability Obtained difference in means is 27 Need to compute the corresponding z score VVhy What do we use to do that Sampling distribution of the difference f u 27 0 1698 szW 2159 0mm What s the probability of a z score of 159 or greater Is that more or less than alpha So what do we conclude O O O O Inferences in the Other Direction Often we don t know u But we usually have a sample mean Given an N and a sample mean what can we say about the population mean For now assume 5 is known Given N9 510 Sample mean 45 What can we say about the population mean Inferences in the Other Direction Consider this situation The true population mean is 45 The or level is 005 What would the region of rejection be Need to know 2 for 022 or 0025 Would reject the null if we got a sample mean greater than that value of z or less than the negative of that value of z Need to convert that z to a sample mean 5u 0M x i Za20M ZM O 9 Probability of the Sample Mean Sampling distribution of the mean is normal Thus sample mean will be between zOL2 and 20 2 95 of the time x 2 H Za20M x nu Za20M 0c2 Con dence Interval pm ll203w S x S MZWGMgt 106 pza2039M S H x S zazo39M 106 pxZa20M S XZa20M1a Thus if we have a sample mean we can make a probabilistic statement about the location of the population mean Con dence Intervals If you want to be 95 sure that the population mean is within a range set that range to be the sample mean i 196 standard errors This is called the 95 confidence intervalquot From our example 0 10 N 9 sample mean 45 5M 103 3333 202 196 A 95 confidence interval is 45 1 96333 v 3847 to 5153 9 Question What three things determine the width of the confidence interval Con dence Intervals 0 Three determiners of confidence interval width Alpha level a N Standard deviation in the population Assumptions Population variance is known When N is very large can use the sample variance as estimate There is also a way to estimate this when the population variance is not known and N is not large Sampling distribution is normal This will always be true when the population distribution is normal or N is large enough Hypothesis Testing When the Nu I Is True u 100 Possible test outcomes Reject the null Fail to reject Rejecting the null happens when Failing to reject happens when Can we reject the null when it is actually true How often should this happen This is called a Type I error 0 pType I error 9 O O O O O O Hypothesis Testing When the Nu I Is False Mi 100 Possible outcomes Reject the null i Fail to reject 0 Can we fail to reject the null when the null is actually false This is called a Type II error pType error 5 States of the World Truth HO true H1 true Type I error Hit P0W9r E Reject null a 1 B 2 8 Corr F2R Type II error 0 Fall to reject 1 a 0 Type I error is like a false alarm 9 Type II error is like a miss Want your rate for both of these to be low Type II Errors How often will Type II errors happen Of course it depends On what Alpha Parameters of true sampling distribution True mean Sample size The Situation Sampling distribution under HO X 10 Sampling distribution under some H1 3 7 1 8 Etfect of Alpha H Deaeasrng a pha xtle Tm maeases Br Thus there rs atradeoff between X and GeneraHy Type r errors are consrdered Worse A Way oontro zx Location of the True Mean H The argerthetrue drrfererroe between HE and H r Lagev dmevence m rx memsmsmpung arsmmuons w Bge s sma ev 1 1 Changing Sample Size O O Q 9 What changes when N goes up SEM How does it change t Gets smaller What does that do to critical value t Makes it smaller Therefore 5 gets smaller No cost in or Problems Power 13 has a special name power 0 What is it Probability that the null is rejected when the null is false 0 Why would this be important A Actually m make meaningful statements about the probability of the null hypothesis a If power is low why do the study The problem Frequently can t actually compute power VVhy We ll spend lots more time on this later O O O O The Problem The sampling distribution of the mean tends to approach a normal distribution By transforming to the standard normal we can do some very useful things Hypothesis tests of means Construct confidence intervals There is a limitation here though and it s somewhat severe What is it Need to know 5 In practice we rarely know 0 O O O O O The Solution We need to estimate 0 We can with s the sample standard deviation A critical insight For any statistic that has a normal sampling distribution with mean zero we can form the following ratio statistic estimated standard error of the statistic Called the t ratio or t statistic How that helps The sampling distribution of that statistic is well understood Forming the t o For instance we can form a tratio for the mean 3c l SM 0 What is SM Estimated standard error of the mean Simple formula s S M JN s is simply the unbiased sample estimate of the standard deviation Sampling Distribution of t The sampling distribution of tis well understood There is more than one tdistribution tdistributions are identified by the degrees of freedom 0 Degrees of freedom arise from the process of estimating the variance Because we know the sampling distributions for t we can make probabilistic statements about particular values of t Allows us to test hypotheses and form confidence intervals Information about the tdistribution is in the back of your textbook p 682 O O O O O O O O 0 Properties of the t Distribution The tdistribution looks much like the normal But it s flatter More tail heavy Textbook has a good illustration of this p 176 Thus to cut off the same percentage of the distribution more extreme values are required Particularly with smaller sample sizes The reason The sampling distribution of 3 tends to have a positive skew at smaller N A tdistribution with infinite degrees of freedom is identical to a normal O O O O Singlesample ttest Actual study Katz et al 1990 100 items from SATVerbal reading comprehension No reading of the passages With random guessing should get 20 correct H0 u520 H1 ugt20 N 28 0 001 Mean 466 s 48 What do we do Form a t ratio which under the null has mean zero 1 Determine how probable that t ratio is If the t ratio is less probable than alpha reject the null Computing the tratio 3 yo s t N l s SM M m 0 s 48 What is it SM 770907 Why subtract it W m N1 is degrees of freedom 5 yo 466 20 t27 2932 M 0907 Hypothesis Test What is the critical value for t27 given alpha 001 Two answers one for onetailed one for twotailed Which did we specify So what do we conclude For Next Time Finish Howell Chapter4 0 Start Howell Chapter 7 Homework 4 due next week sometime Wednesday Advanced Psychological Statistics Psychology 502 Repeated Measures ANOVA 3 and Categorical Association Nm Gilll t 2 quot 3007 Overview Questions Finish up ANOVA Mixing betweensubjects and withinsubjects factors ANOVA wrapup Chisquare goodness of fit Chisquare test of independence Mixing Betweensubjects and Withinsubjects It is possible to have designs with both between subjects and withinsubjects designs Often called mixed designs A Could have multiple factors of both types How do these work together a Consider a fourway design where A and B are between subjects factors and C and D are withinsubjects Betweensubjects factors ignore the repeated measures For each subject take the average across all repeated conditions Do a betweensubjects ANOVA on that a Single error term MSE for all betweensubjects main effects and all interactions that are entirely between subjects Mixed Designs Withinsubjects factors operate normally Main effect of D tested against SxD interaction CxD interaction tested against SxCxD interaction The only tricky bit Interactions involving between and within factors eg BXC Tested against the withinsubjects error term a Thus BxC interaction tested against SXC interaction Example GLM statement now includes a betweensubjects variable GLM tldl TO t2d3 BY gr39oup WSFACTOR drug 2 dose 3 Still produces the levels report adds into for between subjects tactors With in Su bjects Facto rs Measure MEASUR L1 DRUG 1 Depend ent Variable T1D1 T1 D2 T1 D3 D 1 2 3 1 2 3 T2 D1 T2 D2 T2 D3 Between Sn bjects Factor 5 SPSS Output Sphericity Still get the sphericity report Measure MEASUR L1 Maucles Test of Sphericityquot Epsilona Approx Greenhous Lower Within Subjects Effect Mauchly s W Chi Square df Sig e Geisser Huynh Feldt bound DRUG 1000 000 0 10 00 1000 1000 DOSE 862 1932 2 381 879 1000 500 DRUG DOSE 630 6014 2 049 730 85 1 500 Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is proportional to an identity matrix a May be used to adjust the degrees of freedom for the averaged tests of signi cance Corrected tests are displayed in the Tests of Within Subjects Effects table Design nterceptGROUP Within Subjects Design DRUG DOSEDRUGDOSE Note that it s not quite the same as before SPSS Out ut Withinsubjects effects an interactions T515 of Within Subjems Effects 1 Type III Sum sduree of Squar df Mean Square F Sig DRUG Sphenmy Assumed 345544 1 345544 13001 003 Greenhouses eisser 345544 1000 345544 13001 003 Huynhereldt 345544 1000 345544 13001 003 deerebdund 345544 1000 345544 13001 003 DRUGx GROUP Sphericity Assumed 325344 1 326344 12163 004 Greenhousesceisser 326344 1000 326344 12163 004 HuvnhsFel 1 326344 1000 326344 12163 004 deerebdund 326344 1000 326344 12163 004 ErrarDRUG Sphericity Assumed 3755 45 14 25532 GreenhouseeGeisser 3755 46 14000 26532 HuvnhsFE39dt 3756 46 14000 26532 deerebdund 3756 46 14000 26532 DOSE Sphericity Assumed 755771 2 379355 36 510 000 GreenhouseeGeisser 755771 1757 431765 36 510 000 HuvnhsFel 1 755771 2000 379355 36510 000 Lowersbuund 755771 1000 755771 36 510 000 DOSE GROUP Sphericity Assumed 42271 2 21135 2034 150 GreenhouseeGeisser 42 271 1757 24054 2034 156 Huynhereldt 42 271 2000 21135 2034 150 Luwersbaund 42271 1000 42271 2034 176 ErrurDOSE Sphericity Assumed 2909 55 25 10391 GreenhouseeGeisser 2909 55 24603 11526 Huynherel 1 290955 25000 10391 Lowersbfmquotd 2909 55 14000 20753 SPSS Output Trend Analysis Tests of Within Subjects Contrasts Measure MEASURE 1 Quadratlc 2521 2521 Quadratlc 2083 E 02 20 83E 02 95458 6818 QU drath 12000 12000 75 0 750 142917 10 208 SPSS Output Interaction Graph Estimated Marginal Means of MEASURE1 30 23 g 26 m w 2 Ta 5 24 9 3 22 GROUP 12 1 1E 20 393 2 DRUG SPSS Output Betweensubjects effects Tests of Between S ubjects Effects Measure MEASUREl Transformed Variable Ale age Type III Sum Source of Squares df Mean Square F Sig Intercem 556 32510 1 55632510 14613 000 GROUP 270010 1 270010 7092 019 Error 532979 14 38070 Equivalent to a betweensubjects ANOVA on the mean or sum of all the dvs COMPUTE dep MEANt1d1 TO t2d3 EXECUTE ONEWAY dep BY group ANOVA DEP Squares df Mean Squa39e F Sig Between Groups 45002 1 45 002 7092 019 Vlmhin Groups 88830 14 6 345 Tdal 1338 32 15 O O O 9 Mixed Interactions If you have an interaction between two withinsubjects factors or two betweensubjects factors do what you would before But what if you have an interaction where one factor is a betweensubjects factor and one is withinsubjects As you might imagine it gets complicated Three strategies post hocs simple main effects contrasts Post hocs are difficult Some cells will require betweensubjects comparisons some withinsubjects Very messy Not recommended O 0 Mixed Simple Main Effects Let s say we have a 3way ANOVA where A and B are withinsubjects and C is betweensubjects Variables A181 A281 A381 A182 A282 A382 A183 A283 A383 C also has three levels How do we decompose that into simple main effects Two ways look for effects of A at levels of C Look for effects of C at levels of A Works somewhat differently depending on how you re splitting things O O O O Splitting Between Subjects Look for effects of A at levels of C Since C is betweensubjects then we simply repeat the same GLM once for each level of C TEMPORARY SELECT IF c EQ 1 GLM albl a2b1 a3b1 a1b2 a2b2 a3b2 a1b3 a2b3 a3b3 WSFACTOR b 3 a 3 r TEMPORARY SELECT IF c EQ 2 GLM albl a2b1 a3b1 a1b2 a2b2 a3b2 a1b3 a2b3 a3b3 WSFACTOR b 3 a 3 I And so on for each level of C Variable B is still in there but we re not looking for it So what are we looking for a Effect of A at one level of C and not at the other O O O O O O O Splitting Within Subjects Look for effects of C at levels of A Three repeatedmeasures oneways Effects of C at level 1 of A GLM albl a1b2 a1b3 BY c WSFACTOR b 3 Effect of C at level 2 of A v GLM a2b1 a2b2 a2b3 BY c WSFACTOR b 3 Effects of C at level 3 of A I GLM a3b1 a3b2 a3b3 BY c WSFACTOR b 3 Again B is a nuisance variable Looking for effects of C in some places and not others Mixed Interaction Contrasts 0 Somewhat more complex that either fullywithin or fully between case The basic idea Form a new variable for your withinsubjects contrast Use that new variable in a betweensubjects ANOVA and put your contrast on the betweensubjects variable there Contrast on A is 1 2 1 Contrast on C is 1 1 2 Doing the Interaction Contrast 0 Form a new variable representing 1 2 1 on A Easiest way mnwwmwbmwmwmm wbwbdA Then form a variable for the contrast I COMPUTE COMPUTE COMPUTE COMPUTE EXECUTE a1 MEANalbl alb2 alb3 a2 MEANa2bl a2b2 a2b3 a3 MEANa3bl a3b2 a3b3 aquad a1 2a2 a3 Now do an ANOVA with C as independent and do the contrast on C n UNIANOVA aquad BY c CONTRASTc SPECIAL1 1 2 Questions Factorial ANOVA ReduX First if you have specific hypotheses that is ones which can be captured by contrasts test just those A Regardless of whether they re main effects or interactions Bonferroni adjustments may be appropriate If you find nothing here then I suggest hunting with Scheff If you don t have specific hypotheses then just run the overall ANOVA What effects are reliable Often advisable to look at main effects only after considering interactions Depends on pattern Factorial ANOVA ReduX Decompose any reliable interactions Several choices Interocular trauma not recommended Simple effects Posthocs on cells Interaction contrasts r Technically Scheff is appropriate here But since simple effects analyses are often permissible often given a pass on this Once you understand those decompose reliable main effects Posthocs Scheff adjusted contrasts 0 OK now on to categorical association O O O O A Simple Question A researcher is interested in how people make random selections The study Goto department store Lay out five identical pairs of socks ask which one people prefer Results from 100 subjects 20 17 12 19 32 Question Were these subjects random O O O O Expectation and Deviation What would be the expected value of each category it subjects were really random 20 a VVhy How well do the two distributions the observed one and the expected one agree How should we measure agreement How about average deviation from the expected value Let s try it out 202oo 172o3 192o1 322o12 O38112 12208 O O O 9 Deviation and Assumptions Thus we need some other metric The standard 0 E 2 E Why that one Because when assumptions are met sum of that measure has known approximately sampling distribution Assumptions 1 Observations are independent of one another Reasonably large eg 5 expected frequencies Required for normality this is based on normal approximation of the binomial or multinomial O O O O The Test The chisquare goodness of fit test is designed to answer questions about deviations from expectation The procedure 1 Compute the expected frequency in each cell Take the difference between expected and observed and square it Divide by expected Add this up for all cells Resulting statistic has known sampling distribution approximately a Chisquared with J1 degrees of freedom Example data with expected frequency of 20 20 17 12 19 32 O O O O O 0 Example 2 0 E2 z 2 E So for the example data ZZZO2328212122 2109 20 20 How many degrees of freedom What s the appropriate critical value Should we reject the null What is the null Note that there can be many sources for expected frequencies not just N of categories O O O The Test in SPSS For our data we d have a variable with 100 cases The SPSS code NPAR TEST CHISQUAREslctn EXPECTEDEQUAL STATISTICS DESCRIPTIVES The EXPECTED could be a list of numbers instead of E QUAL SLCTN Observ ed N Expected N Residual 100 20 200 200 17 200 3 0 300 12 200 8 0 400 19 200 1 0 500 32 120 Tdal 100 200 O O SPSSthut Test Statistics S LCTN Ch iSquarea 10900 df 4 Aymp Sig 028 a 0 0e Is 0 have expected frequencies less than 5 The minimum expected oellfrequency is 200 Pretty basic output Chisquare value a Degrees of freedom pvalue Questions O O O O 9 Independence Remember way back to the beginning of the semester we talked about independence and dependence What does it mean to say that one random variable is independent of the other Remember on the midterm when we asked about the independence of neighborhoods and ethnicity Assuming that we re sampling and there s some fluctuation involved with random sampling we want a test for independence of two random variables There is a chisquare test for this one as well O 9 Example Evaluating educational programs for juvenile firsttime drug offenders five different programs Three offense classifications No more offenses one more offense two or more offenses Is recidivism associated with program O A B I D E Totals None 14 3922 3921 2 1 3936 I 8 ED 35 31 T 101 2 1 1 3 239quot 21 14 103 Total3 33 T2 83 T2 40 SIIIIII Domg the Test Null hypothesis is that there is no association hence chisquare test of association That is the variables are independent What s the test statistic Also a chisquare hence 2 0E2 9 ZET First important question Where do the expected frequencies come from Second important question How many degrees of freedom Computing the Chisquare For the A None cell Marginals are 96 and 33 Expected is 9633300 1056 Thus this cell s contribution to the overall chisquare is 0 E2 14 10562 E 1056 2112 For the D 1 cell Marginals are 101 and 72 Expected is 10172300 2424 lt Thus this cell s contribution to the overall chisquare is 0 E2 31 24242 1885 E 2424 The Test Total chisquare is 1590 What is the critical value against which that should be compared Should we reject the null What was the null 80 what should we conclude Wait something s funny Didn t we have to assume the observations are independent How can this work Is this a onetailed test or a twotailed test Why 9 O O O O O O O O O 9 Measures of Association The actual value of the chisquare statistic depends on the number of categories for each variable Would be useful to have some metric of association which does not depend on this and on N Contingency coefficient C For the example 2 1590 2quot 0224 95 N 1590 300 C O O O 0 Measures of Association C is not a good parallel to r though because C can never be 1 and depends on the dimensions of the table Thus another statistic is often used Cramer s V c N k 1 The k there is the smaller of the two table dimensions For our example 12 159 20163 C Nk 1 3002 O O O O 9 Special Case The 2 X 2 2 x 2 contingency tables have special properties Howell gives an alternate computational formula which is fine but leaves off the real issues Chisquare is a continuous approximation to discrete distributions based on the multinomial or binomial For 2 x 2 tables it is possible to compute the exact probability and dispense with the normality assumption Allows analysis of tables with smaller expected frequencies Also gives Cramer s V additional meaning O O O Fisher s Exact Test Consider this table A1 A2 B1 A B 32 C D It assignment is really random can essentially do a randomization test considering all possibilities ATV AYE SPSS will report Fisher s Exact Test for 2 x 2 s pexact O O O O 9 Phi This is not the same phi as with power Remember correlation between continuous variables Phi is the correlation between two dichotomous variables 05 ill 2 N Since all 2 x 2 tables represent two dichotomous variables in this case phi will be the same as r Cramer s V and phi are the same for 2 x 2 tables O O O Chisquared Independence in SPSS Test of association expected frequencies are derived from data Syntax CROSSTABS TABLES recid BY prog STATISTICS CHISQ PHI Will produce a table of frequencies and the appropriate chisquare value as well as pvalue and Cramer s V SPSS Output RECID FROG Crosstabulation Count PROG 1 2 3 4 5 Totai REC1D 1 14 22 21 2O 19 96 2 8 20 35 31 7 101 3 1 1 3O 27 21 1 4 1 O3 Totai 33 72 83 72 40 300 ChiSquare Tests Asymp Sig Vaiue of erided Pearson Chiquuare 159013 8 044 LiKeiihood Ratio 15995 8 042 Lineareoerihear Association 443 1 506 N of Vaiid Cases 300 3 0 ce11s0 have expected count 1ess than 5 The minimum expected count is 1056 Symmetric Measures I Vaiue l Approx 810 I Norhihai by Phi 230 044 Norhiha1 Crarher s V 163 044 N ofVaiid Cases 300 3 Not assuming the huii hypothesis 13 Using the asymptotic standard error assuming the huii hypothesis More Complex Categorical DeSIgns The chisquared test of association is conceptually similar to a oneway ANOVA on categorical data 0 What it you have a more complex design with categorical data You need other techniques Logistic regression Loglinear analysis We won t cover those It you need to analyze such an animal recommend reading this book Agresti A 2002 Categorical data analysis New York Wiley Wrapping It Up One of the most common questions get afterwards is how do I analyze this design Generally this is a function of What kind of measurement is your dependent variable That is ratio interval ordinal etc How many independent variables What kind of measurement are your independent variables There s a chart in your book which lays this out 1 It s on page 10 in chapter 1 Bad place for it However never do a MannWhitney Wilcoxon Friedman or KruskaIWallace test These are crappy nonparametric tests Use permutation or bootstrap tests instead Hey That s it that s all the lectures Rest of semester devoted to answering questions mostly on homeworks and discussion of issues in statistics Yes discussion of issues 80 be sure to do the reading and come prepared to discuss what you ve read For Next Time Finish anything we didn t finish today 9 Homework 12 due tomorrow Homework 13 to be posted tonight or tomorrow due next week Wednesday Read Abelson chapters 1 5 Come prepared to discuss a Remember there is a participation component to your grade in this course Advanced Psychological Statistics Psychology 502 Probability 1 lis 3 3quotlgtl J Vquot Overview Questions on the text Terminology Events Probability Joint and conditional probability Independencedependence Bayes s Theorem Counting Maybe Expected value probability vs odds Questions on SPSS stuff 9 O O O O O O O O Terminology 0 Simple Experiment Welldefined act or process that leads to a single well detined outcome Classic examples Roll a die or dice Flip a coin Grab a marble 0 Sample Space S Set of all possible distinct outcomes for a simple experiment Every member of the space is a sample point or elementary event Events Any set of elementary events is known as an event class or simply an event Events follow standard set notation bl not A also denoted A or A Event Notation AwB 6 A08 4 AmE A and B are mutually exclusive Probability Each event has a number between 0 and 1 associated with it pS1 p 0 o s pA s 1 What does pA represent Analytic position a Frequency position a Subjective probability position Question a As a function of pA what is pA Computing Probabilities To compute the probability of a set Count the number of events in the set Divide by the number of events in the sample space This seems simple but sometimes just counting can be tricky There are often other ways to do this using known probabilities of other related events Probabilities of Sets 6 pm mAum7 mAm z Computing Probabilities 9 Draw a card from a randomized deck 9 pjack o 4 cards are jacks 52 total cards k 4 1 ac p 52 13 pjack or king 1 1 39 k k39 pJac p mg 13 13 13 pjack or spade pjack pspade pjack and spade Joint Probability 9 What s the probability of boxcars double 6 s 126 11 o How does that help Probability of joint events is the product of the probabilities of the individual events 1 1 1 12 6 6 p12 ppp 6636 Alternatively we could also have considered all 36 events in the joint space 5 Many probability problems have more than one solution method be sure to think about all of them Conditional Probability pA B AB e p 108 4 o Read pA B as probability of A given B 9 Question is pA B greater than smaller than or equal to pA Depends on relationship of A and B Dependence pA 16 3 198 03 gt pAn B 02 pAIB020367 PAB gtPA pA 47 193 203 69 pA B01 gt pAIB010333 PAB lt 19A O 9 Independence 19AIB PM A rA pA does not depend on B Samples from random processes are usually independent Flipping coins Rolling dice O O O 9 More Dice Games Say a die has been rolled ten times Given fair dice which outcome is more likely 3451625342 4444444444 OK try this p6 on 1 die 16 p12 on 2 dice 136 It just rolled a six on one die what s the probability that I ll roll a six again That d give 12 on 2 dice 1 in 36 right Not a Game A test for HIV that is said to be 90 accurate Say 1 of the population has HIV fictional number If someone gets back a positive test what s the probability that they have HIV Issue 1 Accuracy What is accuracy Correctly identifying positive cases Correctly rejecting negative cases Of course it s both 0 Beware single accuracy measures Positive case Negative case test test hit miss false correct alarm rejection Assume hit rate is 90 and false alarm rate is 10 What s your estimate now Notation 2 positive test 0 H has HIV 0 OK so what s pH with no other information given Why Thus what is puH 0 What s p H Why 0 And what s p H O Issue 2 Bayes s Theorem pm I B pltBI AgtpltAgt pltBI ApltAgt pltBIAgtpAgt OI WM pltIHgtpHgt plHpH p70p 0 Anyone see anything interesting in this mess Bayes s Theorem h39t rate base rate pltHlgt pHpH pHpH p PDMH false alarm rate in our case that s 9o1 Hm Z 9o1199 239083 What Consider 1000 people w 1 have HIV that s 10 people 9 correctly identified as having HIV 1 identified as not having HIV 10 miss 99 don t that s 990 people 891 correctly identified as not having HIV 99 identified as having HIV 10 false alarm 108 people identified as having HIV Only 9 have it 9108 8333 Think this might have implications for anything besides HIV testing Bayes s theorem is a major theoretical tool in all kinds of sciences including psychology O O O O Tricky Problems You have ten golf balls numbered 110 in a golf bag Draw one put it back Draw another and so on until five draws What s the probability there is at least one repeat You draw five cards out of randomized deck of cards What s the probability you get a full house To answer questions like this have to know how to count I bet you thought you knew how to count 0 Counting 1 lf K mutually exclusive and exhaustive events can occur on N trials there are KN different sequences Five coin flips 25 32 different outcomes Three die rolls 63 216 outcomes f K1 KN are the numbers of distinct events that can occur on trials 1 N of a series then the number of different series is K1K2KN Flip a coin and roll a die 26 12 outcomes Just a more general case of the previous O O 0 Counting 2 Permutations You have eight books on your shelf that have been unpacked recently How many different orders could they be in A First item 8 choices Second item 7 choices And so on a nn1n21 is noted n and called factorial 8 40320 permutations Bonus question How many of those are alphabetical Let s say you only take three of the eight 876gt 336 n P J n k O O 0 Counting 3 Combinations Same problem but what it we don t care about order That is book2 book6 book4 is the same as book4 book2 book6 336 orders but if we don t care about order just which ones are chosen need to divide that by the number of arrangements of the same items How many arrangements So our answer is In general N r These are called combinations N rN r Probability Tips o pA 1 MN 0 Many probability problems have multiple solution paths This is particularly true for problems that are joint probability problems Solve by counting number of events in the qualifying set and dividing by total size of the space Solve by computing probability of each subevent and multiply A common mistake is to try to somehow combine those two methods Be careful Golf Ball Problem one path 0 First part pat least one repeat 1 pno repeats No repeats case is easier Second part How many draws without repeats Counting rule 2 39 P105 109876 How many total different draws Counting rule 1 1O5 Probability of no repeats P105 105 z 030 Thus probability of at least one repeat is 070 Golf Ball Problem other path 0 First part pat least one repeat 1 pno repeats No repeats case is easier Second part Joint probability of no repeats First ball doesn t matter what it is Second ball 9 balls don t match first out of ten possible so 910 Third ball 8 balls don t match first two so 810 1 Fourth ball 710 a Fifth ball 610 9 Now multiply 19876 z 030 0 Thus probability of at least one repeat is 070 5 Poker Hand Probability of a Full House Everyone know what a full house is Five cards three of a kind of one card plus a pair of another Strategy Count the number of ways to get a full house divide by total number of hands How many threeofakinds can we make 13 different cards A 2 3 4 5queen king For each of those how many ways to pick three 134 of the four suits Multiply those is the of three of a kinds 4 Assuming a threeofakind has been selected 122 how many pairs 12 cards left each one has sets O O 9 Full House So if we multiply those all together that s how many different full houses that can be made Now we divide that by the number of hands that can be made i 52 cards in the deck 4 Choose 5 of them order doesn t matter 4 4 13 12 3 2 000144 52 5 Probability of a full house in a single draw of five cards is less than 15 O O O Gambles Choose one of the following two options 1 A 100 chance of losing 55 2 A 25 chance of losing 210 and a 75 chance of losing nothing Choose one of the following two options 1 A sure gain of 220 2 A 25 chance to gain 900 and a 75 chance to gain nothing A person comes to you with a game Roll two dice and she ll give you a dollar for every spot that comes up on the roll However you have to pay to play the game 4 Would you play if it cost you 6 to play i Would you play if it cost you 8 to play 9 Expected Value Definition Longrun average for any random variable over an indefinite number of samplings And that means If you were to play the game an infinite number of times what s the mean outcome Computation Look at the value of every outcome in the state space Multiply each value by its probability of occurrence a Sum them Eco Expo Decision rule chose gamble with best expected value O O Gamble 1 Choose one of the following two options 1 A 100 chance of losing 50 2 A 25 chance of losing 210 and a 75 chance of losing nothing Option 1 Expected value of 50 Option 2 Expected value of 25210 750 2 525 Option 1 is the better gamble O O O O Gamble 2 Choose one of the following two options 1 A sure gain of 220 2 A 25 chance to gain 900 and a 75 chance to gain nothing Option 1 Expected value of 220 Option 2 Expected value of 25900 750 225 Again option 2 is the better gamble O O O O Gamble 3 A person comes to you with a game Roll two dice and she ll give you a dollar for every spot that comes up on the roll However you have to pay to play the game Expected value of one die is 161 162 163 164 165 166 35 Expected value of two dice is 235 7 If she will let you play for 6 play as often as she ll let you If she asks 8 to play don t play O O O 0 Texas Lottery Pick 5 numbers from 144 without replacement order doesn t matter and then 1 of 44 for the bonus ball For the sake of argument Payoff is 6 million you won t have to share What s the expected value of a lottery ticket Probability of winning payoff What s the probability of winning 1 i 1 2 1 2o927x10398 44 44 44 44 47784352 5 539 I Expectation 6x106 209x10398 01256 The expectation value of a lottery ticket is a little more than a dime O O 9 Odds Probabilities are often expressed as odds 3 to 1 in favor 5 to 2 against How to translate p 0 p 0 1 odds 1 The formulae leave something to be desired requires a single number for 0 Solution Divide according to direction Odds listed as 31 in favor 0 is 3 Odds listed as 52 against 0 is 25 04 Odds 0 odds 1 p p 0 1 52 against means p 0404 1 0286 31 in favor means p 331 075 Now convert probability to odds Odds on a event with p 2 28 25 Usually expressed as an integer so invert A 125 4 so 41 against Often need to sanity check these 0 O O O For Next Time Read the rest of Chapter 5 in the text it you haven t Also read 181 and 184 Homework 2 due on Friday 500 pm Advanced Psychological Statistics Psychology 502 Repeated Measures ANOVA 1 NM vitilm quot Jill l7 Overview Questions Oneway repeated measures stuff Basic ideas Expected mean squares Example Contrasts Power Repeated measures in SPSS Posthocs Start factorial repeated measures 0 a O O Hypothetical Study Familiarity and humor Show cartoons to 1st 2nd 3rd children collect humor 1 6 5 2 433 ratings I 2 5 5 4 467 E rt hcild f sl39l i s 5 6 s over time 4 6 5 4 53900 5 7 3 3 433 6 4 2 1 233 7 4 4 1 300 8 5 7 2 467 525 4625 250 4125 Linear Model 0 O O O O O O xijuni1jmij ei x is the individual observation u is the grand mean m is the effect of being subject i 1 is the effect of being in conditionj m is the interaction e is random error like always normal mean zero Distributional assumptions Subject effects are normal with mean of zero a Subject by condition interactions normal mean zero O O O O Null Hypotheses Again multiple null hypotheses No differences between subjects n1n2rri0 No differences between conditions 11 12 17i0 No interactions 7171711 75121 m 0 We will only be testing one of these 111217i0 O S O O SSXC 22060 cl Cj J C2 Sums of Squares As usual each effect has a sum of squares 2 2 SSSMbjem K xi x SSwnditions n2 x j x 55mm 2206 C2 SS SSSXC SStatal subjects SS conditions Each also has a degrees of freedom Subjects n 1 Conditions K 1 Interaction n 1K 1 Total nK 1 And thus a Mean Square Expected Mean Squares Not quite as conventional as for betweensubjects ANOVA 2 0221 022752 02 EL 1 1 11 1 M quot 1XK 1 EMSsubjects a EMScandilians a 071 no Ems a a o Technically there is no MSE That is there is no term that estimates just 092 0 So how do we test hypotheses Fratios Two variance estimates will form an Fratio But want one that under the null should be more or less 1 How can we form that for this design 9 O 9 MS conditions 2 2 2 F 08 am not conditions 2 2 MSSXC 08 am If null hypothesis of all quotCS 2 0 is true then both the numerator and denominator estimate the same thing Under the null this is distributed as an F with K1 and n 1K 1 degrees of freedom 9 O Other Effects EMS 02Kcr2 EMS 02a2 na2 subjects 8 71 e m r conditions EMSSXC of a What about the effect of subjects i Can we test it Why or why not Do we care What about the interaction of subjects and conditions Can we test it Why or why not Do we care Note subjects is a random as opposed to fixed effect 9 O O Analysis of the Example Here are the data agaln 1st 2nd 3rd 9 Marginals of subjects 1 6 5 2 433 wrll define the m s 2 5 5 4 467 Marginals of the days 3 5 6 3 467 wrll defIne the T s 4 6 5 4 500 Multiple ways to 5 7 3 3 4 33 compute interaction 88 39 6 4 2 1 233 7 4 4 1 300 8 5 7 2 467 525 4625 250 4125 Example SS Sum of Squares for condition Est rj s are 525 4125 1125 4265 4125 05 25 4125 1625 811252 052 16252 3325 0 Sum of squares subjects Est rugs are 433 4125 02083 467 4125 05417 etc 302O832 054172 05417218625 0 Sum of squares for the interaction or error SSSxC 88total 39 SSsubjects 39 88condition 1 sstotal 6 41252 2 41252 68625 86ch 68625 3325 18625 1675 ANOVA Table Source g g MS E Subjects SSs n 1 SSsn1 Condition SSc k 1 SSck1 MScMSsxc Interaction SSsxc n1 k1 SSidti SSt nk 1 Source g g MS E Subjects 18625 7 2661 Condition 3325 2 16625 1390 Interaction 1675 14 1196 Total 68625 23 0 What s the critical value for F2 14 What should we conclude O O O Sphericity Repeatedmeasures ANOVA makes somewhat more complex assumptions Variance of each condition is equal This is the same as betweensubjects ANOVA A Covariances between all variables are equal Remember covariance Think of it this way Create difference scores between all pairs of variables Variance of all those difference scores is assumed to be equal Howell notes this is technically compound symmetry but most folks call this sphericity O O O O Violating Sphericity What happens when the sphericity assumption is violated Type I error rate is not preserved Like a t test with unequal variances and unequal n Not merely a power issue The Ftest for the effect of conditions is not distributed as F with k 1 and n 1k 1 degrees of freedom However it is still distributed as an F Worstcase scenario is F with 1 and k 1 degrees of freedom Very conservative Can we do better Identifying Nonspherical Data There s a measure called epsilon s More than one way to compute epsilon GreenhouseGeisser HuynhFeldt Howell provides equations pp 454 amp 455 0 When assumptions are perfectly met epsilon either one will be 10 Violations of assumptions reduce epsilon The more severe the violation the smaller epsilon is Minimum bound is 1K 1 What is the minimum when K 2 K 1 is also what Correcting How nonspherical do the data have to be to require a correction Opinions on this subject differ a One way of defining a violation Severe violation GG epsilon lt 065 Mild violation HF epsilon lt 085 The correction 1 Multiply both df by epsilon Will df get larger or smaller This will yield fractional dfs Compute new critical value or pvalue based on the new degrees of freedom The good news stats packages will do this for you O O O O Contrasts in Repeated Measures Can again have contrasts on the levels of the within subjects variables However contrasts work somewhat differently mathematically in repeatedmeasures designs A contrast can actually be thought of as an entirely new variable a Consider d1 d2 and d3 are the dv s Trends eg linear quadratic on these are reasonable However we can do the contrast on each subject rather than on means of groups of subjects S Then test if the mean of the new contrast variable is zero How do we test if the mean of a variable is zero Example 1st 2nd 3rd Linear Quad 1 6 5 2 4 2 2 5 5 4 1 1 3 5 6 3 2 4 4 6 5 4 2 0 5 7 3 3 4 4 6 4 2 1 3 1 7 4 4 1 3 3 8 5 7 2 3 7 525 4625 250 275 15 mean 104 334 S O O O The Tests 37 s tN l lt SM SM N Linear 275 7 748 104J Quadratic 5 l7 127 334J There is also an Ftest version of this with 88 O O O O O Other Contrast Properties Good power for specific hypotheses Can be used a priori Bonferroni correction may be appropriate Can be used posthoc A Use Scheff adjustment No sphericity issues only one variable Easy to construct confidence intervals O O 9 Power Computing power for repeatedmeasures ANOVA is difficult for the general case Has to do with estimating multiple correlations However doing so for contrasts is not so difficult Contrasts in repeatedmeasures are effectively ttests for the mean of a variable equal to zero a We know how to do power analyses for such tests a dfN fN for onesample case is fN W Two usual kinds of power analysis A priori Given effect size determine N Posthoc What was power O O 9 Effect Size Effect size for a standard independent t d M 0 How do we compute d for a withinsubjects contrast L 39 I But we don t normally know 0L so we estimate with the standard deviation of the contrast variable Easy to get this from the data O O 0 Power Example Still with our cartoonviewing example Contrasts evaluated by forming a new variable and testing whether the mean was zero For quadratic effect we found L was 15 Standard deviation of L was 334 a Resulted in t7 127 pgt 05 Question If the linear effect is real and we have a good estimate of its size how many subjects should we run in the replication to have power of 095 Need to look up 6 Which means we need d O O O 9 Power Example Compute d What s d A Estimated L is the mean of the contrast variable 15 in this case sL is the standard deviation of the contrast variable 334 d 15334 045 a What size effect is this Power Example Remember solving for N To have power of 095 twotailed we need a 6 of about 36 a dfN 2 2 N 9 640 d 045 Thus we d need 64 subjects to have an 95 chance of finding this effect Kind of a lot but 95 is a lot of power Repeated Measures in SPSS Data file should have one line per subject multiple observations on a line Code for our simple one way from last class would be GLM d1 d2 d3 WSFACTOR day 3 The WSFACTOR statement creates the repeated measures factor Gives it a name day Specifies the number of levels There is no variable in the data file which specifies the withinsubjects independent variable SPSS Output Sphericity You ll get a bunch of stuff labeled multivariate tests you don t need to worry about just yet 0 Then you get this Maucles Test of Sphericityquot Measure MEASUR L1 Epsilona pr ogtlt Greenhou 5 Lower Within Subiects Effect Mauchly39sW Chi Square df Sig e Gei5 Huynh Fg dt bound DAY 2 445 2 95 74 665 2 s 9 I s 908 z 500 Tests the null hypothesis that the error covariance matrix of the orthonormalized trans or med dependent variables is proportional to an identity matrix a May be used to adjust the degrees of freedom for the averaged tests of signi cance Corrected tests are displayed in the Tests of Within Subjects Effects table Design Intercept Within Subjects Design DAY O O O O SPSS Output Omnibus Ftest Tests of Within Subjects Effects Measure MEASURL1 Type III Sum Source of Squares df Mean Square F Sig DAY SphericityAssumed 33250 2 16625 13896 000 GreenhouserGeisser 33250 1498 22189 13896 002 Huvnhsfeldl 33250 1816 18315 13896 001 Loweribound 33250 1000 33250 13896 007 ErrorDAY SphericityAssumed 16750 14 1196 GreenhouserGeisser 16750 10489 1597 HuynhiFeldt 16750 12709 1318 Loweribound 16 750 7000 2393 Not quite the standard ANOVA table The section labeled DAY is the treatment effect ErrorDAY is the treatment x subjects interaction Four lines for each which should we use and why SPSS Output 3 Trend Analysis By default SPSS does trend analysis polynomial contrasts on repeated measures Without you even asking it to A Uses a Ftest based version Tests of Within Subjects Contrasts Measure MEASURLI Type III Sum Source DAY of Squares df Mean Square F Sig DAY Linear 30250 1 30250 56467 000 Quadratic 3000 1 3000 16 15 244 ErrorDAY Linear 3750 7 536 Quadratic 13000 7 1857 Building Custom Contrasts If you want something other than polynomial contrasts you have to do it yourself There are two ways to do this Newvariables a Full matrices Compute new variables 1 For linear 1 O 1 COMPUTE linear dl 0d2 d3 For the contrast 2 1 1 COMPUTE daylv523 2dl d2 d3 Perform ttests TTEST VAR linear day1v523 TESTVAL O Contrast Output Just testing whether the mean of the contrast variable is zero OneSampleTest Test Vdu e 0 95 Con den 0e Interval of he M t df Sig 2tailed Difference Lower Up per LINEAR 7514 7 000 27500 33 54 1 8846 DAY1V823 8813 7 007 33750 5 4680 1 2820 I Full Matrlx C ontrasts Can tell SPSS to generate custom contrasts directly in the GLM syntax Must supply a full matrix k by k of values 1 First row of the matrix must be all 1 s 0 For ourexample GLM d1 TO d3 WSFACTOR day 3 SPECIAL1 1 1 1 0 1 2 1 1 Full Matrix Output 0 Have to remember which contrasts were which Test s of WithinSubjects Contrasts Measure MEASURE1 Type III Sum Source DAY of Squares df Mean Square F Sig DAY L1 60500 1 60500 56467 000 L2 91125 1 91125 14538 007 ErrorD AY L1 7500 7 1071 L2 43875 7 6268 P osth ocs Standard posthoc procedures Tukey REGW have not been welldeveloped for repeated measures SPSS doesn t do posthocs on repeatedmeasures factors What s the recommended procedure If you re doing posthocs on main effects need to form new variables which reprsent marginal means Test all pairwise differences with ttests Use Bonferroni adjustment Posthoc Example Want to do posthocs Test the differences between the means directly 5 TTEST PAIRS d1 d2 d3 Use Bonferroni adjustment Posthoc Example And you d get this out Paired SamplesTest Paired Differences 95 Confidence inteN d of the Std Error Different Mean Mean Std De ation Lower Upper t df Sig Zrtaiied Pairi Di 7 D2 63 1847 653 792 217 957 7 PairZ DirDS 275 1035 366 188 362 7514 7 000 Pair 3 D27 D3 213 1642 581 75 3 50 3 660 7 008 In this case we can conclude that day 1 and day 3 are different and that day 2 and day 3 are different Can t say much about day 1 vs day 2

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the material...plus I made $280 on my first study guide!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.