此外,也可以考虑在Stata的用户论坛或社区中寻求其他用户的帮助。 示例代码 假设你有一个以数字开头的变量名1_variable,并且你想将它更改为var1,可以使用以下Stata命令: stata rename 1_variable var1 执行此命令后,1_variable将被重命名为var1,从而避免“invalid name”错误。
invalid name简而言之就是你的命名方式存在错误,比如你写一个gen命令,然后对象包含不允许的符号,系统就会报错。在你不提供具体code的情况下建议你参照help varname,自查命名方式是否有错。
(4)输入命令:unicode translate "2013.dta", invalid(mark) transutf8 (5)友情提示,第(4)步中有两点需要注意,一是"2013.dta"千万不要忘了加“ ”号,二是在某些情况下加入invalid(mark)这个选项可以很好的解决意想不到的问题。使用连玉君老师编写的ua命令也需要注意这个问题。 (6)转换完的数据文件2013.dta,...
invalid name r(198) 注意:不建议变量以下划线””开头,因为stata内置变量格式为variables, 变量重命名: 命令1: rename old new //单一变量重命名(old指老变量名,new指新变量名,下同) 命令2: rename (old1 old...) (new1 new2 .. ) //多个变量重命名 命令3: rename old1 old2 ... upper //变量...
_cons | -.2405868 .3882704 -0.62 0.535 -1.001583 .5204093 --- 期刊排版 但与原文不同: 参考文献 invalid new variable name; variable name ec is in the list of (完)
invalid name r(198) 注意:不建议变量以下划线””开头,因为stata内置变量格式为variables, 变量重命名: 命令1: rename old new //单一变量重命名(old指老变量名,new指新变量名,下同) 命令2: rename (old1 old...) (new1 new2 .. ) //多个变量重命名 ...
(4)输入命令:unicode translate "2013.dta", invalid(mark) transutf8(5)友情提示,第(4)步中有两点需要注意,一是"2013.dta"千万不要忘了加“ ”号,二是在某些情况下加入invalid(mark)这个选项可以很好的解决意想不到的问题。使用连玉君老师编写的ua命令也需要注意这个...
[ invalid name matrix [1,1]notfound r(111); Stata中第三方矩阵相关的命令 matmapGiven matrix A and a user-supplied expression, matmap calculates matrix B with typical element matewmfGiven matrix A and a user-supplied monadic function f with Stata syntax f( ), matewmf calculates and displays...
. replace x = `keyvar'*5*5 invalid name r(198); The local macro `keyvar' will be empty so Stata will see those commands as if we ran incomplete commands like: generate = hours/2 replace x = *5 There are two common ways to resolve this issue. The first is defining the macro in...
time is a string variable 因此我们如果要在Stata中处理时间变量,第一件事就是要把文本格式的时间,转换成Stata可以识别的格式。转换的命令叫做date,其格式是: date(s1,s2),其中s1是文本格式的时间变量,s2是文本格式时间的年月日的排列次序 比如说,例子中的1987-01,就是YM,如果是1987-01-01,那就是YMD。如果...