consort
Stata社区命令

概述

consort是一个创建流程图的Stata社区命令。

依赖

Stata 16 及以上

shell pip install matplotlib

安装

net install consort, from("https://raw.githubusercontent.com/tpcopeland/Stata-Tools/main/consort")

语法

consort init, initial(string) [file(string)]

示例

* Load full cohort
use _data/cohort.dta, clear
* Initialize the diagram
consort init, initial("Persons with antidepressant dispensing (N=15,000)")
* Apply exclusions
consort exclude if index_age < 18, label("Age < 18 years")
consort exclude if study_exit <= study_entry + 30, ///
    label("Follow-up < 30 days")
consort exclude if missing(education), ///
    label("Missing education data")
* Generate the diagram
consort save, output("consort_diagram.png") ///
    final("Final Analytic Cohort") dpi(300)

作者

姓名:Timothy P Copeland
机构:Department of Clinical Neuroscience, Karolinska Institutet
网页:https://github.com/tpcopeland/Stata-Tools/tree/main/consort

基本信息
词条统计

所属分类社区命令

浏览次数68

创建者epiman

最后编辑epiman

×
CHARLS指标专栏

中国健康与养老追踪调查

CHARLS分析指标一应俱全,不断完善

指标按照特性多重分类,立刻存到收藏夹