logrank t outcome, by(group) %单因素生存分析 两因素方差分析 多因素方差分析:anova y x1 x2 x1*x2 生成变量group,并且让它的观测值显示为1-96,然后循环出现1-96 egen group=seq(), from(1) to(96) 回归命令时不需要常数项: reg y x, noconstant ...
在Stata中,数据处理和分析操作非常丰富。首先,对于分组描述,你可以使用`sort group by group:su`命令对数据进行排序,`tabstat economy,stats(max)`则用于找出变量economy的最大值。统计函数如`mean`, `count`, `sum`, `max`, `min`等,可以提供变量的集中趋势和范围信息。`list gen/generate`用...
egen group=group(id) summarize group Egen和gen的区别 Hello, the egen is an excellent stata command which is useful in particular for large database for which variables contain repeated sequence. It's used in general with other commands (by (id), ...). You can see this document from stat...
deviation of logs, Gini index, Mehran index, Piesch index, Kakwani index, Theil entropy index, and mean log deviation 优点:计算结果可直接调用 Syntax:by year provinceid: egen gini = inequal(incomeimp), index(gini) index 括号中的内容可以替换成以下不平等函数: ---codefunctionrmd the relative m...
by(group) %2 组资料中位数比较 kwallis x, by(group) %多组资料中位数比较 anova x t id %x 为因变量,t 跟 id 是因素 egenr=rank(x),by(id) %产生秩 r 单因素方差分析: 单因素方差分析又称为 OnewayANOVA,用于比较多组样本的均数是否相同, 并假定:每组的数据服从正态分布,具有相同的方差,且相...
egen mis=rowmiss(_all) drop if mis drop mis 【8】行业划分 clonevarsic2=ind orderstkcd accper sic2 replace sic2=substr(sic2,1,1) if substr(sic2,1,1)!=”C” replace sic2=substr(sic2,1,2) if substr(sic2,1,1)==”C”
bysort year: egen g=xtile(var), n(2) 方法二 bys accper: cumul icindex, g(g) eq levelsof accper, local(id) display"`r(levels)'"local cut1=1/2foreachx of local id { recode g (min/`cut1'=0)(`cut1'/max=1)ifaccper==`x'} ...
egen group=group(id) summarize group <hr/>Egen和gen的区别 Hello, the egen is an excellent stata command which is useful in particular for large database for which variables contain repeated sequence. It's used in general with other commands (by (id), ...). You can see...
bysort year: egen g=xtile(var), n(2) 方法二 bys accper: cumul icindex, g(g) eq levelsof accper, local(id) display "`r(levels)'" local cut1 = 1/2 foreach x of local id { recode g (min/ cut1'=0)( cut1'/max=1) if accper==`x' ...
gen DACC_group=1if DACC>=DACC50 //0是下五分位,1是上五分位 replace DACC_group=0if DACC<DACC50 4. 分组计算均值中位数 by year,sort:egen distance_ew_median=median(Ln_geodistance_ew)gen distance_ew_high=(Ln_geodistance_ew>distance_ew) if Ln_geodistance_ew!=. //是否加median 组...