When using -fre- from Ben Jann (on SSC) with string variables containing Chinese (traditional) text, the Mata error message "3301 subscript invalid" appears. -set trace- shows that this happens with -mata: fre_display_or_export()-. However, -tab1- has no problems with these data:
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str254(aftschs pjdiscrs vcybures)
"再說吧" "很多人" "-66"                  
"半工半讀" "看起來經濟狀況不佳的人" "我不知道"         
"進大學或找份工作" "在西方某些國家,凡不是白種人皆有可能,但在大部分國家,窮人被鄙視" "個性"               
"我要成為海賊王" "外星人" "-66"                  
"國中畢業前,找到興趣,會去高職學習,沒找到,則是選擇繼續升學,準備進大學。" "長的醜,黑人,黃種人" "遊戲玩的好不好"
"出國留學" "種族不同 國籍不同 曾經有前科的人" "我的個性"         
"出國留學" "身障者" "-66"
"-99" "國際移工" "因為我在課堂上表現得比他們好、他們喜歡的男生和我說話"                  
end
label var aftschs "other (write in):"
label var pjdiscrs "不是的,有些人沒有被平等對待。哪些人? %s (請註明)"
label var vcybures "其他(請說明):"

tab1 aftschs pjdiscrs vcybures
cap noi: fre aftschs
cap noi: fre pjdiscrs
cap noi: fre vcybures
The output shows:
Code:
. tab1 aftschs pjdiscrs vcybures

-> tabulation of aftschs  

                      other (write in): |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
                                    -99 |          1       12.50       12.50
                                  再說吧 |          1       12.50       25.00
                                出國留學 |          2       25.00       50.00
                                半工半讀 |          1       12.50       62.50
       國中畢業前,找到興趣,會去高職學習,.. |          1       12.50       75.00
                           我要成為海賊王 |          1       12.50       87.50
                          進大學或找份工作 |          1       12.50      100.00
----------------------------------------+-----------------------------------
                                  Total |          8      100.00

-> tabulation of pjdiscrs  

                 不是的,有些人沒有被平等對 |
                  待。哪些人? %s (請註明) |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
                                國際移工 |          1       12.50       12.50
       在西方某些國家,凡不是白種人皆有可能.. |          1       12.50       25.00
                                  外星人 |          1       12.50       37.50
                                  很多人 |          1       12.50       50.00
                     看起來經濟狀況不佳的人 |          1       12.50       62.50
            種族不同 國籍不同 曾經有前科的人 |          1       12.50       75.00
                                  身障者 |          1       12.50       87.50
                      長的醜,黑人,黃種人 |          1       12.50      100.00
----------------------------------------+-----------------------------------
                                  Total |          8      100.00

-> tabulation of vcybures  

                           其他(請說明): |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
                                    -66 |          3       37.50       37.50
                                    個性 |          1       12.50       50.00
       因為我在課堂上表現得比他們好、他們喜.. |          1       12.50       62.50
                                我不知道 |          1       12.50       75.00
                                我的個性 |          1       12.50       87.50
                           遊戲玩的好不好 |          1       12.50      100.00
----------------------------------------+-----------------------------------
                                  Total |          8      100.00

. cap noi: fre aftschs
 fre_display_or_export():  3301  subscript invalid
                 <istmt>:     -  function returned error

. cap noi: fre pjdiscrs
 fre_display_or_export():  3301  subscript invalid
                 <istmt>:     -  function returned error

. cap noi: fre vcybures
 fre_display_or_export():  3301  subscript invalid
                 <istmt>:     -  function returned error
Is there anyone who could come up with a solution to this problem?