Hello every one,
I hope you are doing very well.
There is a variable containing letters and numbers. I wanted to label value the observation for example "AF01" should be teacher and so on. when I run the command label value it errors invalid syntax.
So I wanted to try another way. I split the variable in to two parts, one part includes the letters for example (Af ) and the other part includes the numbers like (01). like wise, when I run the split command it does not split the variable in to two parts. And then I should label value the destring part. Please anyone help me to solve the problem. Thank you in advance.
here is the dataex created example below.
I hope you are doing very well.
There is a variable containing letters and numbers. I wanted to label value the observation for example "AF01" should be teacher and so on. when I run the command label value it errors invalid syntax.
So I wanted to try another way. I split the variable in to two parts, one part includes the letters for example (Af ) and the other part includes the numbers like (01). like wise, when I run the split command it does not split the variable in to two parts. And then I should label value the destring part. Please anyone help me to solve the problem. Thank you in advance.
here is the dataex created example below.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str4 Pcode "AF17" "AF17" "AF17" "AF15" "AF17" "AF17" "AF17" "AF17" "AF17" "AF17" "AF15" "AF15" "AF17" "AF01" "AF01" "AF17" "AF17" "AF18" "AF18" "AF15" "AF17" "AF17" "AF17" "AF17" "AF17" "AF17" "AF18" "AF18" "AF18" "AF18" "AF17" "AF17" "AF17" "AF18" "AF18" "AF15" "AF17" "AF17" "AF17" "AF17" "AF17" "AF17" end
Comment