当您遇到错误信息“unknown egen function var()”时,这通常意味着Stata无法识别您尝试使用的egen函数。 这里有几种可能的原因: 1.拼写错误或函数名错误:确保您使用的egen函数名称是正确的。例如,如果您想创建一个新变量,该变量是现有变量的总和,您应该使用egen sum_var = sum(varname)。 2.未安装的包或命令:...
unknown function sqr() r(133); . display sqrt(10) 3.1622777 或者,试试用 twoway function 画点图。 . twoway function clip(x, 0.2, 0.8) . twoway function chop(x, 1), ra(0 10) 第三,在代码书写时手动布局。逗号后和运算符周围的空格通常会使代码更具可读性。 gen x=1*2+3/4-sqrt(5)...
如果你在使用Stata时遇到“unknown function median()”的错误,很可能是因为你在尝试使用一个不存在的函数。对于中位数计算,建议使用egen命令。如果确实需要使用自定义函数,请确保该函数已被正确加载到Stata环境中。 通过以上步骤,你应该能够解决“unknown function median()”的问题,并正确地在Stata中计算中位数。如果...
ssc install egenmore
ssc install egenmore
Syntax:by year provinceid: egen gini = inequal(incomeimp), index(gini) index 括号中的内容可以替换成以下不平等函数: ---codefunctionrmd the relative mean deviation cov the coefficientofvariation sdl the standard deviationoflogs gini the Gini index mehran the Mehran index...
egen rowmode=mode(x1 x2 x3) (联合众数) egen rowtotal=total(x1 x2 x3)(联合总数) egen xrank=rank(x)(在不改变变量x各个值排序的情况下,获得反映x值大小排序的xrank) 数据计算器display命令: display x[12](显示x的第十二个观察值) display chi2(n,x)(自由度为n的累计卡方分布) ...
Next by Date: st: Unknown function () error. Previous by thread: Re: st: Integrating Stata and external text editors Next by thread: Re: st: Integrating Stata and external text editors Index(es): Date Thread© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact...
史上最全的 Stata 外部命令一览,可以在线查看帮助文件。 Source:Archive of user-written Stata packages 导言 这里汇集了截至 2015年1月1日 为止的所有 Stata 外部命令。可以在线查看每个外部命令的帮助文件。 对于感兴趣的命令,可以使用findit在 Stata 命令窗口中搜索后下载,亦可直接使用ssc install命令直接下载。
Functions in Stata range between those you know you want and those you don’t know you need. The word “functions” is heavily overloaded in Stata; here the focus is on functions’ strict sense, _variables, extended macro functions, andegenfunctions. Often Stata users in difficulty are seekin...