Hello Everyone,
I have a variable in a Likert scale that I want to convert to a z-score. I was wondering if it is possible to calculate it via a single Stata command line. I used the following command below, but I guess I am mistaken somewhere:
egen average_z= (average_1-mean(average_1))/sd(average_1)
The snapshot of the variable is posted below; I would really appreciate your advice on this!
I have a variable in a Likert scale that I want to convert to a z-score. I was wondering if it is possible to calculate it via a single Stata command line. I used the following command below, but I guess I am mistaken somewhere:
egen average_z= (average_1-mean(average_1))/sd(average_1)
The snapshot of the variable is posted below; I would really appreciate your advice on this!
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double average_1 2 4 2 3 2 2 2 2 3 5 3 3 1 2 2 5 3 1 2 1 1 2 1 1 1 1 1 3 3 3 1 3 2 1 1 1 2 2 1 1 2 2 1 2 4 2 1 3 3 1 2 4 2 3 3 2 4 1 3 1 2 2 3 1 2 1 3 3 1 3 2 3 2 1 1 2 5 3 2 3 3 4 2 2 1 1 1 2 1 2 1 1 3 1 1 1 3 2 2 3 end label values average_1 average_1 label def average_1 1 "1", modify label def average_1 2 "2", modify label def average_1 3 "3", modify label def average_1 4 "4", modify label def average_1 5 "5", modify
Comment