v v
By
Dr.v Zardadv Khan
DepartmentvofvStatisticsvAbd
ulvWalivKhanvUniversityvMardan
Augustv19,v2020
AWKUM Categoricalv datavanalysis
,Lecture 1: Introduction to categorical data (analysis)
v v v v v v
vCategoricalvdatavarevavtypevofvdatavthatvconsistvofvcategorical
vvariables.
Thesevvariablesvmightvbevgeneratedvduevtovthevintrinsicvnature
v
ofvthevdatavgenerationvprocessvorvothervtypesvofvdatavmightvbev
v
convertedvintovthisvformvforvsomevpurposev(e.g.v agevconvertedvi
ntovagevgroups).
vCategoricalvVariable:vAvvariablevthatvcanvtakevonvvaluesvfro
mvavfixedvnumbervofvvaluesv(classes)vusuallyvcalledvcategorie
s.
v Statisticalvinvestigationvforvgettingvinformationvfromvsuchvdata
visvcallledvcategoricalvdatavanalysis.
AWKUM Categoricalv datavanalysis
,Lecture 1: Examples of categorical data
v v v v v
vSomevexamplesvofvcategoricalvvariablesvarevstatusvofvdisease
infection,vgender,veyevcolour,vhairvcolour,vpoliticalvaffiliation,v
v
etc.
vPoliticalvaffiliation,vforvexample,vmayvhavevseveralvcategories
vwhenvrespondantsvdeclarevthemselvesvasvRepublican,vDemocr
atvorvIndependentvorvOther.v Eachvrespondantvwillvhavevonlyvone
vcategoryvi.e.v thevcategoriesvarevmutuallyvexclusive.
vThevcategoriesvarevnotvvariablee,vforvexamplevRepublicanvdoesv
notvchangevfromvonevpersonvtovanvother.
vTovmanipulatevdataveasily,,vcategoriesvarevoftenvrecordedvasv
codedvnumericalvvalues.v Forevexample,vgendervisvcodedvasv0v=v
Male,v1v=vFemale.
AWKUM Categoricalv datavanalysis
, Lecture 1: Examples of categorical data
v v v v v
vCodingvdoesvnotvchangevthevnauturevofvthevvariable,vi.e.v itvstillv
remainsvcategorical.
vCodedvdatavmightvbevhardvtovdistinguishvfromvquantitativev
data.v Forvexample,vresearchervmayvcollectevthevfollowingvdatav
whenvhe/shevaskvhis/hervrespondantsvthevfollowingvquestion:
HowvdovyouvfeelvaboutvthevqualityvofveducationvatvAWKUM.vPleasevcirclevon
e.
Awful Poor Satisfactory Good Excellent
1 2 3 4 5
AWKUM Categoricalv datavanalysis