您好,欢迎访问三七文档
RforStatistics,ByExample:AWorkshopfortheEcologicalSocietyAmericaHankStevensHStevens@muohio.eduDepartmentofBotanyMiamiUniversityOxford,OH45056USA2iIwrotethismanualtoaccompanyaworkshopsponsoredbytheStudentSectionoftheEcologicalSocietyofAmerica(ESA)forthe2006annualmeet-ingheldinMemphis,Tennessee,USA.Allmistakesandmisrepresentationsaremyowndoing.Buyerbeware!Oxford,OH,USA,MHHSAugust2006~stevenmh/ThisworkshopisdesignedforgraduatestudentswhohaveneverusedR,andwhohavelittlestatisticalexpertise.Sadly,weoffernofreefood.Checkthelobby–Iamgoingto.Thisdocumentisnotintendedforeasyuse.Itisdesignedtobeusedwithaninstructor.Youwillnotfind,forinstance,graphsofoutput,asIwillbecreatingthesewithyou,andyouwillseetheoutputonthescreen.Youwillneedtoexploretheideaspresentedhereingreaterdepth.Fol-lowingthisworkshop,Iurgeyoutogothroughadifferentintroduction,perhapstheRmanualentitled“AnIntroductiontoR.”Oxford,OH,USA,M.HankH.StevensAugust2006iiContents1ABriefIntroduction11.1References.............................11.2OverviewofR...........................21.3WhatisR?............................21.4StrengthsofR/S.........................21.5TheRGraphicalUserInterface(GUI).............31.5.1TheRGUIisdesignedformaintenance........41.5.2Scripts...........................41.6FollowUp.............................51.7PreparationforTheRestofthisManual............51.7.1AWord(ortwo)AbouttheRLanguage........51.8CodeforeachChapter......................51.9StartingRforthisWorkshop..................61.9.1BegintouseRwithIntroAndChap1.r.........61.10HaveFun.............................82AMean,e.g.92.1ChapterContent.........................92.2Simplestatistics.........................102.3Graphicaldisplaysthatshowdistributions...........11iiiivCONTENTS2.4Anexample:t-basedconfidencelimits.............123Correlation,e.g.153.1Chaptercontent.........................153.2SimpleGraphs..........................163.3TestsofAssociation.......................173.4AddingGroupstoScatterplots.................183.5Addingcomplextextwithexpression.............184ttest,e.g.214.1Chaptercontent.........................214.2GettingStatistics,ByGroups..................224.3ComparingGroups........................234.4GettingYourDataIntoR....................244.4.1Dataframes........................244.4.2Subsettingandsorting..................244.4.3GettingYourOwnDataIntoR.............264.5AnotherExample.........................284.5.1Analysis(withgraphsandtests)............284.5.2AGraphicPresentation.................284.6CreatingaGraphicsFile.....................295OnewayANOVA,e.g.315.1ChapterContent.........................315.2AnalysisofVariance.......................325.2.1LookattheData.....................325.2.2AssumptionsofANOVA.................335.2.3Specifying,fitting,anddiagnosingmodels.......345.3MultipleComparisons......................37CONTENTSv5.3.1Modelcoefficientsandcontrasts.............375.3.2Comparinggroups....................385.4GraphingGroups.........................396SimpleLinearRegression416.1ChapterContent.........................426.2Thelinearmodel.........................426.3PerformingRegressionAnalysis.................426.3.1Interpretingregressioncoefficients...........446.4PredictionandGraphics.....................447MultiplePredictors477.1ChapterContent.........................477.2UsingRegressionwithDifferentGroups............487.2.1Yourdata.........................487.2.2ModelsasBIGObjects.................507.2.3Multi-predictormodels..................527.2.4ReadinganANOVAtable................537.2.5Quantifyingrelations...................547.2.6Modelsimplification...................587.2.7Graphicsofdataandofmodels.............588ADataAnalysisMenagerie63viCONTENTSChapter1ABriefIntroduction1.1ReferencesHereareassortedreferencesthatIcanrecommendbecauseIhaveusedthem.Otherssourcesnotlistedherearealsoexcellent,Iamsure.•RProjectdownloads,FAQsandmanuals•Crawley,M.J..StatisticalComputing:anIntroductiontoDataAnal-ysisusingS-Plus.JohnWiley&Sons,Ltd.,Chichester,2002.•Dalgaard,P.2002.IntroductoryStatisticswithR.Springer-Verlag,NewYork.•Pinheiro,J.andD.Bates.Mixed-effectsModelsinSandS-PLUS.Springer,NewYork,2000.•Venables,W.W.andB.D.Ripley2002.ModernAppliedStatisticswithS-Plus.Springer-Verlag.•VenablesW.W.andB.D.Ripley.2000.SProgramming.Springer-Verlag.Springerisalsocomingoutwithanew,low-priced,paperbackseriescalled”UseR.”Thesewillincludedozensofbookscoveringawiderangeoftopics,fromecologicaltheory,tobioinformatics,tolinguistics,suchas“AnalysisofPhylogeneticsandEvolutionwithR”byE.Paradis(UseRSeries,Springer,ISBN:0-387-32914-5).Iamwritingonewhichisaprimerinecologicaltheory.12CHAPTER1.ABRIEFINTRODUCTION1.2OverviewofRSisaquantitativeprogrammingenvironmentdevelopedatAT&TBellLabsinthe1970’s.S-Pluswasbeguninthe1980’s,andRwasbeguninthe1990’sbyRobertGentlemanandRossIhakaoftheStatisticsDepartmentoftheUniversityofAuckland.Nearly20seniorstatisticiansprovidethecoredevelopmentgroupoftheRlanguage,includingtheprimarydeveloperoftheoriginalS
本文标题:R for Statistics, By Example A Workshop for the Ec
链接地址:https://www.777doc.com/doc-1909035 .html