ebook img

Experimental Design and Analysis for Psychology PDF

192 Pages·2.09 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Experimental Design and Analysis for Psychology

oxford [R] Companion for Experimental Design and Analysis for Psychology Lynne J. Williams, Anjali Krishnan & Hervé Abdi OXFORDUNIVERSITY PRESS OxfordUniversityPressisadepartmentoftheUniversityofOxford. ItfurtherstheUniversity’sobjectiveofexcellenceinresearch,scholarship andeducationbypublishingworldwidein Oxford NewYork Auckland CapeTown DaresSalaam HongKong Karachi KualaLumpur Madrid Melbourne MexicoCity Nairobi NewDelhi Shanghai Taipei Toronto Withofficesin Argentina Austria Brazil Chile CzechRepublic France Greece Guatemala Hungary Italy Japan Poland Portugal Singapore SouthKorea Switzerland Thailand Turkey Ukraine Vietnam OxfordisaregisteredtrademarkofOxfordUniversityPress intheUKandcertainothercountries PublishedintheUnitedStates byOxfordUniversityPress,Inc.,NewYork ⃝c Themoralrightsoftheauthorshavebeenasserted DatabaserightOxfordUniversityPress(maker) Firstpublished2009 Allrightsreserved. Copiesofthispublicationmaybemadeforeducationalpurposes. Typesetby LynneJ.Williams,Toronto,Canada 13579108642 Preface You have successfully designed your first experiment, run the subjects, andyouarefacedwithamountainofdata. What’snext?1 Doescomputing an analysis of variance by hand suddenly appear mysteriously attractive? Granted,writingan[R]programandactuallygettingittorunmayappear to be quite an intimidating task for the novice, but fear not! There is no time like the present to overcome your phobias. Welcome to the wonder- fulworldof[R] The purpose of this book is to introduce you to relatively simple [R] programs. Each of the experimental designs introduced in Experimental DesignandAnalysisforPsychologybyAbdi,etal. arereprintedherein,fol- lowed by their [R] code and output. The first chapter covers correlation, followed by regression, multiple regression, and various analysis of vari- ance designs. We urge you to familiarize yourself with the [R] codes and [R]output,astheyintheirrelativesimplicityshouldalleviatemanyofyour anxieties. We would like to emphasize that this book is not written as the tuto- rial in the [R] programming language. For that there are several excellent books on the market. Rather, use this manual as your own cook book of basic recipies. As you become more comfortable with [R], you may want toaddsomeadditionalflavorstoenhanceyourprogramsbeyondwhatwe havesuggestedherein. 1Panicisnottheanswer! ii 0.0 ⃝c 2009Williams,Krishnan&Abdi Contents Preface i 1 Correlation 1 1.1 Example: WordLengthandNumberofMeanings . . . . . . . 1 1.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 SimpleRegressionAnalysis 7 2.1 Example: MemorySetandReactionTime . . . . . . . . . . . 7 2.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3 MultipleRegressionAnalysis: OrthogonalIndependentVariables 13 3.1 Example: RetroactiveInterference . . . . . . . . . . . . . . . . 13 3.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4 MultipleRegressionAnalysis:Non-orthogonalIndependentVari- ables 21 4.1 Example: Age,SpeechRateandMemorySpan . . . . . . . . . 21 4.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5 ANOVAOneFactorBetween-Subjects,𝒮(𝒜) 27 5.1 Example: ImageryandMemory . . . . . . . . . . . . . . . . . 27 5.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.1.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 30 5.2 Example: RomeoandJuliet . . . . . . . . . . . . . . . . . . . . 30 5.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.2.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.3 Example: FacePerception,𝒮(𝒜)with𝒜random . . . . . . . . 34 5.3.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.3.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.3.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 37 iv 0.0 CONTENTS 5.4 Example: Images... . . . . . . . . . . . . . . . . . . . . . . . . 38 5.4.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.4.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.4.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 40 6 ANOVAOneFactorBetween-Subjects: RegressionApproach 41 6.1 Example: ImageryandMemoryrevisited . . . . . . . . . . . . 42 6.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 6.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.2 Example: RestagingRomeoandJuliet . . . . . . . . . . . . . . 45 6.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 6.2.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7 PlannedOrthogonalComparisons 51 7.1 ContextandMemory . . . . . . . . . . . . . . . . . . . . . . . 51 7.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 7.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 55 7.1.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 59 8 PlannedNon-orthogonalComparisons 61 8.1 Classicalapproach: Testsfornon-orthogonalcomparisons . 61 8.2 RomeoandJuliet,non-orthogonalcontrasts . . . . . . . . . . 62 8.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.2.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8.3 MultipleRegressionandOrthogonalContrasts . . . . . . . . 70 8.3.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 8.3.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 73 8.4 MultipleRegressionandNon-orthogonalContrasts . . . . . 78 8.4.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 8.4.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9 Posthocora-posteriorianalyses 87 9.1 Scheffe´’stest . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.1.1 RomeoandJuliet . . . . . . . . . . . . . . . . . . . . 88 9.1.2 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 9.1.3 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 91 9.2 Tukey’stest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 9.2.1 ThereturnofRomeoandJuliet . . . . . . . . . . . . 96 9.2.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . 97 9.2.1.2 [R]output . . . . . . . . . . . . . . . . . . . . 100 9.3 Newman-Keuls’test . . . . . . . . . . . . . . . . . . . . . . . . 106 9.3.1 TakingoffwithLoftus... . . . . . . . . . . . . . . . . 106 9.3.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . 107 9.3.1.2 [R]output . . . . . . . . . . . . . . . . . . . . 112 9.3.2 Guesswho? . . . . . . . . . . . . . . . . . . . . . . . 119 ⃝c 2009Williams,Krishnan&Abdi 0.0 CONTENTS v 9.3.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . 119 9.3.2.2 [R]output . . . . . . . . . . . . . . . . . . . . 122 10 ANOVATwoFactors;𝑆(𝒜×ℬ) 129 10.1 CuteCuedRecall . . . . . . . . . . . . . . . . . . . . . . . . . . 129 10.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 10.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 133 10.1.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 139 10.2 ProjectiveTestsandTestAdministrators . . . . . . . . . . . . 139 10.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.2.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 140 10.2.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 143 11 ANOVAOneFactorRepeatedMeasures,𝒮 ×𝒜 145 11.1 𝒮 ×𝒜design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 11.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 11.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 146 11.2 Drugsandreactiontime . . . . . . . . . . . . . . . . . . . . . 148 11.2.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 11.2.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 150 11.2.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 152 11.3 ProactiveInterference . . . . . . . . . . . . . . . . . . . . . . . 152 11.3.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 11.3.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 154 11.3.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 156 12 TwoFactorsRepeatedMeasures,𝒮 ×𝒜×ℬ 157 12.1 Plungin’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 12.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 12.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 160 12.1.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 164 13 FactorialDesign,PartiallyRepeatedMeasures: 𝒮(𝒜)×ℬ 165 13.1 BatandHat.... . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 13.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 13.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 167 13.1.3 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 171 14 NestedFactorialDesign: 𝒮 ×𝒜(ℬ) 173 14.1 FacesinSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 14.1.1 [R]code . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 14.1.2 [R]output . . . . . . . . . . . . . . . . . . . . . . . . . . 175 14.1.3 F andQuasi-F ratios . . . . . . . . . . . . . . . . . . . . 178 14.1.4 ANOVAtable . . . . . . . . . . . . . . . . . . . . . . . 179 Index 183 ⃝c 2009Williams,Krishnan&Abdi vi 0.0 CONTENTS ⃝c 2009Williams,Krishnan&Abdi 1 Correlation 1.1 Example: Word Length and Number of Meanings Ifyouareinthehabitofperusingdictionariesasawayofleisurelypassing time, you may have come to the conclusion that longer words apparently have fewer meanings attributed to them. Now, finally, through the mira- cleofstatistics,ormoreprecisely,thePearsonCorrelationCoefficient,you neednolongerponderthisquestion. We decided to run a small experiment. The data come from a sample of20wordstakenrandomlyfromtheOxfordEnglishDictionary. Table1.1 onthefollowingpagegivestheresultsofthissurvey. AquicklookatTable1.1onthenextpagedoesindeedgivetheimpres- sion that longer words tend to have fewer meanings than shorter words (e.g., compare“by”with“tarantula”.) Correlation, ormorespecificallythe Pearson coefficient of correlation, is a tool used to evaluate the similar- ityoftwosetsofmeasurements(ordependentvariables)obtainedonthe same observations. In this example, the goal of the coefficient of corre- lation is to express in a quantitative way the relationship between length andnumberofmeaningsofwords. For a more detailed description, please refer to Chapter 2 on Correla- tioninthetextbook. 1.1.1 [R] code # Correlation Example: Word Length and Number of Meanings # We first enter the data under two different variables names Length=c(3,6,2,6,2,9,6,5,9,4,7,11,5,4,3,9,10,5,4,10) Meanings=c(8,4,10,1,11,1,4,3,1,6,2,1,9,3,4,1,3,3,3,2) data=data.frame(Length,Meanings) Mean=mean(data) Std_Dev=sd(data) # We now plot the points and SAVE it as a PDF # Make sure to add the PATH to the location where the plot is 2 1.1 Example: WordLengthandNumberofMeanings Numberof Word Length Meanings bag 3 8 buckle 6 4 on 2 10 insane 6 1 by 2 11 monastery 9 1 relief 6 4 slope 5 3 scoundrel 9 1 loss 4 6 holiday 7 2 pretentious 11 1 solid 5 9 time 4 3 gut 3 4 tarantula 9 1 generality 10 3 arise 5 3 blot 4 3 infectious 10 2 TABLE1.1Length(i.e.,numberofletters)andnumberofmeaningsofarandomsampleof20wordstakenfrom theOxfordEnglishDictionary. # to be saved pdf(’/home/anjali/Desktop/R_scripts/01_Correlation/corr_plot.pdf’) plot(Length,Meanings,main="Plot of Length vs Meanings") dev.off() # We now perform a correlation and a test on the data which gives # confidence intervals cor1=cor.test(Length, Meanings,method = c("pearson")) # We now perform a regression analysis on the data reg1=lm(Length˜Meanings) # We now perform an ANOVA on the data aov1=aov(Length˜Meanings) # We now print the data and all the results print(data) print(Mean) print(Std_Dev) print(cor1) summary(reg1) summary(aov1) ⃝c 2009Williams,Krishnan&Abdi

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.