Home » Likert Scale Score Calculation in Stata

# 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

```.wp-block-code {
border: 0;
}

.wp-block-code > span {
display: block;
overflow: auto;
}

.shcb-language {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
position: absolute;
width: 1px;
word-wrap: normal;
word-break: normal;
}

.hljs {
box-sizing: border-box;
}

.hljs.shcb-code-table {
display: table;
width: 100%;
}

.hljs.shcb-code-table > .shcb-loc {
color: inherit;
display: table-row;
width: 100%;
}

.hljs.shcb-code-table .shcb-loc > span {
display: table-cell;
}

.wp-block-code code.hljs:not(.shcb-wrap-lines) {
white-space: pre;
}

.wp-block-code code.hljs.shcb-wrap-lines {
white-space: pre-wrap;
}

.hljs.shcb-line-numbers {
border-spacing: 0;
counter-reset: line;
}

.hljs.shcb-line-numbers > .shcb-loc {
counter-increment: line;
}

.hljs.shcb-line-numbers .shcb-loc > span {
}

.hljs.shcb-line-numbers .shcb-loc::before {
border-right: 1px solid #ddd;
content: counter(line);
display: table-cell;
text-align: right;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: 1%;
}
```** 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)`