“stata variable already defined”错误表明你尝试创建一个已经存在于当前数据集中的变量名。Stata不允许在同一数据集中存在同名的两个变量,因此会抛出此错误。 2. 常见原因 重复执行相同的代码:如果你不小心多次运行了包含变量创建命令的代码块,而该代码块试图创建相同的变量名,就会导致这个错误。 合并数据集后未清理...
除此之外,Stata软件可以透过网络实时更新每天的最新功能,更可以得知世界各地的使用者对于STATA公司提出的问题与解决之道。使用者也可以透过StataJournal获得许许多多的相关讯息以及书籍介绍等。另外一个获取庞大资源的管道就是Statalist,它是一个独立的listserver,每月交替提供使用者超过1000个讯息以及50个程...
说明该名称已经有变量了,要么换一个命名,要么将原来的删掉,或者replace.
drop if strmatch(id, "*2005*") | strmatch(id, "*2006*") merge的时候为什么会提示variable _merge already defined??? (两次合并) use fdata1.dta, clear merge 1:1 Stkcd year using pdata2.dta, nogen save finaldata, replace 请问Stata用什么命令提取字符串变量前2个汉字或前n个汉字? 一个汉字...
注意:1、第一次使用by city: ipolate y year,gen(y1) 命令,可能会出现“not sorted r(5)”错误,这时需要对city进行排序,使用命令:sort city,之后再执行命令即可。2、gen(h2_0) 中,h2的前后不能有任何空格,不然stata会识别为h2,这时候会显示错误“variable h2 already defined"。3、stata中输入help ipolate...
<hr/>merge的时候为啥会提示variable _merge already defined??? (两次合并) use fdata1.dta, clear merge 1:1 Stkcd year using pdata2.dta, nogen save finaldata, replace <hr/>请问Stata用什么命令提取字符串变量前2个汉字或前n个汉字? 一台汉字占3位。 g x=substr(province,1,6)...
confirm new variable `generate' 1. 然后Stata检查你是否可以生成这个变量,如果不行,则发出错误110.尝试pnupt age, gen(age),Stata会说 ‘age already defined’。 现在你应该清楚,stata会检查均值,标准差和结婚比例这三个选项是否有指定数值(缩写为m(),s()和p()),这些值必须是实数,并将被存储在名为mean,...
gen time = (year>=1994) & !missing(year) *Create a dummy variable to identify the group exposed to the treatment. In this example lets assumed that countries with code 5,6, and 7 were treated (=1). Countries 1-4 were not treated (=0). If you already have this skip this step生成...
(99.9% of memory free) storage display value variable name type format label variable label id str3 %9s num str3 %9s code str4 %9s total str5 %9s income str5 %9s .sum //因为所有变量为字符型,所以不能进行数值计算 .gen nincom=incom+10 //因字符不能进行四则运算,不能进行加法运算 *...
复制的好乱……拍个照吧