ebook img

Two-Way Analysis of Variance: Statistical Tests and Graphics Using R PDF

148 Pages·2012·1.04 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 Two-Way Analysis of Variance: Statistical Tests and Graphics Using R

SpringerBriefs in Statistics Forfurthervolumes: http://www.springer.com/series/8921 Thomas W. MacFarland Two-Way Analysis of Variance Statistical Tests and Graphics Using R 123 ThomasW.MacFarland OfficeforInstitutionalEffectiveness NovaSoutheasternUniversity FortLauderdale,FL,USA [email protected] ISSN2191-544X e-ISSN2191-5458 ISBN978-1-4614-2133-7 e-ISBN978-1-4614-2134-4 DOI10.1007/978-1-4614-2134-4 SpringerNewYorkDordrechtHeidelbergLondon LibraryofCongressControlNumber:2011943305 ©Thomas W. MacFarland 2012 Allrightsreserved.Thisworkmaynotbetranslatedorcopiedinwholeorinpartwithoutthewritten permission of the publisher (Springer Science+Business Media, LLC, 233 Spring Street, New York, NY10013, USA),except forbrief excerpts inconnection with reviews orscholarly analysis. Usein connectionwithanyformofinformationstorageandretrieval,electronicadaptation,computersoftware, orbysimilarordissimilarmethodologynowknownorhereafterdevelopedisforbidden. Theuseinthispublicationoftradenames,trademarks,servicemarks,andsimilarterms,eveniftheyare notidentifiedassuch,isnottobetakenasanexpressionofopinionastowhetherornottheyaresubject toproprietaryrights. Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) Contents 1 LearnRwithSampleLessonsinEd ucationandtheSocial Sciences,Health,andtheBiologicalSciences............................. 1 1.1 PurposeofTheseLessons .............................................. 1 1.2 BackgroundonR........................................................ 2 1.3 BackgroundonTwo-WayANOVA .................................... 2 1.4 OrganizationofTheseLessons......................................... 4 1.4.1 DataImportorDataEntry .................................... 4 1.4.2 DataOrganization............................................. 4 1.4.3 DisplaytheCodeBook ....................................... 5 1.4.4 ConductaVisualDataCheck................................. 5 1.4.5 DescriptiveAnalysisoftheData ............................. 5 1.5 DetailsoftheThreeSampleDatasets.................................. 6 1.5.1 Tab-SeparatedASCIIFile..................................... 6 1.5.2 FixedWidth–FixedColumnASCIIFile ..................... 6 1.5.3 Comma-SeparatedValuesASCIIFile........................ 6 2 Two-Way Analysis of Variance (ANOVA) Sample 1: ComparisonofScoresonaFinalExaminationbyTeaching MethodandbyStatusasaCommunityCollegeGraduate.............. 9 2.1 DataImportofa.txtTab-DelimitedDataFileintoR ................. 10 2.1.1 DataImportorDataEntry .................................... 11 2.2 OrganizetheDataandDisplaytheCodeBook........................ 11 2.3 ConductaVisualDataCheck .......................................... 15 2.3.1 SimplePlots ................................................... 15 2.3.2 HistogramoftheSummaryObjectVariable................. 16 2.3.3 Horizontal and Vertical Boxplots oftheSummaryObjectVariable.............................. 17 2.3.4 Sorted Dot Chart of the SummaryObject VariablebyBreakoutObjectVariables....................... 18 2.3.5 HistogramoftheSummaryObjectVariable byBreakoutObjectVariables................................. 19 v vi Contents 2.4 DescriptiveAnalysisoftheData....................................... 21 2.4.1 SummaryDescriptiveStatistics............................... 22 2.4.2 BreakoutDescriptiveStatistics ............................... 23 2.5 UseRforTwo-WayAnalysisofVariance(ANOVA)................. 25 2.5.1 Two-WayANOVA:aov()Function........................ 26 2.5.2 OutcometoSample1 ......................................... 27 3 Two-Way Analysis of Variance (ANOVA) Sample 2: Comparison of Systolic Blood Pressure Readings by Self-DeclaredSmoking Habits and by Self-Declared DrinkingHabits.............................................................. 31 3.1 Data Importof a .prnFixed Width–FixedColumn (e.g.,Space-Separated)FormatDataFileintoR ...................... 33 3.1.1 DataImportorDataEntry .................................... 35 3.2 OrganizetheDataandDisplaytheCodeBook........................ 37 3.3 ConductaVisualDataCheck .......................................... 44 3.3.1 SimplePlots ................................................... 44 3.3.2 HistogramoftheSummaryObjectVariable................. 45 3.3.3 Horizontal and Vertical Boxplots of the SummaryObjectVariable..................................... 47 3.3.4 HistogramoftheSummaryObjectVariable byBreakoutObjectVariables................................. 48 3.3.5 DensityPlotoftheSummaryObjectVariable byBreakoutObjectVariables................................. 50 3.3.6 Boxplotof the Summary Object Variable byBreakoutObjectVariables................................. 51 3.4 DescriptiveAnalysisoftheData....................................... 53 3.4.1 SummaryDescriptiveStatistics............................... 53 3.4.2 BreakoutDescriptiveStatistics ............................... 54 3.5 UseRforTwo-WayAnalysisofVariance(ANOVA)................. 60 3.5.1 Two-WayANOVA:aov()Function........................ 60 3.5.2 s20xPackage .................................................. 62 3.5.3 OutcometoSample2 ......................................... 63 4 Two-Way Analysis of Variance (ANOVA) Sample 3: ComparisonofLarvaeCountsbyAgChemFormulation andbyAgChemApplicationTime-of-Day................................ 69 4.1 DataImportofa.csvSpreadsheet-TypeDataFileintoR............. 71 4.1.1 DataImportorDataEntry .................................... 72 4.2 OrganizetheDataandDisplaytheCodeBook........................ 72 4.3 ConductaVisualDataCheck .......................................... 78 4.3.1 SimplePlots ................................................... 78 4.3.2 HistogramoftheSummaryObjectVariable................. 79 4.3.3 Horizontal and Vertical Boxplots oftheSummaryObjectVariable.............................. 84 4.3.4 ViolinPlotoftheSummaryObjectVariable................. 86 Contents vii 4.3.5 BeanplotoftheSummaryObjectVariable................... 88 4.3.6 Quantile–Quantile(Q–Q)PlotoftheSummary ObjectVariable................................................ 89 4.3.7 Sorted Dot Chart of the SummaryObject VariablebyBreakoutObjectVariables....................... 90 4.3.8 HistogramoftheSummaryObjectVariable byBreakoutObjectVariables................................. 91 4.3.9 DensityPlotoftheSummaryObjectVariable byBreakoutObjectVariables................................. 95 4.3.10 Boxplotof the Summary Object Variable byBreakoutObjectVariables................................. 97 4.3.11 HorizontalandVerticalBoxplotsoftheSummary ObjectVariablebyBreakoutObjectVariables............... 98 4.3.12 VerticalViolinPlotsoftheSummaryObject VariablebyBreakoutO bjectVariables....................... 100 4.3.13 Beanplotsofthe SummaryObjectVariable byBreakoutObjectVariables................................. 102 4.3.14 RepresentationofGroupMeansandConfidenceIntervals.. 103 4.3.15 PlotBreakoutObjectValuesonaContinuum oftheSummaryObjectVariable.............................. 106 4.4 DescriptiveAnalysisoftheData....................................... 114 4.4.1 SummaryDescriptiveStatistics............................... 115 4.4.2 BreakoutDescriptiveStatistics ............................... 117 4.4.3 ContingencyTables ........................................... 124 4.5 UseRforTwo-WayAnalysisofVariance(ANOVA)................. 126 4.5.1 Two-WayANOVA:aov()Function........................ 126 4.5.2 AdditionalRPackagesthatSupportTwo-WayANOVA.... 128 4.5.3 OutcometoSample3 ......................................... 130 4.5.4 ConsiderationoftheDatafromaNonparametric Perspective..................................................... 136 4.5.5 OptionalHousekeepingatEnd-of-Session................... 137 Chapter 1 Learn R with Sample Lessons in Education and the Social Sciences, Health, and the Biological Sciences Abstract R was developed in the early- to-mid 1990s and it has developed into a robust open source software environment,used with multiple operating systems for the organization, statistical analysis, and graphical presentation of data. As presentedin this chapter,this set of lessons providesan introductionto the use of R andemphasizesgoodprogrammingpracticesfordata importordata entry,data organization,developmentofadetailedcodebook,visualdatachecks,descriptive analyses,andselectedinferentialanalyses.Two-wayanalysisofvariance(ANOVA) is the selected inferential test emphasized in this set of lessons, given how two- way ANOVA is well-suited to investigations that examine factorial designs that modelcomplexreal-worldproblemswith practicalapplications.This chapter also introduces the multiple ways datasets are organized for use by R: tab-separated ASCII files, fixed width–fixed column ASCII files, and comma-separated values ASCIIfiles.Throughoutthesediscussions,graphicaldisplays,andotheractionsthat relatetoqualityassurancepracticesreceivecontinualreinforcement. 1.1 PurposeofTheseLessons This set of lessons has been developed to take advantage of R and the many featuresavailable throughthis extensiveand expandingopen source environment. Thepurposeofthissetoflessonsistoprovidedirectionalguidance,withgraphical reinforcement, for those who wish to use R to examine data, conduct statistical analyses,andpresentfindingsingraphicalformat. Along with instruction on the use of R and R syntax associated with Two- Way analysis of variance (ANOVA), these lessons will also reinforce the use of descriptivestatisticsandgraphicalfigures,tocomplementoutcomesfromtwo-way ANOVA. With attention to these lessons as well as other available resources, an interested studentor beginningresearcher should be able to use R to conductand graphicallydisplaysimpletocomplexstatisticalanalyses.TheRusercommunityis growing,forgoodreason.Rworks,Risfree,andRisfairlyeasytolearn. T.W.MacFarland,Two-WayAnalysisofVariance:StatisticalTestsandGraphics 1 UsingR,SpringerBriefsinStatistics1,DOI10.1007/978-1-4614-2134-4 1, ©Thomas W. MacFarland 2012

Description:
​In statistics, analysis of variance (ANOVA) is a collection of statistical models used to distinguish between an observed variance in a particular variable and its component parts. In its simplest form, ANOVA provides a statistical test of whether or not the means of several groups are all equal,
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.