当前位置: X-MOL 学术Stata J. Promot. Commun. Stat. Stata › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Speaking Stata: More ways for rowwise
The Stata Journal: Promoting communications on statistics and Stata ( IF 4.8 ) Pub Date : 2020-06-19 , DOI: 10.1177/1536867x20931007
Nicholas J. Cox 1
Affiliation  

A previous column (Cox, 2009, Stata Journal 9: 137–157) gave a review of methods for working rowwise in Stata. Here rows means observations in a dataset, and the concern is calculations in each observation with a bundle of variables. For example, a row mean variable can be generated as the mean of some numeric variables in each observation.

This column is an update. It is briefly flagged that official Stata now has rowmedian() and rowpctile() functions for egen. The main focus is on returning which variable or variables are equal to the maximum or minimum in a row. The twist that requires care is that two or more variables can tie for minimum or maximum. That may entail a decision on what is to be recorded, such as all of them or just the first or last occurrence of an extreme.



中文翻译:

讲Stata:更多行方式

先前的专栏文章(Cox,2009年,Stata Journal 9:137–157)概述了在Stata中按行工作的方法。在这里,表示数据集中的观测值,而关注点是在每个观测值中使用一捆变量进行的计算。例如,可以生成行均值变量作为每个观察值中某些数字变量的均值。

此列是更新。这是简单标记,官方塔塔现在有rowmedian()rowpctile()的函数EGEN。主要重点是返回一个或多个变量等于一行中的最大值或最小值。需要注意的是,两个或多个变量可以并列为最小值或最大值。这可能需要决定要记录的内容,例如所有内容,或者仅是极端事件的第一次或最后一次出现。

更新日期:2020-06-30
down
wechat
bug