在Stata中遇到“string variables may not be used as factor variables”这一错误时,通常意味着你尝试将字符串类型的变量用作因子变量,但Stata不支持这样做。为了解决这个问题,你可以按照以下步骤操作: 理解错误原因: 这个错误表明你尝试在回归分析或类似需要使用因子变量的命令中使用了字符串类型的变量。Stata要求因...
Stata会报错如下。 line cpi time string variables not allowed in varlist; time is a string variable 因此我们如果要在Stata中处理时间变量,第一件事就是要把文本格式的时间,转换成Stata可以识别的格式。转换的命令叫做date,其格式是: date(s1,s2),其中s1是文本格式的时间变量,s2是文本格式时间的年月日的...
显示中英文 How do I convert string variables to numeric variables in Stata? stringvariablesnumericstata 提问by Exodia16 我在Stata 中有两个变量,这两个数字变量都以某种方式被记录为字符串变量。我需要将它们转换为数字变量,以便我可以用它们生成一个新变量。 当我尝试时,它说type mismatch我已经尝试了real和...
Stata报错。 . tsset TIMESTAMP //出现错误。因为该变量是字符串型 string variables not allowed in varlist; TIMESTAMP is a string variable r(109); 这是因为这个变量本来就是字符型,不是日期型,不能直接当日期型变量使用。所以我们需要对这个变量进行转换。 TIMESTAMP变量转换使用clock函数。 *第一步,通过c...
Subject Re: st: Loading long string variables (from SQL) into Stata Date Thu, 6 Dec 2012 09:35:56 +0000That's good: you can imagine a strategy. In detail: there's no guarantee that words would be split in the middle. Also, there is no need to create new variables as (e.g.) ...
Here the result ofcountis left behind inr(N). If that is not zero, i.e., ifr(N)is one or more, Stata enters thewhileloop. We remove the first zero whenever there is one andcountagain. Stata will exit the loop as soon asr(N)becomes zero. A similar technique could be used to rem...
如果数据中不需要它,则将其编码为缺失(虽然在缺少数据的意义上它并不缺少,但数据是完美的)。当v3丢失时,我希望Stata将上面的表达式当作v3的术语不存在,所以在这些情况下,我只希望它将这些观察的表达式处理为:当我运行这个时,stata说: starting values invalid or some RHS variables have missing values...
string var..string variables not allowed in varlist;month is a string variable设置面板数据的时候出现的,应该怎么调整month数据才行?
status_t1 is a string, status_t1_num is a long; in both cases, the sortby() option returns the same error message: . sankey cdr_flows_ if month_num>=4, from(status_t1) to(status_t2) by(month_num) sortby(status_t1) not sorted r(5); . sank...
Stata字符串函数——substr(s,n1,n2) Stata字符串函数:快捷提取字符信息_字节 4.数字是红色 . encode 经营活动产生的现金流量净额元,gen (cfo) 5.滞后命令后time variable not setr(111); . xtset id 会计期间 string variables not allowed in varlist; id is a string variable r(109); 变量属性 egen...