全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4977 10
2015-05-19
比如indicator中包括production value,production volumn, production value added, 现在如何用一个公式将这些内容中空格的地方变成下划线,而不是用regexr语句一次次的加,是需要用到循环语句吗?具体如何写?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-5-19 23:26:18
strtoname() 函数
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-20 17:08:26
andruw 发表于 2015-5-19 23:26
strtoname() 函数
在stata里的help里没有找到这个命令啊?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-20 18:15:44

Title

    [D] functions -- Functions


String function

    strtoname(s,p)
       Domain s:     strings
       Domain p:     0 or 1
       Range:        strings
       Description:  returns s translated into a Stata name.  Each character in s that is not allowed in a Stata name is converted to an underscore character, _.  If the first character
                         in s is a numeric character and p is not 0, then the result is prefixed with an underscore.  The result is truncated to 32 characters.

                         strtoname("name",1) = "name"
                         strtoname("a name",1) = "a_name"
                         strtoname("5",1) = "_5"
                         strtoname("5:30",1) = "_5_30"
                         strtoname("5",0) = "5"
                         strtoname("5:30",0) = "5_30"

    strtoname(s)
       Domain s:     strings
       Range:        strings
       Description:  returns s translated into a Stata name.  Each character in s that is not allowed in a Stata name is converted to an underscore character, _.  If the first character
                         in s is a numeric character, then the result is prefixed with an underscore.  The result is truncated to 32 characters.

                         strtoname("name") = "name"
                         strtoname("a name") = "a_name"
                         strtoname("5") = "_5"
                         strtoname("5:30") = "_5_30"
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-20 20:41:45
andruw 发表于 2015-5-19 23:26
strtoname() 函数
嘿嘿……这个函数都被你找到了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-5-20 21:04:36
heric221 发表于 2015-5-20 20:41
嘿嘿……这个函数都被你找到了。
stata就那么几个函数
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群