Escolar Documentos
Profissional Documentos
Cultura Documentos
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
RealStatisticsUsingExcel
Everythingyouneedtodoreal
statisticalanalysisusingExcel
KolmogorovSmirnovTestforNormality
HypothesisTesting
Definition1:Letx1,,xnbeanorderedsamplewithx1xnanddefineSn(x)asfollows:
Now suppose that the sample comes from a population with cumulative distribution function F(x) and define
Dnasfollows:
Observation:ItcanbeshownthatDndoesntdependonF.SinceSn(x)dependsonthesamplechosen,Dn is a
randomvariable.OurobjectiveistouseDnasawayofestimatingF(x).
ThedistributionofDncanbecalculated(seeKolmogorovDistribution),butforourpurposesnowtheimportant
aspectofthisdistributionarethecriticalvalues.ThesecanbefoundintheKolmogorovSmirnovTable.
IfDn,isthecriticalvaluefromthetable,thenP(DnDn,)=1.Dn can be used to test the hypothesis that a
randomsamplecamefromapopulationwithaspecificdistributionfunctionF(x).If
thenthesampledataisagoodfitwithF(x).
AlsofromthedefinitionofDngivenabove,itfollowsthat
ThusSn(x)Dn,providesaconfidenceintervalforF(x)
Example1:Determinewhetherthedatarepresentedinthefollowingfrequencytableisnormallydistributed.
Figure1FrequencytableforExample1
Thismeansthat8elementshaveanxvaluelessthan100,25elementshaveanxvaluebetween101and200,etc.
Weneedtofindthemeanandstandarddeviationofthisdata.Sincethisisafrequencytable,wecantsimplyuse
Excels AVERAGE and STDEV functions. Instead we first use the midpoints of each interval and then use an
approachsimilartothatdescribedinFrequencyTablesasfollows:
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
1/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Figure2Calculatingmeanandstandarddeviationfordatainfrequencytable
Thus,themeanis481.4andthestandarddeviationis155.2.Wecannowbuildthetablethatallowsustocarryout
theKStest,namely:
Figure3KolmogorovSmirnovtestforExample1
Columns A and B contain the data from the original frequency table. Column C contains the corresponding
cumulativefrequencyvaluesandcolumnDsimplydividesthesevaluesbythesamplesize(n=1000)toyieldthe
cumulativedistributionfunctionSn(x)
ColumnEusesthemeanandstandarddeviationcalculatedpreviouslytostandardizethevaluesofxfromcolumn
A.E.g.theformulaincellE4is=STANDARDIZE(A4,N$5,N$10),wherecellN5containsthemeanandcellN10
containsthestandarddeviation.ColumnFusesthesestandardizedvaluestocalculatethecumulativedistribution
function values assuming that the original data is normally distributed. E.g. cell F4 contains the formula
=NORMSDIST(E4).FinallycolumnGcontainsthedifferencesbetweenthevaluesincolumnsDandF.E.g.cell
G4containstheformula=ABS(F4D4).Iftheoriginaldataisnormallydistributedthesedifferenceswillbezero.
NowDn=thelargestvalueincolumnG,whichinourcaseis0.0117.Ifthedataisnormallydistributedthenthe
criticalvalueDn,willbelargerthanDn.FromtheKolmogorovSmirnovTableweseethat
Dn,=D1000,.05=1.36/SQRT(1000)=0.043007
SinceDn=0.0117<0.043007=Dn,,weconcludethatthedataisagoodfitwiththenormaldistribution.
Example2:UsingtheKStest,determinewhetherthedatainExample1ofGraphical Tests for Normality and
Symmetryisnormallydistributed.
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
2/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Wefollowthesameprocedureasinthepreviousexampletoobtainthefollowingresults.Sincethefrequenciesare
all1,thisexampleshouldbeabiteasiertounderstand.
Figure4KStestfordatafromExample2
TheKolmogorovSmirnovTableshowsthatthecriticalvalueDn,=D15,.05=.338
Since Dn = 0.1874988 < 0.338 = Dn,, we conclude that the data is a reasonably good fit with the normal
distribution (more precisely that there is no significant difference between the data and data which is normally
distributed).NotethatisnotthesameconclusionwereachedfromlookingatthehistogramandQQplot.
RealStatisticsExcelFunction:ThefollowingfunctionisprovidedintheRealStatisticsResourcePack:
KSCRIT(n,,tails,h)=thecriticalvalueoftheKolmogorovSmirnovtestforasampleofsizen,forthegiven
valueofalpha(default=.05)andtails=1(onetail)or2(twotails,default),basedontheKSTable.Ifh=
TRUE(default)harmonicinterpolationisusedotherwiselinearinterpolationisused.
KSPROB(x,n,tails,iter)=anapproximatepvaluefortheKStestforvalueequaltoxforasampleofsizen
andtails=1(onetail)or2(twotails,default)basedonalinearinterpolationofthevaluesintheKolmogorov
SmirnovTable,usingiternumberofiterations(default=40).
NotethatthevaluesforintheKolmogorovSmirnovTablerangefrom.01to.2(fortails=2)and.005to.1for
tails=1.Ifthepvalueislessthan.01(tails=2)or.005(tails=1)thenthepvalueisgivenas0andifthepvalue
isgreaterthan.2(tails=2)or.1(tails=1)thenthepvalueisgivenas1.
ForExample2,KSCRIT(15,.05,2)=.338(thesameasgivenincellH21ofFigure4).Alsonotethatthepvalue=
KSPROB(H20,B21)=KSPROB(0.1874988,15)=1(meaningthatpvalue>.2),andsoonceagainwecantreject
thenullhypothesisthatthedataisnormallydistributed.
IfthevalueofDnhadbeen.35inExample2,thenDn=.35>.338=Dcrit,andsowewouldhaverejectedthenull
hypothesisthatthedataisnormallydistributed.Inthiscasewewouldhaveseenthatpvalue=KSPROB(.35,15)=
.0427,whichonceagainleadsustorejectthenullhypothesis.
KolmogorovDistribution
Asreferencedabove,theKolmogorovdistributioncanbeusefulinconductingtheKolmogorovSmirnovtest.Click
hereformoreinformationaboutthisdistribution,includingsomeusefulfunctionsprovidedbytheRealStatistics
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
3/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
ResourcePack.
LillieforsTest
When the population mean and standard deviation for the KolmogorovSmirnov Test is estimated from the
sample mean and standard deviation, as was done in Example 1 and 2, then the KolmogorovSmirnov
Tableyieldsresultsthataretooconservative.MoreaccurateresultscanbederivedfromtheLiilieforsTable as
describedintheLillieforsTestforNormality.
58ResponsestoKolmogorovSmirnovTestforNormality
adityagargsays:
April20,2016at2:15am
Sir,
woulduliketoprescribeanybookinwhichallthesetestscanbefound
Reply
Charlessays:
April22,2016at10:45am
Aditya,
Iwillbepublishingaseriesofbooksshortlywhichcoverthesetests.
Charles
Reply
adityagargsays:
May18,2016at9:54pm
WaitingforyourbooksPlzmakeitquick
Tillthenplzsuggestsomegoodliteratureforabovetests
Reply
Charlessays:
May19,2016at3:46pm
IthinkthatmywebsitehasaprettygoodexplanationoftheKolmogorovSmirnovTest.Youshould
alsolookatthefollowingwebpages:
OneSampleKolmogorovSmirnovTest
LillieforsTest
Charles
Reply
Ijeomasays:
April11,2016at1:15pm
DearCharles
IsitpossibletogetaconflictingresultwhentheexplorecommandandtheonesampleKSareusedtocheckthenormalityof
thesamedata?
Reply
Charlessays:
April12,2016at8:30am
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
4/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Idontknowwhatexplorecommandis.
Itisnotsurprisingthattwodifferenttestsfornormalitywillgivedifferentpvalues.
Charles
Reply
Robsays:
November14,2015at10:02am
Hi,
greatsiteIlearnfromitalot.
CanIpleaseask,howdidyoucalculateacolumnK?midptsq?
Thankyou.
Reply
Charlessays:
November14,2015at1:22pm
Rob,
CellK4containstheformula=I4^2,andsimilarlyfortheothercellsincolumnK.
Charles
Reply
Robsays:
November17,2015at3:08pm
ThankyouverymuchCharles.
IdontknowifIgetitright,aboutnumbersincolumnA(xvalues).
Letmeexplainonthisexample.
Ihavescaleoflonelinessandresultscanbe
1020lowloneliness
2030averageloneliness
3040highloneliness
soIcalculate:
datamidpfreqmidp^2
10201524225
20302532625
304035331225
So:
n:89
M:26,011
Msq:676,584
Sqsum/n:739,606
Varp:63,022
Var:63,738
Stdev:7,983
xfreqCumSnxZF(x)D
1524240,2701,3790,0840,186
2532560,6290,1270,4500,180
35338911,1260,8700,130
Dmax0,185
Dkrit0,144
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
5/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
0,185>0,144sodataisnotnormallydistributed.
Isthisrigtcalculatedornot?,IamnotsureaboutchoosingdataforcolumnA.
Reply
Charlessays:
November28,2015at4:48pm
Rob,
Ifyouassumethatthedataineachintervalisconcentratedatthemidpointthenthecalculationis
correct.Ihavetypicallyassumedthisforthecalculationofthemean,buthaveusedtherightend
pointoftheintervalsfortheKScalculation.Icanseeadvantageswithbothapproaches.
IsuggestthatinsteadofusingtheKStabletocalculatethecriticalvalueyouusetheLillieforsTable
instead.Itismoreaccuratefordeterminingwhetherdataisnormalwhenyouusethesamplemean
andstandarddeviation.Seethefollowingwebpage:
LillieforsTest
Charles
Reply
Issamsays:
November1,2015at1:33pm
DearSir,
Thankyouverymuch,Imlearningalotfromyourwebsite.
Unfortunately,mydatasetdosenotfitwithnormaldistribution.
IhaveverylargedataandIreadinthispaper(OpenAccess):Langlois,T.J.,Fitzpatrick,B.R.,Fairclough,D.V.,Wakefield,
C.B.,Hesp,S.A.,McLean,D.L.,Meeuwig,J.J.(2012).SimilaritiesbetweenLineFishingandBaitedStereoVideo
EstimationsofLengthFrequency:NovelApplicationofKernelDensityEstimates.PLoSONE,7(11),19.
doi:10.1371/journal.pone.0045973
WeusedMonteCarlosimulationstoovercomeuncertaintyregardingtheasymptoticdistributionsofKSteststatisticsunder
thenullhypothesis.
HowcanIdothesimulationinexcelsomydatacanfitwithnormaldistribution,soIcanruntheKStestformydata.
Thankyouverymuch
Reply
Issamsays:
November1,2015at5:36pm
IwanttodoKStowsampletest
Reply
Charlessays:
November3,2015at3:46pm
Seethefollowingwebpage
KolmogorovSmirnovTwoSampleTest.
harles
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
6/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Reply
Charlessays:
November3,2015at3:50pm
Sorry,butIdontunderstandyourquestion.Youdontdosimulationstomakedatafitadistribution.Ifyouknewthe
datawasnormallydistributedthenyouwouldntneedtoperformtheKStest.Pleaseclarifywhatyouaretryingtodo.
Charles
Reply
Edgarsays:
August27,2015at10:11pm
DearCharlesIappreciateyourcontributions.
Pleaseconsiderthefollowing,inyoursecondexampleyoustatethefollowing:
SinceDn=0.1874988<0.338=Dn,,weconcludethatthedataisareasonablygoodfitwiththenormaldistribution(more
preciselythatthereisnosignificantdifferencebetweenthedataanddatawhichisnormallydistributed).Notethatisnotthe
sameconclusionwereachedfromlookingatthehistogramandQQplot"
SothesameremainsforDn=0.1874988.338=Dcrit,andsowewouldhaverejectedthenullhypothesisthatthedatais
normallydistributed.Inthiscasewewouldhaveseenthatpvalue=KSPROB(.35,15)=.0427,whichonceagainleadsusto
rejectthenullhypothesis
Butifthe=0.01thenthecriticalvalueis0.404andDn=0.35<0.404=Dn,,
Then,shouldweconcludethatdataisnormallydistributed???
Illappreciateyourcomments,
Kindregards
Edgar
Reply
Charlessays:
September3,2015at5:04pm
Edgar,
Changingthevalueofalphafrom.05to.01,changesthevalueforDcrit,butdoesntchangethevalueofDn.Idont
seewheretheDn=0.35comesfrom?
ThenullhypothesisthatthedatacomesfromanormalpopulationcannotberejectedifDn<Dcrit.Charles
Reply
Brodysays:
August25,2015at5:21pm
Charles,thanks,butItoohaveaquestion.
MayIperformtheKStestontwosampleswithdifferentcountsornvalues?
Forexample,thereare7possiblecategories,andthereare3individualsamplesthatwilldistributewithinthose7categories
(dealingwithsediment,sieves,andweights).Ineedtocomparethissetofsamplestoanothersetofsamples,however,the
numberofsampleshereis7.So,2setsofsamples.Thefirst,has3samples,andthesecondhas7.Thereare7sievesizesor
categoriesintowhichthesamplesaredistributed.CanKStestberunonthem?
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
7/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Ifnot,thenwoulditbepermissibletotakethemeansofeachsample,thusgivingcongruencytothedata(samenvalues,but
withmeans),andusethenfromthesamplesize(n=10(3fromfirst,and7fromsecond)),ratherthanthemean(n=2)to
establishthecriticalvalue,orwouldIneedtousethenfromthemeansamplesizetoestablishtheCV?
Thanks,
Brody
Reply
Charlessays:
August26,2015at9:41am
Brody,
AlthoughIdontcompletelyunderstandyourdescription,youcanperformatwosampleKStestwithsamplesof
differentsizestodeterminewhetherthesesamplescomefrompopulationswiththesamedistributions.Seethe
followingwebpageformoredetails
TwoSampleKSTest
Charles
Reply
sathyapriyasays:
August19,2015at5:46am
howtoifindcumulativedistributionfunctionF(x)?
Reply
Charlessays:
August22,2015at10:17pm
Examples1and2onthereferencedwebpageexplainhowtocomputethecumulativedistributionfunctionF(x).
Charles
Reply
Gianmasays:
July2,2015at4:03pm
DearSir,
Thankyouforsharingthis.
Ihaveaquestion:whyinthefirstexamplewecalculatetheZscorewithx=100,200,etc.,butwithmeanandstandard
deviationcalculatedfromthemidpoints(150,250,etc.)?
ShouldntebecorrecttohavethemidpointsoftheintervalsincolumnAforZscorecalculation?
Bestregards,
Gianma
Reply
Charlessays:
July7,2015at8:01am
Gianma,
Probablyeitherapproachisacceptable,buthereIhaveusedtheendpointsofthevariousintervalswiththemeanand
stdevbasedonthemidpointoftheintervals.
Charles
Reply
Gianmasays:
July8,2015at2:07pm
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
8/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
DearCharles,
Sorryforinsisting,butitsnotanegligibledifference:usingthemidpointsoftheintervalsforcalculatingthe
Zscore,theresultingDnisequalto0.117>Dn,a,sotheoverallresultistheopposite(thedataisNOTagood
fitwiththenormaldistribution)
ConsideringthatthedefinitionofZis(Xiu)/S,whereuisthemeanoftheXvaluesandSistheirstdev,I
thinkthatonlythemidpointsoftheintervalsshouldbeused,ifuiscalculatedastheirmean.
Otherwise,wecanusetheendpointsoftheintervalsasXi,butinthiscasealsomeanandstdevshouldbe
calculatedonthesevalues,andnotonthemidpoints.
Doyouagree?
Reply
Charlessays:
July15,2015at4:43pm
Gianma,
Irealizethatdependingonthechoiceyoumakeyoumightcometoadifferentconclusion.Thisiswhy
itisimportanttoviewsignificancevaluessuchasalpha=.05notasabsolutethings.Infactifyouset
alpha=.05asyoursignificancevalue,anypvaluenear.05canbeviewedwithsomecaution.
Unfortunately,thisisthenatureofstatistics.Ifyougetapvalueof.0003youarefairlyconfidentof
yourresult(atleastasfarastypeIerrorisconcerned),butoftendependingonwhichtestyouchoose
touse(orwhichversionofatestyouuse),youmightgetdifferentoutcomes.
Charles
Reply
Gianmasays:
July24,2015at9:52am
DearSir,
Thankyouforyouranswer.Sincerely,Imnot100%convinced,butatleastthisdiscussion
forcedmetolookdeeperintothistopic,andreviewsomeforgottenpageofstatistics!
Bestregards,
Gianmarco
Avisays:
June24,2015at3:39am
Greatarticle.IknowunderstandhowyoucalculatethePvaluefortheKStest.Thankssomuch.HoweverwhenItryto
replicateinexcel,theNORMDISTfunctiondoesnotreturnthesamevalues.Istheresomethingdifferentyouaredoing,as
excelisaskingmeforthemeanandstDev(whichiinput)butdoesnotreturnthesamevaluesyouhaveinyoursheet
manythanks
Reply
Charlessays:
June24,2015at7:44am
Avi,
IdontseeanyreferencetotheNORMDISTfunctiononthereferencedwebpage.Thereisareferenceto
=NORMSDIST(E4(,whichisthestandardnormaldistributionfunction(mean=0andstandarddeviation=1).
Charles
Reply
abhijitborasays:
May12,2015at10:43am
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
9/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
HelloSir,
IamsearchingforKolmogorovSmirnovTesttwosampledatainexcel.Canyouhelpme?
Reply
Charlessays:
May13,2015at6:51am
SeethewebpageTwoSampleKolmogorovSmirnovTest
Charles
Reply
Svensays:
May9,2015at5:56pm
Charles,
withyourtoolitispossibletousetheShapiroWilkTestonatimeseriesandgetabesidesthepvalueayesornoforthe
normalassumption.ThereforeIcandothistestformultipleseriesparallelwithonlyoneformulawhichisverynice.
Istherealsoapossibilitytotestforotherdistributions(Poisson,StutteringPoisson,Gamma,NegativeBinomial,etc.)for
multipleseries(KSTestorChiSquareTest),soIcanseewhichdistributionwouldfitbest?
Sven
Reply
Charlessays:
May11,2015at11:20am
Sven,
IhaventyetimplementedsoftwareversionsofchisquareorKStotestforafitwithaspecificdistribution.TheOne
SampleKolmogorovSmirnovTestandGoodnessofFitwebpagesexplainhowthiscanbedone,however.
Charles
Reply
Cathysays:
December29,2014at8:55am
CanweusetheKolmogorovSmirnovtestifwewanttoknowwhetherthedatafollowa
binomialdistribution?
Reply
Charlessays:
December29,2014at2:01pm
Cathy,
Yes,youcanusetheKStestforthispurpose.Inadditiontothereferencedwebpage,whichshowshowtousetheKS
testtodeterminewhetherdatafitswiththenormaldistribution,Igiveanexampleofhowtodothisforthe
exponentialdistributiononthewebpagehttp://www.realstatistics.com/nonparametrictests/onesample
kolmogorovsmirnovtest/.Theapproachforthebinomialdistributionissimilar.Alsonotethatifthesamplesizeis
sufficientlylargethebinomialdistributioncanbeapproximatedbyanormaldistribution,asdescribedonthe
webpagehttp://www.realstatistics.com/binomialandrelateddistributions/relationshipbinomialandnormal
distributions/.
Charles
Reply
JeromeGomessays:
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
10/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
August10,2015at9:12pm
DearSir,
Canyougiveanexample,wherewecanuseKStabletodeterminewhetherthedistributionfollowspoisson
dist.ornot,anexcelworksheetwillbehelpful.
Regards,
Jerome
jeromegomes89@gmail.com
Reply
Charlessays:
August11,2015at7:41am
Jerome,
YoucanusetheonesampleKStestasdescribedonthewebpage
OneSampleKSTest
Theonlyproblemisthatthetestismoreaccurateifyouknowthemeanofthedistributioninsteadof
estimatingitfromthesample.
Youcanalsousethechisquaregoodnessoffittestasdescribedonthewebpage
GoodnessofFit
Charles
Reply
zohrehsays:
June13,2014at5:34am
Hiall,
Iamtryingtofitanappropriateprobabilitydistributionwithmydata.IhaveknownthatIcanuseKStest,butmyproblem
isthat,asIamgoingtouseMATLABorEXCELsoftwaresforthispurpose,IdonotknowhowIcanusethesesoftwaresfor
thistest.MyproblemisthatIhavenoteverseenanyexampleofthistestforexponentialorotherdistributionsratherthan
normalandlognormaldistributions.HowcanIdecidewhetherforexamplelognormaldistributionisappropriateor
exponentialdistribution?
Thankyouverymuchforyourhelpinnadvance.
Reply
Charlessays:
June13,2014at5:49am
HiZohreh,
TheapproachforusingtheKSTesttotestwhetherthedataisexponentiallydistributedisverysimilartothatshown
onthereferencedwebpage.Iwilladdanexampleusingtheexponentialdistributiontothewebsiteinthenextcouple
ofdays.Thisshouldhelpyou.
Charles
Reply
Charlessays:
June20,2014at8:25am
Zohreh,
IhavenowaddedadescriptionofhowtodeterminewhetherdatafitstheexponentialdistributionusingtheKStest.
Seethewebpagehttp://www.realstatistics.com/nonparametrictests/onesamplekolmogorovsmirnovtest/.
Charles
Reply
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
11/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
Kevinsays:
June10,2014at6:31am
Sir,
IamtryingtodetermineifRokeachvaluesurvey(RVS)responsesfortwodifferentgroupsarestatisticallysignificant.The
RVShassubjectsrank18valuesinorderofimportancetothem.Ihavecalculatedthemeanresponseforeachvaluewithin
eachgroupandorderedthemfrommostimportant(lowestmean)toleastimportant(highestmean).IwastoldIcoulduse
theKolmogorovSmirnovTesttodetermineifdifferencesinmeanvaluerankingsbetweengroupsarestatisticallysignificant.
IwouldappreciateanexplanationofthisprocessinExcel.
Thankyouinadvance,
Kevin,Excelexpert,statsneophyte
P.S.Ihavelearnedmorepracticalstatisticsfromyoursitethanmyundergradandmastersprofessorshavebeenabletodrill
intomeWelldone,Sir!
Reply
Charlessays:
June11,2014at10:23am
Kevin,
Itisgoodtohearthatthesitehasbeenhelpful.Mygoalwasexactlyasyoustated,tohelppeoplemakepracticaluse
of(andunderstand)statisticsintheenvironmentisprobablythemostavailableformostpeople,namelyExcel.
Ifyourgoalistodeterminewhetherthereisasignificantdifferencebetweenthemeansofthetwogroups,you
probablywanttousethettest(ifthedatainthetwogroupsarenormallydistributed)ortheMannWhitneytestif
theyarenot.YoucouldalsousethetwosampleKolmogorovSmirnovTesttodeterminewhetherthetwogroupsof
datacomefromthesamepopulation.IhavealreadydescribedtheonesampleKolmogorovSmirnovTestonthe
website,butnotthetwosampletest.
Fortunately,IhavejustimplementedthetwosampletestintheRealStatisticsResourcePack(Release2.15)andhave
writtenthedescriptionforthewebsite(includingtwoexamples).Iplantoreleasetheseinthenextcoupleofdays.
Staytuned.
Charles
Reply
Charlessays:
June20,2014at8:14am
Kevin,
ThetwosampleKStestisnowincludedintheRealStatisticsResourcePack.Theprocedureisdescribedonthe
webpagehttp://www.realstatistics.com/nonparametrictests/twosamplekolmogorovsmirnovtest/.
Charles
Reply
Sallysays:
May28,2014at3:36am
hai,mayIknowwhatthepvaluemeanbyandhowtofindthepvalueofkolmogorovsmirnov?
Reply
Sallysays:
May28,2014at3:38am
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
12/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
besidesthatisitpossibletousethestatisticalvalueofotherdistributionasacriticalvaluetofindthepvalueofKS
test?
forexample,usethezvalueofnormaldistributiontofindthepvaluebyKStest.
Reply
Charlessays:
May31,2014at2:17pm
Sally,
Sorry,butIdontunderstandyourquestion.InanycaseIwillbeaddingtheKSpvalueshortly.
Charles
Reply
Charlessays:
May31,2014at2:16pm
Sally,
IamrevisingtheKSpartofthewebsite/softwareandwilladdthepvalue.Staytuned.
Charles
Reply
Charlessays:
June20,2014at8:19am
Sally,
IhavenowprovidedawayofcalculatingthepvaluefortheKStest,usingthefunctionsKSPROBandKSDIST.These
areavailableinthelatestreleaseoftheRealStatisticsResourcePack(Rel2.15).
Charles
Reply
SandeepRsays:
May11,2014at9:09am
hellosir,ifoundthisarticleveryhelpful.ineedtofitlognormaldistributioneitherfromchisquareorKStest.youhave
explainedonlynormaldistribution.pleaseexplainlognormaldistributionalso.
hereismytestdata
mean=5.1439
=0.2506
median=4.99
lnz=0.247
intervalobservedfrequency
1.812.7599
2.7593.70861
3.7084.657116
4.6575.606155
5.6066.555120
6.5557.50442
7.5048.4537
8.4539.4022
9.40210.3512
10.35111.33
sum=517
Reply
Charlessays:
May11,2014at9:05pm
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
13/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
TheprocedureforusingtheKStestwiththelognormaldistributionisprettymuchthesameasforthenormal
distribution.E.g.inFigure3,youwontneedtheEcolumn.Simplyentertheformulaforthelognormaldistribution
incolumnF.E.g.cellF4wouldcontainaformulalike=LOGNORMDIST(A4,N5,N10).Therestisthesameasinthe
examplesprovidedonthewebpage.
Charles
Reply
SandeepRsays:
May12,2014at8:04am
thankyouverymuchsirforyourreply.
sirihaveonemoredoubt,shouldweusemeanandstandarddeviationorMedianandlnzinlognormal
distribution?
Reply
Charlessays:
May15,2014at7:23am
Sandeep,
IfIunderstandyouroriginalquestioncorrectly,thenyoushouldusethemeanandstddev,esp.since
ExcelhastheLOGNORM.DISTfunctionavailablewhichusethesetwoparameters.Whydoyouthink
themedianandlnzmightbegoodchoices?PerhapsthisiscorrectandIamnotansweringtheright
question.
Charles
Reply
SandeepRsays:
May25,2014at3:22pm
thankyousir
Brunosays:
January4,2016at4:18pm
Hi,
Criticalvaluesarethesameforalldistributionstested?
Thankyou
Reply
Charlessays:
January4,2016at9:16pm
HiBruno,
Ifyouknowthedistributionparameters(e.g.meanandvarianceforthenormaldistribution)thenthe
tableofcriticalvaluesisthesame.Usuallytheseparametervaluesareestimatedfromthesample,in
whichcasedifferentcriticalvaluesshouldbeused.Ihaveprovidedthetableforthenormal
distribution.ThisiscalltheLillieforsTest.Seethefollowingwebpages
LillieforsTest
LillieforsTable
Charles
Reply
JuanPabloGngorasays:
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
14/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
December17,2013at11:18pm
Hi,thespsssoftwareusetheZKS=D*SQRT(n),andaPvalue,but,icantcalculatetheresultofthepvalue,isnotthe
probablilityofthenormaldistribution.
Example,n=20D=.416,ZKS=.416*SQRT(20)=1.861SPSSPvalue(twosided)=.002.
But,2*(1NORMSDIST(1.861))isnot.002
Doyouknowhowisthepvaluecalculated?
Tksalot
PD.Sorry,mienglishisnotthebest
Reply
Charlessays:
December21,2013at8:37am
HiJuanPablo,
Youneedthedistributionfunction.Youcanfindthisathttp://www.jstatsoft.org/v08/i18/paperor
http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test.
Charles
Reply
Renatosays:
December13,2013at4:37pm
DearSir:
IamlookingforatesttocompareifonesubsampleofsizentakenfromasampleofsizeN(sourcesample),withn<<N,
hasthesameattributesofthesourcesample.
IsKolmogorovSmirnovthebesttest?
Thesourcesampleisamultimodaldistribution(fishsizefrequencies)andIhavesomedoubtsabouthowtoconstructthe
accumulativesampletomaketheKStest.
Thadataisinatableoffrequenciesbyrangesofsize
Thanksforyouranswer
Renato
Reply
Charlessays:
December14,2013at7:36am
Renato,
WhethertheKStestistherightonedependsonwhatyoumeanbyhasthesameattributes.Inanycase,the
webpageathttp://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormality
symmetry/kolmogorovsmirnovtest/describesindetailthestepsyouneedtoperformtheKStest.Youcanalso
downloadtheRealStatisticsExamplesWorkbookandlookattheExcelworksheetfortheKStestanduseitasa
modelforyourtest.IhavenotyetcreatedasupplementalfunctiontoautomatethecalculationoftheKStest,butI
willeventuallyaddthis.
Charles
Reply
Charlessays:
June20,2014at8:22am
Renato,
IhavenowprovidedanotherexampleofhowtoapplytheKStesttodeterminewhetherasamplefollowsaspecified
distribution.Seethewebpagehttp://www.realstatistics.com/nonparametrictests/onesamplekolmogorov
smirnovtest/.
Charles
Reply
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
15/16
10/11/2016
KolmogorovSmirnovTestforNormality|RealStatisticsUsingExcel
RealStatisticsUsingExcel:20132016,CharlesZaiontz,AllRightsReserved
ProudlypoweredbyWordPress.
http://www.realstatistics.com/testsnormalityandsymmetry/statisticaltestsnormalitysymmetry/kolmogorovsmirnovtest/
16/16