因此,我在Stata中有一個名爲「程序描述」的變量,該變量具有非常相似的觀察結果,儘管觀察結果沒有遵循任何模式。我的目標是清理變量,以便非常相似的觀察值具有相同的名稱。清理具有高度相似觀察結果的變量
這裏是什麼樣的變量看起來像一個例子:
Variable Name
phys ed
physical education
phys ed k-12
learning disabilities
learn dis
learn disable
因此,我想前三,只是被稱爲「PHY的ED」(或某些衍生物)和過去的三隻是被稱爲「學習障礙」
我一直在使用函數strpos()
來取代包含某些短語的觀察值,但因爲變量有100k個觀察值和很多不同的名字,這需要一段時間。
這已經出現了幾次www.statalist.com。我會尋找那裏提供的答案,因爲已經提出了很多解決方案。不幸的是,我目前無法提供任何鏈接。 – 2014-11-05 22:11:34
我到處尋找信息,並沒有發現任何有用的東西,所以如果你找到任何鏈接,請告訴我。 – Pcarlitz 2014-11-06 03:16:45
http://www.stata.com/statalist/archive/2013-11/msg01209.html和http://www.stata.com/statalist/archive/2012-03/msg01135.html和http:// www .stata.com/statalist/archive/2004-02/msg00246.html和http://www.statalist.org/forums/forum/general-stata-discussion/general/754-repeated-names-in-a-string - 可變 - 但有一些錯別字 - 如何糾正,更一般地說:https://www.google.com/search?q=statalist+%2B+string+match&gws_rd=ssl#q=statalist+%2B+模糊+字符串+ – 2014-11-06 03:22:47