首页 > 最新文献

Stata Journal最新文献

英文 中文
iefieldkit: Commands for primary data collection and cleaning (update) iefieldkit:用于主数据收集和清理的命令(更新)
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196496
Kristoffer Bjärkefur, Luíza Cardoso de Andrade, Benjamin Daniels
Data collection and cleaning workflows implement highly repetitive but extremely important processes. In this article, we describe an update to iefieldkit, a package developed to standardize and simplify best practices for high-quality primary data collection across the World Bank’s Development Impact Evaluation department. The first release of iefieldkit provided workflows to automate error checking for Open Data Kit-based survey modules, duplicate management, data cleaning, and codebook creation. This update to the package includes improved commands to document and implement data point corrections, verify the structure or contents of data using codebooks, and create replicationready data through automated variable subsetting.
数据收集和清理工作流程实现了高度重复但极其重要的过程。在本文中,我们介绍了iefieldkit的更新,该工具包是为规范和简化世界银行发展影响评估部门高质量原始数据收集的最佳实践而开发的。iefieldkit的第一个版本提供了工作流来自动检查基于Open Data kit的调查模块、副本管理、数据清理和代码本创建的错误。该包的更新包括改进的命令,用于记录和实现数据点更正,使用代码本验证数据的结构或内容,以及通过自动变量子集创建可复制数据。
{"title":"iefieldkit: Commands for primary data collection and cleaning (update)","authors":"Kristoffer Bjärkefur, Luíza Cardoso de Andrade, Benjamin Daniels","doi":"10.1177/1536867x231196496","DOIUrl":"https://doi.org/10.1177/1536867x231196496","url":null,"abstract":"Data collection and cleaning workflows implement highly repetitive but extremely important processes. In this article, we describe an update to iefieldkit, a package developed to standardize and simplify best practices for high-quality primary data collection across the World Bank’s Development Impact Evaluation department. The first release of iefieldkit provided workflows to automate error checking for Open Data Kit-based survey modules, duplicate management, data cleaning, and codebook creation. This update to the package includes improved commands to document and implement data point corrections, verify the structure or contents of data using codebooks, and create replicationready data through automated variable subsetting.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135428961","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Facilities for optimizing and designing multiarm multistage (MAMS) randomized controlled trials with binary outcomes 优化和设计具有二元结果的多臂多阶段随机对照试验的工具
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196295
Babak Choodari-Oskooei, Daniel J. Bratton, Mahesh K. B. Parmar
We introduce two commands, nstagebin and nstagebinopt, that can be used to facilitate the design of multiarm multistage (MAMS) trials with binary outcomes. MAMS designs are a class of efficient and adaptive randomized clinical trials that have successfully been used in many disease areas, including cancer, tuberculosis, maternal health, COVID-19, and surgery. The nstagebinopt command finds a class of efficient “admissible” designs based on an optimality criterion using a systematic search procedure. The nstagebin command calculates the stagewise sample sizes, trial timelines, and overall operating characteristics of MAMS designs with binary outcomes. Both commands allow the use of Dunnett’s correction to account for multiple testing. We also use the ROSSINI 2 MAMS design, an ongoing MAMS trial in surgical wound infection, to illustrate the capabilities of both commands. The new commands facilitate the design of MAMS trials with binary outcomes where more than one research question can be addressed under one protocol.
我们介绍了两个命令,nstagebin和nstagebinopt,可以用来促进设计具有二元结果的多臂多阶段(MAMS)试验。MAMS设计是一类高效、适应性强的随机临床试验,已成功应用于许多疾病领域,包括癌症、结核病、孕产妇保健、COVID-19和外科手术。nstagebinopt命令使用系统搜索过程,根据最优性标准找到一类有效的“可接受的”设计。nstagebin命令计算具有二进制结果的MAMS设计的分阶段样本量、试验时间表和总体操作特性。这两个命令都允许使用Dunnett校正来解释多次测试。我们还使用ROSSINI 2 MAMS设计,一项正在进行的MAMS手术伤口感染试验,来说明这两个命令的能力。新命令有助于设计具有二元结果的MAMS试验,其中多个研究问题可以在一个协议下解决。
{"title":"Facilities for optimizing and designing multiarm multistage (MAMS) randomized controlled trials with binary outcomes","authors":"Babak Choodari-Oskooei, Daniel J. Bratton, Mahesh K. B. Parmar","doi":"10.1177/1536867x231196295","DOIUrl":"https://doi.org/10.1177/1536867x231196295","url":null,"abstract":"We introduce two commands, nstagebin and nstagebinopt, that can be used to facilitate the design of multiarm multistage (MAMS) trials with binary outcomes. MAMS designs are a class of efficient and adaptive randomized clinical trials that have successfully been used in many disease areas, including cancer, tuberculosis, maternal health, COVID-19, and surgery. The nstagebinopt command finds a class of efficient “admissible” designs based on an optimality criterion using a systematic search procedure. The nstagebin command calculates the stagewise sample sizes, trial timelines, and overall operating characteristics of MAMS designs with binary outcomes. Both commands allow the use of Dunnett’s correction to account for multiple testing. We also use the ROSSINI 2 MAMS design, an ongoing MAMS trial in surgical wound infection, to illustrate the capabilities of both commands. The new commands facilitate the design of MAMS trials with binary outcomes where more than one research question can be addressed under one protocol.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135428775","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
hdps: A suite of commands for applying high-dimensional propensity-score approaches hdps:一套用于应用高维倾向得分方法的命令
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196288
John Tazare, Liam Smeeth, Stephen J. W. Evans, Ian J. Douglas, Elizabeth J. Williamson
Large healthcare databases are increasingly used for research investigating the effects of medications. However, a key challenge is capturing hard-to-measure concepts (often relating to frailty and disease severity) that can be crucial for successful confounder adjustment. The high-dimensional propensity score has been proposed as a data-driven method to improve confounder adjustment within healthcare databases and was developed in the context of administrative claims databases. We present hdps, a suite of commands implementing this approach in Stata that assesses the prevalence of codes, generates high-dimensional propensity-score covariates, performs variable selection, and provides investigators with graphical tools for inspecting the properties of selected covariates.
大型医疗保健数据库越来越多地用于调查药物效果的研究。然而,一个关键的挑战是捕捉难以测量的概念(通常与虚弱和疾病严重程度有关),这些概念对于成功的混杂因素调整至关重要。高维倾向评分已被提出作为一种数据驱动的方法,以改善医疗保健数据库中的混杂因素调整,并在行政索赔数据库的背景下开发。我们提出了hdps,一套在Stata中实现这种方法的命令,它可以评估代码的流行程度,生成高维倾向得分协变量,执行变量选择,并为研究人员提供检查所选协变量属性的图形工具。
{"title":"hdps: A suite of commands for applying high-dimensional propensity-score approaches","authors":"John Tazare, Liam Smeeth, Stephen J. W. Evans, Ian J. Douglas, Elizabeth J. Williamson","doi":"10.1177/1536867x231196288","DOIUrl":"https://doi.org/10.1177/1536867x231196288","url":null,"abstract":"Large healthcare databases are increasingly used for research investigating the effects of medications. However, a key challenge is capturing hard-to-measure concepts (often relating to frailty and disease severity) that can be crucial for successful confounder adjustment. The high-dimensional propensity score has been proposed as a data-driven method to improve confounder adjustment within healthcare databases and was developed in the context of administrative claims databases. We present hdps, a suite of commands implementing this approach in Stata that assesses the prevalence of codes, generates high-dimensional propensity-score covariates, performs variable selection, and provides investigators with graphical tools for inspecting the properties of selected covariates.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135428777","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Review of Environmental Econometrics Using Stata, by Christopher F. Baum and Stan Hurn 《使用Stata的环境计量经济学综述》,作者:克里斯托弗·f·鲍姆和斯坦·胡恩
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196497
Ryan P. Thombs
In this article, I review Environmental Econometrics Using Stata, by Christopher F. Baum and Stan Hurn (2021, Stata Press).
在这篇文章中,我回顾了Christopher F. Baum和Stan Hurn使用Stata的环境计量经济学(2021年,Stata出版社)。
{"title":"Review of Environmental Econometrics Using Stata, by Christopher F. Baum and Stan Hurn","authors":"Ryan P. Thombs","doi":"10.1177/1536867x231196497","DOIUrl":"https://doi.org/10.1177/1536867x231196497","url":null,"abstract":"In this article, I review Environmental Econometrics Using Stata, by Christopher F. Baum and Stan Hurn (2021, Stata Press).","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135428779","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
cntraveltime: Travel distance and travel time in China 旅行时间:在中国旅行的距离和时间
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196292
Xueren Zhang, Yuan Xue, Chuntao Li
In this article, we introduce the command cntraveltime, which can calculate both the travel distance and the travel time between two locations in China with respect to different modes of transportation (driving, public transport, and cycling). Existing commands such as georoute, traveltime, and mqtime have difficulties in parsing Chinese locations. cntraveltime solves this outstanding challenge via a feature that enables it to call route-planning services from the Baidu Maps Open Platform. The results of rigorous testing on the features of the command show that, relative to similar existing commands, cntraveltime has the highest capacity in terms of functionality and precision. This suggests that it can be regarded as a useful complement to other existing commands, especially when calculating travel distance and time for locations within China.
在本文中,我们介绍了cntraveltime命令,它可以计算不同交通方式(驾驶、公共交通和骑自行车)在中国两个地点之间的旅行距离和旅行时间。现有的命令如georoute、traveltime和mqtime在解析中文位置时存在困难。cntraveltime通过一项功能解决了这个突出的挑战,该功能使它能够从百度地图开放平台调用路线规划服务。对该命令的特征进行严格测试的结果表明,相对于类似的现有命令,cntraveltime在功能和精度方面具有最高的容量。这表明它可以被视为对其他现有命令的有用补充,特别是在计算中国境内位置的旅行距离和时间时。
{"title":"cntraveltime: Travel distance and travel time in China","authors":"Xueren Zhang, Yuan Xue, Chuntao Li","doi":"10.1177/1536867x231196292","DOIUrl":"https://doi.org/10.1177/1536867x231196292","url":null,"abstract":"In this article, we introduce the command cntraveltime, which can calculate both the travel distance and the travel time between two locations in China with respect to different modes of transportation (driving, public transport, and cycling). Existing commands such as georoute, traveltime, and mqtime have difficulties in parsing Chinese locations. cntraveltime solves this outstanding challenge via a feature that enables it to call route-planning services from the Baidu Maps Open Platform. The results of rigorous testing on the features of the command show that, relative to similar existing commands, cntraveltime has the highest capacity in terms of functionality and precision. This suggests that it can be regarded as a useful complement to other existing commands, especially when calculating travel distance and time for locations within China.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135428962","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Speaking Stata: Replacing missing values: The easiest problems 说话状态:替换缺失的值:最简单的问题
2区 数学 Q1 Mathematics Pub Date : 2023-09-01 DOI: 10.1177/1536867x231196519
Nicholas J. Cox
Missing values are common in real datasets, and what to do about them is a large and challenging question. This column focuses on the easiest problems in which a researcher is clear, or at least highly confident, about what missing values should be instead, implying a deterministic replacement. The main tricks are copying values from observation to observation and using the ipolate command. Both may often be extended simply to panel or longitudinal datasets or to other datasets with a group structure, such as data on individuals within families or households. This column includes how to satisfy constraints that interpolation is confined to filling gaps between values known to be equal or to observations moderately close to a known value in time or in some other sequence or position variable.
缺失值在真实数据集中很常见,如何处理它们是一个巨大而具有挑战性的问题。本专栏关注最简单的问题,在这些问题上,研究人员很清楚,或者至少非常自信,缺失的值应该是什么,这意味着一个确定性的替代。主要的技巧是将值从一个观测复制到另一个观测,以及使用ipolate命令。两者通常都可以简单地扩展到面板或纵向数据集或具有组结构的其他数据集,例如家庭或家庭中的个人数据。本专栏包括如何满足这样的约束,即插值仅限于填充已知相等值之间的间隙,或在时间或其他序列或位置变量中与已知值适度接近的观测值。
{"title":"Speaking Stata: Replacing missing values: The easiest problems","authors":"Nicholas J. Cox","doi":"10.1177/1536867x231196519","DOIUrl":"https://doi.org/10.1177/1536867x231196519","url":null,"abstract":"Missing values are common in real datasets, and what to do about them is a large and challenging question. This column focuses on the easiest problems in which a researcher is clear, or at least highly confident, about what missing values should be instead, implying a deterministic replacement. The main tricks are copying values from observation to observation and using the ipolate command. Both may often be extended simply to panel or longitudinal datasets or to other datasets with a group structure, such as data on individuals within families or households. This column includes how to satisfy constraints that interpolation is confined to filling gaps between values known to be equal or to observations moderately close to a known value in time or in some other sequence or position variable.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2023-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"135429098","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Color palettes for Stata graphics: An update Stata图形的调色板:更新
IF 4.8 2区 数学 Q1 Mathematics Pub Date : 2023-06-01 DOI: 10.1177/1536867X231175264
Ben Jann
This article is an update to Jann (2018a, Stata Journal 18: 765–785). It contains a comprehensive discussion of the colorpalette command, including various changes and additions that have been made to the software since its first publication. Command colorpalette provides colors for use in Stata graphics. In addition to Stata’s default colors, colorpalette supports a variety of named colors, a selection of palettes that have been proposed by users, numerous collections of palettes and colormaps from sources such as ColorBrewer, Carto, D3.js, or Matplotlib, as well as color generators in different color spaces. Furthermore, a new command called colorcheck is presented that can be used to evaluate whether colors are distinguishable by people suffering from color vision deficiency.
本文是Jann (2018a, Stata Journal 18: 765-785)的更新。它包含对colorpalette命令的全面讨论,包括自首次发布以来对软件所做的各种更改和添加。命令调色板提供Stata图形中使用的颜色。除了Stata的默认颜色外,colorpalette还支持各种已命名的颜色、用户提出的调色板选择、来自ColorBrewer、Carto、D3.js或Matplotlib等源的大量调色板和颜色映射集合,以及不同颜色空间中的颜色生成器。在此基础上,提出了一种新的颜色检查方法,用于评估色觉缺陷的人是否能够区分颜色。
{"title":"Color palettes for Stata graphics: An update","authors":"Ben Jann","doi":"10.1177/1536867X231175264","DOIUrl":"https://doi.org/10.1177/1536867X231175264","url":null,"abstract":"This article is an update to Jann (2018a, Stata Journal 18: 765–785). It contains a comprehensive discussion of the colorpalette command, including various changes and additions that have been made to the software since its first publication. Command colorpalette provides colors for use in Stata graphics. In addition to Stata’s default colors, colorpalette supports a variety of named colors, a selection of palettes that have been proposed by users, numerous collections of palettes and colormaps from sources such as ColorBrewer, Carto, D3.js, or Matplotlib, as well as color generators in different color spaces. Furthermore, a new command called colorcheck is presented that can be used to evaluate whether colors are distinguishable by people suffering from color vision deficiency.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":4.8,"publicationDate":"2023-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"45687014","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Visualizing uncertainty in a two-dimensional estimate using confidence and comparison regions 利用置信度和比较区域可视化二维估计中的不确定性
IF 4.8 2区 数学 Q1 Mathematics Pub Date : 2023-06-01 DOI: 10.1177/1536867X231175314
Maren Eckert, W. Vach
Recently, Eckert and Vach (2020, Biometrical Journal 62: 598–609) pointed out that both confidence and comparison regions are useful tools to visualize uncertainty in a two-dimensional estimate. Both types of regions can be based on inverting Wald tests or likelihood-ratio tests. confcomptwo enables Stata users to draw both types of regions following one of the two principles for various two-dimensional estimation problems. The use of confcomptwo is illustrated by several examples.
最近,Eckert和Vach (2020, biometic Journal 62: 598-609)指出,置信度和比较区域都是在二维估计中可视化不确定性的有用工具。这两种类型的区域都可以基于反转Wald检验或似然比检验。confcomptwo使Stata用户能够根据两个原则中的一个来绘制两种类型的区域,用于各种二维估计问题。通过几个例子说明了confcomptwo的用法。
{"title":"Visualizing uncertainty in a two-dimensional estimate using confidence and comparison regions","authors":"Maren Eckert, W. Vach","doi":"10.1177/1536867X231175314","DOIUrl":"https://doi.org/10.1177/1536867X231175314","url":null,"abstract":"Recently, Eckert and Vach (2020, Biometrical Journal 62: 598–609) pointed out that both confidence and comparison regions are useful tools to visualize uncertainty in a two-dimensional estimate. Both types of regions can be based on inverting Wald tests or likelihood-ratio tests. confcomptwo enables Stata users to draw both types of regions following one of the two principles for various two-dimensional estimation problems. The use of confcomptwo is illustrated by several examples.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":4.8,"publicationDate":"2023-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"44706138","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Consistent subsets: Computing the Houtman–Maks index in Stata 一致子集:Stata中Houtman-Maks指数的计算
IF 4.8 2区 数学 Q1 Mathematics Pub Date : 2023-06-01 DOI: 10.1177/1536867X231175345
Marcos Demetry, P. Hjertstrand
The Houtman–Maks index is a measure of the size of a violation of utility-maximizing (that is, rational) behavior. In this article, we introduce the command hmindex, which calculates the Houtman–Maks index for a dataset of prices and observed choices of a consumer. The command is illustrated with an empirical application.
Houtman-Maks指数衡量的是违反效用最大化(即理性)行为的规模。在本文中,我们将介绍命令hmindex,它为价格和消费者观察到的选择数据集计算Houtman-Maks指数。该命令用一个经验应用加以说明。
{"title":"Consistent subsets: Computing the Houtman–Maks index in Stata","authors":"Marcos Demetry, P. Hjertstrand","doi":"10.1177/1536867X231175345","DOIUrl":"https://doi.org/10.1177/1536867X231175345","url":null,"abstract":"The Houtman–Maks index is a measure of the size of a violation of utility-maximizing (that is, rational) behavior. In this article, we introduce the command hmindex, which calculates the Houtman–Maks index for a dataset of prices and observed choices of a consumer. The command is illustrated with an empirical application.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":4.8,"publicationDate":"2023-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"46348586","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Stata tip 152: if and if: When to use the if qualifier and when to use the if command Stata提示152:if和if:何时使用if限定符以及何时使用if命令
IF 4.8 2区 数学 Q1 Mathematics Pub Date : 2023-06-01 DOI: 10.1177/1536867x231175349
N. Cox, C. Schechter
Stata has an if qualifier and an if command. Here we discuss generally when you should use either and specifically flag a common pitfall in using the if command. In a nutshell, the pitfall arises from confusing the two constructs: the if command does not loop over the data but, at most, looks in the first observation of a dataset. There has long been a StataCorp FAQ on this topic (Wernow 2005), but we and others have usually tried to explain matters otherwise. This tip is intended as a more durable version of the story that should be easier to find than occasional Statalist postings that are vivid when read but hard to find later.
Stata有一个if限定符和一个if命令。在这里,我们一般讨论何时应该使用其中之一,并特别指出使用if命令时的一个常见陷阱。简言之,这个陷阱源于混淆了这两个结构:if命令不在数据上循环,最多只在数据集的第一次观察中查看。长期以来,StataCorp一直有关于这个主题的常见问题解答(Wernow 2005),但我们和其他人通常会试图以其他方式解释问题。这条提示是作为一个更持久的故事版本,应该比偶尔发布的Statalist帖子更容易找到,这些帖子读起来很生动,但以后很难找到。
{"title":"Stata tip 152: if and if: When to use the if qualifier and when to use the if command","authors":"N. Cox, C. Schechter","doi":"10.1177/1536867x231175349","DOIUrl":"https://doi.org/10.1177/1536867x231175349","url":null,"abstract":"Stata has an if qualifier and an if command. Here we discuss generally when you should use either and specifically flag a common pitfall in using the if command. In a nutshell, the pitfall arises from confusing the two constructs: the if command does not loop over the data but, at most, looks in the first observation of a dataset. There has long been a StataCorp FAQ on this topic (Wernow 2005), but we and others have usually tried to explain matters otherwise. This tip is intended as a more durable version of the story that should be easier to find than occasional Statalist postings that are vivid when read but hard to find later.","PeriodicalId":51171,"journal":{"name":"Stata Journal","volume":null,"pages":null},"PeriodicalIF":4.8,"publicationDate":"2023-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"49499920","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
Stata Journal
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1