You are on page 1of 7

Perform statistical and engineering analysis with the Analysis ToolPak

Page 1 of 7

Excel > Analyzing data > What-if analysis

Perform statistical and engineering analysis with the Analysis ToolPak


ShowAll Ifyouneedtodevelopcomplexstatisticalorengineeringanalyses,youcansavestepsandtimebyusingthe AnalysisToolPak.Youprovidethedataandparametersforeachanalysis,andthetoolusestheappropriate statisticalorengineeringmacrofunctionstocalculateanddisplaytheresultsinanoutputtable.Sometools generatechartsinadditiontooutputtables. TheAnalysisToolPakincludesthetoolsdescribedbelow.Toaccessthesetools,clickData Analysisinthe AnalysisgroupontheDatatab.IftheData Analysiscommandisnotavailable,youneedtoloadtheAnalysis ToolPakadd-inprogram. LoadtheAnalysisToolPak 1. ClicktheFiletab,clickOptions,andthenclicktheAdd-Inscategory. 2. IntheManagebox,selectExcel Add-insandthenclickGo. 3. IntheAdd-Ins availablebox,selecttheAnalysis ToolPakcheckbox,andthenclickOK. TipIfAnalysis ToolPakisnotlistedintheAdd-Ins availablebox,clickBrowsetolocateit. IfyouarepromptedthattheAnalysisToolPakisnotcurrentlyinstalledonyourcomputer,clickYes toinstallit.
NOTE ToincludeVisualBasicforApplication(VBA)functionsfortheAnalysisToolPak,youcanloadthe

AnalysisToolPak-VBAAdd-inthesamewaythatyouloadtheAnalysisToolPak.IntheAdd-ins availablebox, selecttheAnalysis ToolPak - VBAcheckbox. Foradescriptionofeachtool,clickonatoolnameinthefollowinglist. Anova TheAnovaanalysistoolsprovidedifferenttypesofvarianceanalysis.Thetoolthatyoushouldusedependson thenumberoffactorsandthenumberofsamplesthatyouhavefromthepopulationsthatyouwanttotest.

Anova: Single Factor


Thistoolperformsasimpleanalysisofvarianceondatafortwoormoresamples.Theanalysisprovidesatest ofthehypothesisthateachsampleisdrawnfromthesameunderlyingprobabilitydistributionagainstthe alternativehypothesisthatunderlyingprobabilitydistributionsarenotthesameforallsamples.Ifthereareonly twosamples,youcanusetheworksheetfunctionTTEST.Withmorethantwosamples,thereisnoconvenient generalizationofTTEST,andtheSingleFactorAnovamodelcanbecalleduponinstead.

Anova: Two-Factor with Replication

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 2 of 7

Thisanalysistoolisusefulwhendatacanbeclassifiedalongtwodifferentdimensions.Forexample,inan experimenttomeasuretheheightofplants,theplantsmaybegivendifferentbrandsoffertilizer(forexample,A, B,C)andmightalsobekeptatdifferenttemperatures(forexample,low,high).Foreachofthesixpossiblepairs of{fertilizer,temperature},wehaveanequalnumberofobservationsofplantheight.UsingthisAnovatool,we cantest: Whethertheheightsofplantsforthedifferentfertilizerbrandsaredrawnfromthesameunderlying population.Temperaturesareignoredforthisanalysis. Whethertheheightsofplantsforthedifferenttemperaturelevelsaredrawnfromthesameunderlying population.Fertilizerbrandsareignoredforthisanalysis. Whetherhavingaccountedfortheeffectsofdifferencesbetweenfertilizerbrandsfoundinthefirstbulletedpoint anddifferencesintemperaturesfoundinthesecondbulletedpoint,thesixsamplesrepresentingallpairsof {fertilizer,temperature}valuesaredrawnfromthesamepopulation.Thealternativehypothesisisthatthereare effectsduetospecific{fertilizer,temperature}pairsoverandabovethedifferencesthatarebasedonfertilizer aloneorontemperaturealone.

Anova: Two-Factor Without Replication


ThisanalysistoolisusefulwhendataisclassifiedontwodifferentdimensionsasintheTwo-FactorcaseWith Replication.However,forthistoolitisassumedthatthereisonlyasingleobservationforeachpair(for example,each{fertilizer,temperature}pairintheprecedingexample). Correlation TheCORRELandPEARSONworksheetfunctionsbothcalculatethecorrelationcoefficientbetweentwo measurementvariableswhenmeasurementsoneachvariableareobservedforeachofNsubjects.(Any missingobservationforanysubjectcausesthatsubjecttobeignoredintheanalysis.)TheCorrelationanalysis toolisparticularlyusefulwhentherearemorethantwomeasurementvariablesforeachofNsubjects.It providesanoutputtable,acorrelationmatrix,thatshowsthevalueofCORREL(orPEARSON)appliedtoeach possiblepairofmeasurementvariables. Thecorrelationcoefficient,likethecovariance,isameasureoftheextenttowhichtwomeasurementvariables "varytogether."Unlikethecovariance,thecorrelationcoefficientisscaledsothatitsvalueisindependentofthe unitsinwhichthetwomeasurementvariablesareexpressed.(Forexample,ifthetwomeasurementvariables areweightandheight,thevalueofthecorrelationcoefficientisunchangedifweightisconvertedfrompoundsto kilograms.)Thevalueofanycorrelationcoefficientmustbebetween-1and+1inclusive.

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 3 of 7

Youcanusethecorrelationanalysistooltoexamineeachpairofmeasurementvariablestodeterminewhether thetwomeasurementvariablestendtomovetogetherthatis,whetherlargevaluesofonevariabletendtobe associatedwithlargevaluesoftheother(positivecorrelation),whethersmallvaluesofonevariabletendtobe associatedwithlargevaluesoftheother(negativecorrelation),orwhethervaluesofbothvariablestendtobe unrelated(correlationnear0(zero)). Covariance TheCorrelationandCovariancetoolscanbothbeusedinthesamesetting,whenyouhaveNdifferent measurementvariablesobservedonasetofindividuals.TheCorrelationandCovariancetoolseachgivean outputtable,amatrix,thatshowsthecorrelationcoefficientorcovariance,respectively,betweeneachpairof measurementvariables.Thedifferenceisthatcorrelationcoefficientsarescaledtoliebetween-1and+1 inclusive.Correspondingcovariancesarenotscaled.Boththecorrelationcoefficientandthecovarianceare measuresoftheextenttowhichtwovariables"varytogether." TheCovariancetoolcomputesthevalueoftheworksheetfunctionCOVARforeachpairofmeasurement variables.(DirectuseofCOVARratherthantheCovariancetoolisareasonablealternativewhenthereareonly twomeasurementvariables,thatis,N=2.)TheentryonthediagonaloftheCovariancetool'soutputtableinrow i,columniisthecovarianceofthei-thmeasurementvariablewithitself.Thisisjustthepopulationvariancefor thatvariable,ascalculatedbytheworksheetfunctionVARP. YoucanusetheCovariancetooltoexamineeachpairofmeasurementvariablestodeterminewhetherthetwo measurementvariablestendtomovetogetherthatis,whetherlargevaluesofonevariabletendtobe associatedwithlargevaluesoftheother(positivecovariance),whethersmallvaluesofonevariabletendtobe associatedwithlargevaluesoftheother(negativecovariance),orwhethervaluesofbothvariablestendtobe unrelated(covariancenear0(zero)). DescriptiveStatistics TheDescriptiveStatisticsanalysistoolgeneratesareportofunivariatestatisticsfordataintheinputrange, providinginformationaboutthecentraltendencyandvariabilityofyourdata. ExponentialSmoothing TheExponentialSmoothinganalysistoolpredictsavaluethatisbasedontheforecastforthepriorperiod, adjustedfortheerrorinthatpriorforecast.Thetoolusesthesmoothingconstanta,themagnitudeofwhich determineshowstronglytheforecastsrespondtoerrorsinthepriorforecast.
NOTE Valuesof0.2to0.3arereasonablesmoothingconstants.Thesevaluesindicatethatthecurrent

forecastshouldbeadjusted20percentto30percentforerrorinthepriorforecast.Largerconstantsyielda fasterresponsebutcanproduceerraticprojections.Smallerconstantscanresultinlonglagsforforecast values. F-TestTwo-SampleforVariances TheF-TestTwo-SampleforVariancesanalysistoolperformsatwo-sampleF-testtocomparetwopopulation variances. Forexample,youcanusetheF-Testtoolonsamplesoftimesinaswimmeetforeachoftwoteams.Thetool

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 4 of 7

providestheresultofatestofthenullhypothesisthatthesetwosamplescomefromdistributionswithequal variances,againstthealternativethatthevariancesarenotequalintheunderlyingdistributions. ThetoolcalculatesthevaluefofanF-statistic(orF-ratio).Avalueoffcloseto1providesevidencethatthe underlyingpopulationvariancesareequal.Intheoutputtable,iff<1"P(F<=f)one-tail"givestheprobabilityof observingavalueoftheF-statisticlessthanfwhenpopulationvariancesareequal,and"FCriticalone-tail" givesthecriticalvaluelessthan1forthechosensignificancelevel,Alpha.Iff>1,"P(F<=f)one-tail"givesthe probabilityofobservingavalueoftheF-statisticgreaterthanfwhenpopulationvariancesareequal,and"F Criticalone-tail"givesthecriticalvaluegreaterthan1forAlpha. FourierAnalysis TheFourierAnalysistoolsolvesproblemsinlinearsystemsandanalyzesperiodicdatabyusingtheFast FourierTransform(FFT)methodtotransformdata.Thistoolalsosupportsinversetransformations,inwhichthe inverseoftransformeddatareturnstheoriginaldata.

Histogram TheHistogramanalysistoolcalculatesindividualandcumulativefrequenciesforacellrangeofdataanddata bins.Thistoolgeneratesdataforthenumberofoccurrencesofavalueinadataset. Forexample,inaclassof20students,youcandeterminethedistributionofscoresinletter-gradecategories.A histogramtablepresentstheletter-gradeboundariesandthenumberofscoresbetweenthelowestboundand thecurrentbound.Thesinglemost-frequentscoreisthemodeofthedata. MovingAverage TheMovingAverageanalysistoolprojectsvaluesintheforecastperiod,basedontheaveragevalueofthe variableoveraspecificnumberofprecedingperiods.Amovingaverageprovidestrendinformationthatasimple averageofallhistoricaldatawouldmask.Usethistooltoforecastsales,inventory,orothertrends.Each forecastvalueisbasedonthefollowingformula.

where: Nisthenumberofpriorperiodstoincludeinthemovingaverage

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 5 of 7

Ajistheactualvalueattimej Fjistheforecastedvalueattimej RandomNumberGeneration TheRandomNumberGenerationanalysistoolfillsarangewithindependentrandomnumbersthataredrawn fromoneofseveraldistributions.Youcancharacterizethesubjectsinapopulationwithaprobabilitydistribution. Forexample,youcanuseanormaldistributiontocharacterizethepopulationofindividuals'heights,oryoucan useaBernoullidistributionoftwopossibleoutcomestocharacterizethepopulationofcoin-flipresults. RankandPercentile TheRankandPercentileanalysistoolproducesatablethatcontainstheordinalandpercentagerankofeach valueinadataset.Youcananalyzetherelativestandingofvaluesinadataset.Thistoolusestheworksheet functionsRANKandPERCENTRANK.RANKdoesnotaccountfortiedvalues.Ifyouwanttoaccountfortied values,usetheworksheetfunctionRANKtogetherwiththecorrectionfactorthatissuggestedintheHelpfilefor RANK. Regression TheRegressionanalysistoolperformslinearregressionanalysisbyusingthe"leastsquares"methodtofita linethroughasetofobservations.Youcananalyzehowasingledependentvariableisaffectedbythevaluesof oneormoreindependentvariables.Forexample,youcananalyzehowanathlete'sperformanceisaffectedby suchfactorsasage,height,andweight.Youcanapportionsharesintheperformancemeasuretoeachofthese threefactors,basedonasetofperformancedata,andthenusetheresultstopredicttheperformanceofanew, untestedathlete. TheRegressiontoolusestheworksheetfunctionLINEST. Sampling TheSamplinganalysistoolcreatesasamplefromapopulationbytreatingtheinputrangeasapopulation. Whenthepopulationistoolargetoprocessorchart,youcanusearepresentativesample.Youcanalsocreate asamplethatcontainsonlythevaluesfromaparticularpartofacycleifyoubelievethattheinputdatais periodic.Forexample,iftheinputrangecontainsquarterlysalesfigures,samplingwithaperiodicrateoffour placesthevaluesfromthesamequarterintheoutputrange. t-Test TheTwo-Samplet-Testanalysistoolstestforequalityofthepopulationmeansthatunderlieeachsample.The threetoolsemploydifferentassumptions:thatthepopulationvariancesareequal,thatthepopulationvariances arenotequal,andthatthetwosamplesrepresentbefore-treatmentandafter-treatmentobservationsonthe samesubjects. Forallthreetoolsbelow,at-Statisticvalue,t,iscomputedandshownas"tStat"intheoutputtables.Depending onthedata,thisvalue,t,canbenegativeornonnegative.Undertheassumptionofequalunderlyingpopulation means,ift<0,"P(T<=t)one-tail"givestheprobabilitythatavalueofthet-Statisticwouldbeobservedthatis morenegativethant.Ift>=0,"P(T<=t)one-tail"givestheprobabilitythatavalueofthet-Statisticwouldbe observedthatismorepositivethant."tCriticalone-tail"givesthecutoffvalue,sothattheprobabilityof

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 6 of 7

observingavalueofthet-Statisticgreaterthanorequalto"tCriticalone-tail"isAlpha. "P(T<=t)two-tail"givestheprobabilitythatavalueofthet-Statisticwouldbeobservedthatislargerinabsolute valuethant."PCriticaltwo-tail"givesthecutoffvalue,sothattheprobabilityofanobservedt-Statisticlargerin absolutevaluethan"PCriticaltwo-tail"isAlpha.

t-Test: Paired Two Sample For Means


Youcanuseapairedtestwhenthereisanaturalpairingofobservationsinthesamples,suchaswhena samplegroupistestedtwicebeforeandafteranexperiment.Thisanalysistoolanditsformulaperforma pairedtwo-sampleStudent'st-Testtodeterminewhetherobservationsthataretakenbeforeatreatmentand observationstakenafteratreatmentarelikelytohavecomefromdistributionswithequalpopulationmeans. Thist-Testformdoesnotassumethatthevariancesofbothpopulationsareequal.
NOTE Amongtheresultsthataregeneratedbythistoolispooledvariance,anaccumulatedmeasureofthe

spreadofdataaboutthemean,whichisderivedfromthefollowingformula.

t-Test: Two-Sample Assuming Equal Variances


Thisanalysistoolperformsatwo-samplestudent'st-Test.Thist-Testformassumesthatthetwodatasetscame fromdistributionswiththesamevariances.Itisreferredtoasahomoscedastict-Test.Youcanusethist-Testto determinewhetherthetwosamplesarelikelytohavecomefromdistributionswithequalpopulationmeans.

t-Test: Two-Sample Assuming Unequal Variances


Thisanalysistoolperformsatwo-samplestudent'st-Test.Thist-Testformassumesthatthetwodatasetscame fromdistributionswithunequalvariances.Itisreferredtoasaheteroscedastict-Test.Aswiththepreceding EqualVariancescase,youcanusethist-Testtodeterminewhetherthetwosamplesarelikelytohavecome fromdistributionswithequalpopulationmeans.Usethistestwhentherearedistinctsubjectsinthetwo samples.UsethePairedtest,describedinthefollowexample,whenthereisasinglesetofsubjectsandthetwo samplesrepresentmeasurementsforeachsubjectbeforeandafteratreatment. Thefollowingformulaisusedtodeterminethestatisticvaluet.

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

Perform statistical and engineering analysis with the Analysis ToolPak

Page 7 of 7

Thefollowingformulaisusedtocalculatethedegreesoffreedom,df.Becausetheresultofthecalculationis usuallynotaninteger,thevalueofdfisroundedtothenearestintegertoobtainacriticalvaluefromthettable. TheExcelworksheetfunctionTTESTusesthecalculateddfvaluewithoutrounding,becauseitispossibleto computeavalueforTTESTwithanonintegerdf.Becauseofthesedifferentapproachestodeterminingthe degreesoffreedom,theresultsofTTESTandthist-TesttoolwilldifferintheUnequalVariancescase.

z-Test Thez-Test:TwoSampleforMeansanalysistoolperformsatwosamplez-Testformeanswithknownvariances. Thistoolisusedtotestthenullhypothesisthatthereisnodifferencebetweentwopopulationmeansagainst eitherone-sidedortwo-sidedalternativehypotheses.Ifvariancesarenotknown,theworksheetfunctionZTEST shouldbeusedinstead. Whenyouusethez-Testtool,becarefultounderstandtheoutput."P(Z<=z)one-tail"isreallyP(Z>=ABS(z)), theprobabilityofaz-valuefurtherfrom0inthesamedirectionastheobservedzvaluewhenthereisno differencebetweenthepopulationmeans."P(Z<=z)two-tail"isreallyP(Z>=ABS(z)orZ<=-ABS(z)),the probabilityofaz-valuefurtherfrom0ineitherdirectionthantheobservedz-valuewhenthereisnodifference betweenthepopulationmeans.Thetwo-tailedresultisjusttheone-tailedresultmultipliedby2.Thez-Testtool canalsobeusedforthecasewherethenullhypothesisisthatthereisaspecificnonzerovalueforthe differencebetweenthetwopopulationmeans.Forexample,youcanusethistesttodeterminedifferences betweentheperformancesoftwocarmodels. NoteThedataanalysisfunctionscanbeusedononlyoneworksheetatatime.Whenyouperformdata analysisongroupedworksheets,resultswillappearonthefirstworksheetandemptyformattedtableswill appearontheremainingworksheets.Toperformdataanalysisontheremainderoftheworksheets,recalculate theanalysistoolforeachworksheet.

ms-help://MS.EXCEL.14.1033/EXCEL/content/HP10342762.htm

30/12/2011

You might also like