ChangeinProportionofRHPPAbyYearIbeginbylookingatthenumberofPlateAppearancesPAagainstlefthandedpitcherLHPversusrighthandedpitchersRHPoverthe63yearsinthisdataframeI28rstcreateacolumnwiththeyearThenI28 ID: 867904
Download Pdf The PPT/PDF document "BatterHandednessProjectHerbWilsonContent..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1 BatterHandednessProject-HerbWilsonConten
BatterHandednessProject-HerbWilsonContentsIntroduction1DataUpload1JoinwithLahmandatabase1ChangeinProportionofRHPPAbyYear2MLB-widedierencesinBAagainstLHPvs.RHP2EquilibrationofBattingAverage4Individualvariationinsplits4LogisticregressionusingBattingAveragesplits.7LogisticregressionsusingweightedOn-baseAverage(wOBA)11SummaryofResults17IntroductionThisprojectisanexplorationofbatterperformanceagainstlike-handedandopposite-handedpitchers.Wehavelongknownthat,collectively,battershavehigherbattingaveragesagainstopposite-handedpitchers.Dierencesinperformanceagainstleft-handedversusright-han
2 dedpitcherswillbereferredtoassplits.Theg
dedpitcherswillbereferredtoassplits.Thegeneralityofsplitsfavoringopposite-handedpitchersmasksvariabilityinthemagnitudeofbattingsplitsamongbattersandvariabilityinsplitsforasingleplayeramongseasons.Inthiscontribution,Itesttheadequacyofsplitvaluesinpredictingbatterhandednessandthenexamineindividualvariabilitytoexploresomeofthenuancesoftherelationships.ThedatausedprimarilycomefromRetrosheeteventsdatawiththeLahmandatasetbeingusedforsomebiographicalinformationsuchasfullname.IusedtheRprogramminglanguageforallstatisticaltestingandforthecreationofthegraphics.Acopyofthecodeisavailableonrequestbyconta
3 ctingmeatwhwilson@colby.eduDataUploadThe
ctingmeatwhwilson@colby.eduDataUploadTheRetrosheeteventsdataaregivenbyyear.Therststepintheanalysisistouploaddataframesforeachyear,thenusetherbindfunctiontostitchdatasetstogethertomakeadataframeandusethefunctioncolnamestoaddcolumnnames.Forthisstudy,Icombinedthedatafrom1955until2017,yieldingadataframewithnearly10millionrows.JoinwithLahmandatabaseNextIusetheLahmanMasterdatabasetogetrstandlastnamesofplayersusingtheleft_joinfunctiononRetro_IDnumber.Ithenpastethelastnamesandrstnamestogethertogetasingleeldforplayername.Finally,IlteroutjoinedMastercolumnsIdonotneed.1 Change
4 inProportionofRHPPAbyYearIbeginbylooking
inProportionofRHPPAbyYearIbeginbylookingatthenumberofPlateAppearances(PA)againstleft-handedpitcher(LHP)versusright-handedpitchers(RHP)overthe63yearsinthisdataframe.Irstcreateacolumnwiththeyear.Then,Ilteroutanyeventsthatdonotpertaintothebatter(e.g.,stolenbase,passedballorwildpitchwhilebatting)tocreateaPAcolumn.Switch-hitterswereremovedfromtheanalysis. MLB-widedierencesinBAagainstLHPvs.RHPInowexaminethemagnitudeofbattersplitsagainstLHPandRHPforeachyearofthestudy.IconsiderLHPrstandthenRHP.HerearethemeanbattersplitsbyyearagainstLHP.2 HerearethemeanbattersplitsbyyearagainstRH
5 P.3 EquilibrationofBattingAverageToexami
P.3 EquilibrationofBattingAverageToexamineindividualvariabilityinsplits,IneedtoconsideronlyplayerswithaminimumnumberofABsagainstLHPandRHPinaseasontoavoidbiasedBattingAveragesbecauseoflowsamplesize.AsurveyofsomerandomlychosenplaysindicatesthatBA,BAagainstLHPandBAagainstRHPbegintostabilizeafter100AB.Therefore,Irequirethatallbattersmusthaveatleast100ABsagainstLHPand100ABsagainstRHPtobeincludedinananalysis.IndividualvariationinsplitsThenextthreehistogramsshowthedistributionofLHbattersplitsagainstLHPandRHPandRHbattersplitsagainstLHPandRHP.Irandomlychosethreeseasonstopresent.Aclearpatternisthatth
6 eproportionofLHbatterswithoppositesplits
eproportionofLHbatterswithoppositesplits(higherBAagainstLHP)islowerthantheproportionofRHbatterswithoppositesplits.##Joining,by="batter_RetroID"4 ##Joining,by="batter_RetroID"5 ##Joining,by="batter_RetroID"6 LogisticregressionusingBattingAveragesplits.##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####Coefficients:##(Intercept)lhp_rhp##1.56128.355####DegreesofFreedom:152Total(i.e.Null);151Residual##NullDeviance:162.1##ResidualDeviance:126AIC:130####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####DevianceResiduals:#
7 #Min1QMedian3QMax##-2.66040.12440.42480.
#Min1QMedian3QMax##-2.66040.12440.42480.63061.9995####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)1.56130.25646.0901.13e-09***##lhp_rhp28.35555.78604.9019.55e-07***7 ##---##Signif.codes:0'***'0.001'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:162.09on152degreesoffreedom##Residualdeviance:126.03on151degreesoffreedom##AIC:130.03####NumberofFisherScoringiterations:5 ##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####Coefficients:##(Intercept)lhp_rhp##0.92817.282####Degreeso
8 fFreedom:155Total(i.e.Null);154Residual#
fFreedom:155Total(i.e.Null);154Residual##NullDeviance:192.6##ResidualDeviance:167.8AIC:171.8####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)##8 ##DevianceResiduals:##Min1QMedian3QMax##-2.2596-0.96710.59510.79151.5595####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)0.92800.19584.7392.14e-06***##lhp_rhp17.28243.86434.4727.74e-06***##---##Signif.codes:0'***'0.001'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:192.58on155degreesoffreedom##Residualdeviance:167.77on154degreesoffreedom##AIC:171.77####Numbero
9 fFisherScoringiterations:4 ##Joining,by=
fFisherScoringiterations:4 ##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####Coefficients:##(Intercept)lhp_rhp##1.59640.488##9 ##DegreesofFreedom:113Total(i.e.Null);112Residual##NullDeviance:119.9##ResidualDeviance:80.07AIC:84.07####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####DevianceResiduals:##Min1QMedian3QMax##-3.008750.076910.309800.542841.63588####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)1.59580.32364.9318.18e-07***##lhp_rhp40.48798.56434.7282.27e-06***##---##Signif.codes:0'***'0
10 .001'**'0.01'*'0.05'.'0.1''1####(Dispers
.001'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:119.932on113degreesoffreedom##Residualdeviance:80.072on112degreesoffreedom##AIC:84.072####NumberofFisherScoringiterations:6 10 LogisticregressionsusingweightedOn-baseAverage(wOBA)BattingAverageisarathercoarsemeasureofbattingperformance.Icalculatedweightedon-baseaveragesforallplayers.wOBAgivesamorenuancedassessmentofbattingperformancebyincorporatingwalksandpower.Iuselogisticregressiononthesameyearsanalyzedabove(1970,1999,1961)withbattingaveragesplitstocomparethestrengthofthemodels.LogisticRegress
11 ionforwOBAsplitsforthe1970MLBseason##Joi
ionforwOBAsplitsforthe1970MLBseason##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####Coefficients:##(Intercept)lhp_rhp##1.56128.355####DegreesofFreedom:152Total(i.e.Null);151Residual##NullDeviance:162.1##ResidualDeviance:126AIC:130####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####DevianceResiduals:##Min1QMedian3QMax##-2.66040.12440.42480.63061.9995####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)1.56130.25646.0901.13e-09***##lhp_rhp28.35555.78604.9019.55e-07***##---##Signif.codes:0'***'0.00
12 1'**'0.01'*'0.05'.'0.1''1####(Dispersion
1'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:162.09on152degreesoffreedom##Residualdeviance:126.03on151degreesoffreedom##AIC:130.03####NumberofFisherScoringiterations:511 LogisticRegressionforwOBAsplitsforthe1999MLBseason12 ##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####Coefficients:##(Intercept)lhp_rhp##0.92817.282####DegreesofFreedom:155Total(i.e.Null);154Residual##NullDeviance:192.6##ResidualDeviance:167.8AIC:171.8####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_split
13 s)####DevianceResiduals:##Min1QMedian3QM
s)####DevianceResiduals:##Min1QMedian3QMax##-2.2596-0.96710.59510.79151.5595####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)0.92800.19584.7392.14e-06***##lhp_rhp17.28243.86434.4727.74e-06***##---##Signif.codes:0'***'0.001'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:192.58on155degreesoffreedom##Residualdeviance:167.77on154degreesoffreedom##AIC:171.77####NumberofFisherScoringiterations:413 LogisticRegressionforwOBAsplitsforthe1961MLBseason14 ##Joining,by="batter_RetroID"####Call:glm(formula=bat_code~lhp_rhp,family=binomial,
14 data=full_splits)####Coefficients:##(Int
data=full_splits)####Coefficients:##(Intercept)lhp_rhp##1.59640.488####DegreesofFreedom:113Total(i.e.Null);112Residual##NullDeviance:119.9##ResidualDeviance:80.07AIC:84.07####Call:##glm(formula=bat_code~lhp_rhp,family=binomial,data=full_splits)####DevianceResiduals:##Min1QMedian3QMax##-3.008750.076910.309800.542841.63588####Coefficients:##EstimateStd.ErrorzvaluePr(|z|)##(Intercept)1.59580.32364.9318.18e-07***##lhp_rhp40.48798.56434.7282.27e-06***##---##Signif.codes:0'***'0.001'**'0.01'*'0.05'.'0.1''1####(Dispersionparameterforbinomialfamilytakentobe1)####Nulldeviance:119.932on113deg
15 reesoffreedom##Residualdeviance:80.072on
reesoffreedom##Residualdeviance:80.072on112degreesoffreedom##AIC:84.072####NumberofFisherScoringiterations:615 16 SummaryofResults1)MLBbattersfaceright-handedpitchersmorethantwiceasoftenasleft-handedpitchers.2)Averagebattingsplitshavevariedaroundanequilibriumvalueovertheperiod1955-2017forleft-handedbatters.Weseeadecreaseinaveragesplitsoverthepost20yearsforright-handedbatters.Thereisenoughvariationtonecessitateconsiderationofindividualseasonsratherthancombiningallthedata.3)Attheindividuallevel,asmallerproportionofleft-handedbattersareoppositehitters(hittingLHPbetterthanRHP)comparedtothepropo
16 rtionofright-handedbatterswhoareopposite
rtionofright-handedbatterswhoareoppositehitters(hittingRHPbetterthanLHP).GreaterexperienceagainstRHPmayexplainthispatternforright-handedbatters.4)Logisticregression,atechniquetopredictbinaryoutcomes(inthiscase,left-handedorright-handedbatter),isappliedtoeachofthe63seasons,testingtheabilityofBAsplitstopredicthandednessofabatter.Ineverycase,thelogisticregressionwasstatisticallysignicant(p0.05).However,theregressionsshowedaconsistentasymmetry.Evensplits(BAversusLHP=BAversusRHP)predictsaright-handedbatter.Thisshiftintheregressioncurveisexplainedbythedearthofoppositeleft-handedbatters.5)Top
17 rovideamoregranularanalysis,Iperformedlo
rovideamoregranularanalysis,Iperformedlogisticregressionsoneachofthe63seasonsusingsplitsinweightedOn-baseAverage(wOBA).Again,eachofthe63regressionswasstatisticallysignicant.ComparisonoftheAICvalues(AkaikeInformationCriterion)betweentheBAandwOBAregressionsconsistentlyshowedwOBAprovidedabettert(lowerAICvalues).6)Sincebattersareexposedtoleft-handedpitcherslessoftenthanright-handedpitchers,right-handedbattersgetmorepracticeagainstsame-handedpitchingthanleft-handedbatters.Thisresultmayexplainthepaucityofleft-handedbatterswithoppositesplitsandthegreaterleft-rightsplitsforleft-handedbatt