Epidemiology & Technology

Likert Scale Score Calculation in Stata

When you have a scale with Likert scaled responses – example the EU-HLS-Q47

Items: q01-q47; Responses: 1-5 where 5 == Don’t know

Calculate number of Dont Know (5) responses by each participant and number of non- missing responses given by each person

** Calculate "Dont Know" responses for each respondent
egen respondedDN = anycount(q01-q47), values(5)

** Calculate non missing responses for each respondent
egen items_responded = rownonmiss(q01-q47)

** Convert Dont know (5) to missing (.)
foreach x in q01 q02 q03 q04 q05 q06 q07 q08 q09 q10 q11 q12 q13 q14 q15 q16 ///
             q17 q18 q19 q20 q21 q22 q23 q24 q25 q26 q27 q28 q29 q30 q31 q32 ///
             q33 q34 q35 q36 q37 q38 q39 q40 q41 q42 q43 q44 q45 q46 q47 {
  quietly replace `x' = . if `x' ==5

** Calculate valid responses for each respondent
egen items_responded_valid = rownonmiss(q01-q47)Code language: Stata (stata)

Calculate Mean Score with correct denominator automatically applied

** Overall Health Literacy in ALL
egen meanScore = rowmean(q01-q47)Code language: Stata (stata)

At this stage, you may wish to restrict your analysis to respondents who gave a certain number of valid responses, say 15 in this example

summ meanScore if items_responded_valid >=15 & valid_responses !=.Code language: Stata (stata)

Related posts