STATA-只有OR值的meta分析方法

合集下载

Stata在meta分析中的应用

Stata在meta分析中的应用

1 定量资料两组比较的meta分析2 定性资料两组比较的meta分析实例:分类资料的meta分析为了探讨用Aspirin预防心肌梗塞(myocardial infarction,MI)后死亡的发生。

美国在1976——1988年问进行了7个关于Aspirin预防MI后死亡的研究,详细结果见表1,其中6项研究的结果表明Aspirin组及安慰剂组的MI后死亡率的差别无统计学意义。

只有1项结果表明Aspirin预防MI后死亡有效并且差别有统计学意义。

现根据表1提供的结果进行meta分析表1 Aspirin预防心肌梗塞死亡的临床试验结果研究发表年份Aspirin组安慰剂组总例数死亡例数总例数死亡例数MRC-119746154962467 CDP19767584477164 MRC-21979832102850126 GASP19793173230938 PARIS198AMIS1987219 ISIS-2198885870操作步骤1 把数据输入stata软件2 变量的解释Study 纳入的研究Year 年份Death1 Aspirin组的死亡人数Live1 Aspirin组的存活人数Death2 安慰剂组的死亡人数Live2 安慰剂组的死亡人数3 进行meta分析metan death1 live1 dead2 live2, or label(namevar=study, yearvar=year)结果:以上结果分成两部分(1)meta分析的合并统计量合并OR值OR=0.897,95%的可信区间(0.841,0.957)(2)给出异质性检验的结果只要异质性检验的P值不小于0.10(或者I-squared小于50%)就可以认为不存在异质性,可以用应固定效应模型(stata默认的情况)。

如果质性检验的P值小于等于0.10(或者I-squared大于50%),则不同的组间存在异质性,应该应用随机效应模型随机效应模型的命令如下:metan death1 live1 dead2 live2, or label(namevar=study, yearvar=year) random在运行meta分析命令的同时stata输出森林图,如下:由输出的合并结果和漏斗图可以得出,合并的OR值为0.90,95%可信区间为(0.84,0.96)4 发表偏倚的检验,命令如下:(1) gen logor=log(_ES)(2)gen selogor=_selogES(3)metabias logor selogor,graph(begg)输出结果如下:发表偏倚主要看begg检验的结果,由上图可以看到发表偏倚假设检验的z值为1.20,p值为0.230>0.05,可以认为没有发表偏倚。

有关stata操作

有关stata操作

先是实验组存活,实验组死亡。

然后是对照组。

Count:二分类变量/计数资料Continuous:连续性变量/计量资料Effect/CI:效应量/可信区间Effect/SE:效应量/标准误八种基本图形的制作: 直方图(histogram) ,条形图(bar), 百分条图(oneway) ,百分圆图(pie) ,散点图(twoway) ,散点图矩阵(matrix) ,星形图(star)齐性的(Homogeneity)常用命令::Help metanHelp metacumHelp metainfHelp metabias 偏倚分析Help metareg meta回归针对每一个研究的回归,而不是对象的回归。

二分类变量二分类变量:实验组的死亡、存活;对照组的死亡、存活连续性变量的数据输入是::实验组的例数、均数、标准差;再是对照组的例数、均数、标准差。

检测发表偏倚性:二分类变量实验组例数,总例数;对照组例数,总例数gen alive1=tot 1-cases1gen logrr=log(_ES)漏斗图的中间变量下一个命令就是:help metabias连续性变量:::异质性的来源:则量指标的方法不同;种族、国籍等,更应该从专业角度分析meta回归、亚组分析重要的问题:能够改变治疗策略的问题。

勤于思考Meta统计分析可以分为确定性模型分析方法和随机模型分析方法。

较常用的确定性模型Meta分析有Mantel-Haeszel统计方法(仅适用于效应指标为OR)和General-Variance-Based统计方法。

然而所有的确定性模型统计方法都要求Meta分析中的各个研究的总体效应指标(如:两组均数的差值等)是相等的,并称为齐性的(Homogeneity),而随机模型对效应指标没有齐性要求。

因此Meta分析可以采用下列分析策略:1)如果各个研究的效应指标是齐性的,则选用确定性模型统计方法:OR,则采用Mantel-Haeszel统计方法新市场营销法则助推企业成长电子商务营销食品餐饮营销建筑房产营销消费品营销确定性模型进行解释的,则采用随机模型进行Meta统计分析。

STATA-只有OR值的meta分析方法

STATA-只有OR值的meta分析方法

Test of OR=1 : z= 0.13 p = 0.894
Study Ling G Chen S Park JY
Overall
.020438
Forest plot
Odds ratio (95% CI)
% Weight
2.36 ( 0.90, 6.17) 42.2 0.44 ( 0.19, 1.03) 44.3 1.98 ( 0.08, 48.93) 13.6 1.10 ( 0.28, 4.32) 100.0
理软件、统计分析软件、绘图软件、矩阵计算 软件和程序语言的特点 。
STATA的进入和退出
进入:双击STATA软件图标
退出:菜单方式: File→Exit 窗口方式 命令方式:exit
STATA的用户界面
菜单和工具栏
命令回顾
变量列表
结果输出 命令输入
STATA数据管理
• 数据的输入与储存 • 数据库的排序 • 删除变量或记录 • 保留变量或记录 • 产生新变量 • 替换已存在的变量值
M-H pooled OR
| 1.233
1.035
1.469
100.00
---------------------+----------------------------------------------
Heterogeneity chi-squared = 2.61 (d.f. = 5) p = 0.760 I-squared (variation in OR attributable to heterogeneity) = Test of OR=1 : z= 2.34 p = 0.019
Test of OR=1 : z= 0.10 p = 0.923

手把手教你用Stata进行Meta分析Meta简明教程(7)

手把手教你用Stata进行Meta分析Meta简明教程(7)

手把手教你用Stata进行Meta分析Meta简明教程(7)Meta简明教程目录1. 认识一下meta方法! | Meta简明教程(1)2. 一文初步学会Meta文献检索| Meta简明教程(2)3. 如何搞定“文献筛选” | Meta简明教程(3)4.Meta分析文献质量评价 | Meta简明教程(4)5.Meta分析数据提取| Meta简明教程(5)6.一文学会revman软件| Meta简明教程(6)Meta简明教程(7)上一期介绍了Revman 软件对二分类数据、连续型数据、诊断性试验数据、生存-时间数据进行meta分析,本期将利用Stata对以上数据进行meta分析。

大家可以到本公众号下载Stata软件(重磅推荐:分类最全的统计分析相关软件,了解一下?请关注、收藏以备用)Stata12.0 界面一、二分类数据分析数据形式例:研究阿司匹林(aspirin)预防心肌梗死(MI)7个临床随机对照试验,观察死亡率,数据提取如下:操作步骤1.构建数据1)启动Stata 12.0 软件后,可以直接点击工具栏中DataEditor (edit)按钮。

也可在在菜单栏中点击Data→Data Editor→ DataEditor (edit),出现以下界面。

2)点击变量名位置,依次输入研究名称(research),阿司匹林组死亡数(a),阿司匹林组存活数(b),安慰剂组死亡数(c),安慰剂组存活数(d)3)录入数据:在变量值区域输入数据2. 数据分析1)导入meta模块:在Command窗口中进行编程,首先需要在Stata中安装meta 模块:在Command窗口输入“ssc install metan”,选中点回车。

结果窗口中出现下面的结果,说明已经安装了meta模块。

2)输入meta分析代码:在Command窗口输入“Command窗口输入“metan a b c d, or fixed”,点回车,完成结果分析。

meta分析stata演示文稿

meta分析stata演示文稿

数据
计量资料
亚组分析---design
亚组分析---location
随机效应模型,异质性太大
漏斗图
ES:效应量(例如血糖下降变 seES:效应量的标准误
直接复制,可得白色的图
WMD
Begg's funnel plot with pseudo 95% confidence limits .5
Stata软件实现步骤
基线数据的录入与导入; 菜单操作或者编写程序; 生成森林图以及所需要的图形; 数均值、标准差,一篇文献,低中高剂量
Wmd 单位统一 ,加权均值,如血糖的单位都是 mmol/l
Msd 标准化均值
wmd
森林图操作步骤
发表的文献中符合要求的数据进行合并,计算出其 合并效应。
举例说明
1、计量资料的meta分析
运动、饮食与降空腹血糖 检索文献、检索词筛选出80-90篇 读摘要筛选30-40篇,精读剩下12篇 State软件做分析,得出合并效应森林图
检索文献流程图
合并效应森林图
几个关键的步骤
文献的纳入与排除(检索策略与纳入标准); 纳入文献的质量评估(几种评估量表); 森林图的生成与亚组分析(合并效应WMD,SMD); 漏斗图的制作及其意义;
前瞻性RR 回顾性OR
表2.1 Aspirin预防心梗死亡的临床试验结果基线情况
study year
Aspirin group
Placebo group
total
death
total
death
MRC-1 1974
615
49
624
67
CDP 1976
758
44
771
64

stata软件meta分析操作详细攻略报告

stata软件meta分析操作详细攻略报告

试验组 样本数
试验组 均数
试验组 标准差
对照组 样本数
对照组 均数
对照组 标准差
作者
发表年份
2021/3/7
CHENLI
13
*
2.3 metan菜单命令
计数资料 连续性资料
效应量
效应量的标 准误
研究标签
命令输入
年份标签
亚组分析
按某种顺序排 列
2021/3/7
CHENLI
14
*
2.3 metan菜单命令
202Байду номын сангаас/3/7
*
调整统计量Z值及 P值。
CHENLI
33
logor
5.2 Begg法漏斗图
Begg's funnel plot with pseudo 95% confidence limits 4
2
0
-2 0
2021/3/7
*
.5
1
s.e. of: logor
CHENLI
1.5
34
5.3 Begg法检测发表偏倚(连续性)
2021/3/7
CHENLI
4
*
1.1 stata软件简介
相对RevMan而言,Stata的Meta分析功能更全面和强 大,该软件除了可以完成二分类变量和连续性变量的Meta 分析,也可以进行Meta回归分析、 累积Meta分析、单个 研究影响分析、诊断试验的Meta分析、剂量反应关系 Meta分析、生存分析资料合并等几乎所有Meta分析方法。
连续性资料的不 用取对数
图形显示依据 权重大小
2021/3/7
CHENLI
35
*

有关stata操作

先是实验组存活,实验组死亡。

然后是对照组。

Count:二分类变量/计数资料Continuous:连续性变量/计量资料Effect/CI:效应量/可信区间Effect/SE:效应量/标准误八种基本图形的制作: 直方图(histogram) ,条形图(bar), 百分条图(oneway) ,百分圆图(pie) ,散点图(twoway) ,散点图矩阵(matrix) ,星形图(star)齐性的(Homogeneity)常用命令::Help metanHelp metacumHelp metainfHelp metabias 偏倚分析Help metareg meta回归针对每一个研究的回归,而不是对象的回归。

二分类变量二分类变量:实验组的死亡、存活;对照组的死亡、存活连续性变量的数据输入是::实验组的例数、均数、标准差;再是对照组的例数、均数、标准差。

检测发表偏倚性:二分类变量实验组例数,总例数;对照组例数,总例数gen alive1=tot 1-cases1gen logrr=log(_ES)漏斗图的中间变量下一个命令就是:help metabias连续性变量:::异质性的来源:则量指标的方法不同;种族、国籍等,更应该从专业角度分析meta回归、亚组分析重要的问题:能够改变治疗策略的问题。

勤于思考Meta统计分析可以分为确定性模型分析方法和随机模型分析方法。

较常用的确定性模型Meta分析有Mantel-Haeszel统计方法(仅适用于效应指标为OR)和General-Variance-Based统计方法。

然而所有的确定性模型统计方法都要求Meta分析中的各个研究的总体效应指标(如:两组均数的差值等)是相等的,并称为齐性的(Homogeneity),而随机模型对效应指标没有齐性要求。

因此Meta分析可以采用下列分析策略:1)如果各个研究的效应指标是齐性的,则选用确定性模型统计方法:OR,则采用Mantel-Haeszel统计方法新市场营销法则助推企业成长电子商务营销食品餐饮营销建筑房产营销消费品营销确定性模型进行解释的,则采用随机模型进行Meta统计分析。

Stata软件在诊断性研究的meta分析中的命令

Stata软件在诊断性研究的meta分析中的命令在诊断性研究的meta分析中可以计算合并阳性似然比、合并阴性似然比、诊断OR值、ROC值、SROC曲线、HSROC-bivariate meta-analysis等。

Stata进行诊断研究meta分析时的起始命令:*Variable codes: tp=true positives; fp=false positives; tn=true negatives;fn=false negatives*add .5 to all zero cellsgen zero=0replace zero=1 if tp==0|fp==0|fn==0|tn==0replace tp=tp+.5 if zero==1replace fp=fp+.5 if zero==1replace fn=fn+.5 if zero==1replace tn=tn+.5 if zero==1gen tpr= tp/(tp+fn)gen fpr=fp/(fp+tn)gen logittpr=ln(tp/fn)gen logitfpr=ln(fp/tn)gr7 tpr fpr, s(O) noaxis ysize(6) xsize(6) xline(0(.1)1) yline(0(.1)1) tlab(0(.1)1) xlab(0(.1)1) ylab(0(.1)1) t1(1-Specificity) l1(Sensitivity) b2(1-Specificity) b1(ROC Plot of Sensitivity vs Specificity)gr7 logittpr logitfprspearman logittpr logitfpr1.1 合并阳性似然比命令:metan tp fn fp tn, rr random nowt sortby(author) xlab(.01,1,100) label(namevar=author, yearvar=pubyear) t1(Summary LR+, Random Effects)2.2 合并阴性似然比命令:metan fn tp tn fp, rr random nowt sortby(author) xlab(.01,1,100) label(namevar=author, yearvar=pubyear) t1(Summary LR-, Random Effects)2.3 合并诊断OR值命令:metan tp fn fp tn, or random nowt sortby(author) xlab(.01,1,100) label(namevar=author, yearvar=pubyear) t1(Summary Diagnostic Odds Ratio, Random Effects)2.4 ROC值命令:gr7 tpr fpr, s(O) noaxis ysize(6) xsize(6) xline(0(.1)1) yline(0(.1)1) tlab(0(.1)1) xlab(0(.1)1) ylab(0(.1)1) t1(1-Specificity) l1(Sensitivity) b2(1-Specificity) b1(ROC Plot of Sensitivity vs Specificity)2.5 SROC曲线命令:gen sum= logittpr+ logitfprgen diff= logittpr- logitfprregress diff sumpredict yhatgr7 diff yhat sum, ylab(3,4,5,6,7,8) xlab(-4,-3,-2,-1,0,1,2) c(.l) s(oi)gen tse=1/(1+(1/(exp(_cons/1-_b)*(fpr/spec)^1+_b/1-_b)))(constant and b are derived from the above regression model)*plot SROC curve (generic)gr7 se tse fpr, ysize(6) xsize(6) noaxis xline(0(.1)1) yline(0(.1)1) tlab(0(.1)1) xlab(0(.1)1)ylab(0(.1)1) s(Oi) c(.s) l1(Sensitivity) b2(1-Specificity) ti(Summary ROC Curve) key1(" ")key2(" ")2.6 HSROC-bivariate meta-analysis命令:metandi tp fp fn tn, plot (基于SROC命令)2.7 发表偏倚命令:gen or=(tp*tn)/(fp*fn)gen lnor=ln(or)gen selnor=(1/tp)+(1/fp)+(1/fn)+(1/tn)*Begg and Egger test for publication bias with Begg's funnel plot: metabias lnor selnor, graph(begg)*Begg and Egger tests for subgroups (eg. Covariate=1)metabias lnor selnor if covariate==1, graph(begg)。

Stata软件实现meta分析

Both the output and the graph show that there is a clear effect of streptokinase in protecting against death following myocardial infarction. The meta-analysis is dominated by the large GISSI-12and ISIS-23trials which contribute 76·2% of the weight in this analysis. If required, the text showing the weights or treatment effects may be omitted from the graph (options nowt and nostats, respectively). The metan command will perform all the commonly used fixed effects (inverse variance method, Mantel–Haenszel method and Peto’s method) and random effects (DerSimonian and Laird) analyses. These methods are described in Chapter 15. Commands labbe to draw L’Abbé plots (see Chapters 8 and 10) and funnel to draw funnel plots (see Chapter 11) are also included. 352Note that meta performs both fixed and random effects analyses by default and the tabular output includes the weights from both analyses. It is clear that the smaller studies are given relatively more weight in the random effects analysis than with the fixed effect model. Because the meta command requires only the estimated treatment effect and its standard error, it will be particularly useful in meta-analyses of studies in which the treatment effect is not derived from the standard 2 ×2 table. Examples might include crossover trials, or survival trials, when the treatment effect might be measured by the hazard ratio derived from Cox regression. Example 2: intravenous magnesium in acute myocardial infarction The following table gives data from 16 randomised controlled trials of intravenous magnesium in the prevention of death following myocardial infarction. These trials are a well-known example where the results of a meta-analysis8were contradicted by a single large trial (ISIS-4)9–11(see also Chapters 3 and 11).355Dealing with zero cellsWhen one arm of a study contains no events – or, equally, all events – we have what is termed a “zero cell” in the 2 ×2 table. Zero cells create problems in the computation of ratio measures of treatment effect, and the standard error of either difference or ratio measures. For trial number 8 (Bertschart), there were no deaths in the intervention group, so that the estimated odds ratio is zero and the standard error cannot be estimated. A common way to deal with this problem is to add 0·5 to each cell of the 2 ×2 table for the trial. If there are no events in either the intervention or control arms of the trial, however, then any measure of effect summarised as a ratio is undefined, and unless the absolute (risk difference) scale is used instead, the trial has to be discarded from the meta-analysis.The metan command deals with the problem automatically, by adding 0·5 to all cells of the 2 ×2 table before analysis. For the commands which require summary statistics to be calculated (meta,metacum,metainf, metabias and metareg) it is necessary to do this, and to drop trials with no events or in which all subjects experienced events, before calculating the treatment effect and standard error.To drop trials with no events or all events:drop if dead1==0&dead0==0drop if dead1==tot1&dead0==tot0357By the late 1970s, there was clear evidence that streptokinase prevented death following myocardial infarction. However it was not used routinely until the late 1980s, when the results of the large GISSI-1 and ISIS-2 trials became known (see Chapter 1). The cumulative meta-analysis plot makes it clear that although these trials reduced the confidence interval for the summary estimate, they did not change the estimated degree of protection.Examining the influence of individual studiesThe influence of individual studies on the summary effect estimate may be displayed using the metainf command.15This command performs an influence analysis, in which the meta-analysis estimates are computed omitting one study at a time. The syntax for metainf is the same as that for the meta command. By default, fixed-effects analyses are displayed. Let’s perform this analysis for the magnesium data:metainf logor selogor, eform id (trialnam)361The label above the vertical axis indicates that the treatment effect estimate (here, log odds ratio) has been exponentiated. The meta-analysis is dominated by the ISIS-4 study, so omission of other studies makes little or no difference. If ISIS-4 is omitted then there appears to be a clear effect of magnesium in preventing death after myocardial infarction.Funnel plots and tests for funnel plot asymmetryThe metabias command16,17performs the tests for funnel-plot asymmetry proposed by Begg and Mazumdar18and by Egger et al.11(see Chapter 11). If the graph option is specified the command will produce either a plot of standardized effect against precision11(graph(egger)) or a funnel plot (graph(begg)). For the magnesium data there is clear evidence of funnel plot asymmetry if the ISIS-4 trial is included. It is of more interest to know if there was evidence of bias before the results of the ISIS-4 trial were known. Therefore in the following analysis we omit the ISIS-4 trial:metabias logor selogor if trial<16, graph(begg)Note: default data input format (theta, se_theta) assumed.if trialno < 16362The funnel plot appears asymmetric, and there is evidence of bias using the Egger (weighted regression) method (P for bias 0·007) but not using the Begg (rank correlation method). This is compatible with a greater statistical power of the regression test, as discussed in Chapter 11. The horizontal line in the funnel plot indicates the fixed-effects summary estimate (using363To use the metareg command, we need to derive the treatment effect estimate (in this case log risk ratio) and its standard error, for each study.generate logrr=log((cases1/tot1)/(cases0/tot0)) generate selogrr=sqrt((1/cases1)-(1/tot1)+(1/cases0)-(1/tot0))In their meta-analysis, Colditz et al. noted the strong evidence for heterogeneity between studies, and concluded that a random-effects meta-analysis was appropriate:meta logrr selogrr, eformMeta-analysis (exponential form)Pooled95% CI Asymptotic No. ofies MethodEst Lower Upper z_value p_value stud Fixed0.6500.6010.704-10.6250.00013 Random0.4900.3450.695-3.9950.000Test for heterogeneity: Q= 152.233 on 12 degrees of freedom (p= 0.000)Moment-based estimate of between studies variance = 0.309366。

Stata率的meta分析

用stata软件做单个样本率的meta分析
本实例采用的数据是本人的另一个贴子用的数据是这个贴子中我能用stata做患病率的meta分析了,大家交流交流啊 - 丁香园论坛中网友在别的文章中看到并上传的一个森林图:
这个森林图中的数据其实不太好,因为异质性太大,但数据简单,也就给大家摸拟一下。

重要的是知道怎样用stata软件做单样本率meta 分析就可以了。

在stata中要做meta分析,最重要的就是要知道两个变量,一个是ES也就是效应量,另一个是seES,也就效应量,所有关于率的meta,做meta的关键也就是如何去寻找这两个东东了,
我这里采用的就是直接用率做为ES,而ES的标准误其实也不难求出,大家可以看看孙振球教授《医学统计学》中的这个例子或许会有所启发:如下图
这个是基于正态近似法的公式,在样本量较,数据正态时使用,这算ES 的标准误也是如用的这个公式
下面开始具体操作:
1,输入数据,数据的格式是study,率,以及样本量
第二步:generate ser=sqrt(r*(1-r)/n)
3,用随机效应模型进行分析命令如下:metan r ser, random label(namevar=study)
继续
4,输入如下命令得到漏斗图:metafunnel r ser。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Meta-analysis in Stata
柏建岭 南京医科大学公共卫生学院流统系
STATA简介
• 由美国计算机资源中心(Computer Resource Center)研制;
• 现在为Stata公司的产品; • 目前最高版本9.0; • 与SAS、SPSS一起并称为三大权威统计软件。 • 操作灵活、简单、易学易用,同时具有数据管
28
69
166 499
39 159
58 197
6 848
20
41
0 145
13 130
Stata result
metan casec casea controlc controla if country=="European",or label(namevar=study)
metan a b c d,or label(namevar=study)
% Weight
---------------------+----------------------------------------------
Ling G
| 2.358
0.902
6.166
42.15
Chen S
| 0.442
0.190
1.027
44.27
Park JY
| 1.980
0.080 48.927
0.0%
Forest plot
Study Mis ra RR Hou SM Zhou W Spitz MR David-Beabes GL1 David-beabes GL2
Overall
.306890
1 Odds ratio
Odds ratio (95% CI)
% Weight
1.06 ( 0.66, 1.71) 14.6
Test of OR=1 : z= 0.13 p = 0.894
Study Ling G Chen S Park JY
Overall
.020438
Forest plot
Odds ratio (95% CI)
% Weight
2.36 ( 0.90, 6.17) 42.2 0.44 ( 0.19, 1.03) 44.3 1.98 ( 0.08, 48.93) 13.6 1.10 ( 0.28, 4.32) 100.0
13.57
---------------------+----------------------------------------------
D+L pooled OR
| 1.097
0.279
4.316
100.00
---------------------+----------------------------------------------
The following new variables to the data set
_ES
Effect size (ES)
_seES Standard error of ES
or, when OR or RR are specfied:
_selogES the standard error of its logarithm
有变量 (包括x1和x3) /* 删去x<0的所有记录 /* 删去第1~3个记录 /* 删去x为缺失值的所有记录 /* 删去x或y之一为缺失值的所有记录 /* 删去x和y同时为缺失值的所有记录 /* 删掉数据库中所有变量和数据
保留变量或记录
•keep in 1/5 •keep x1-x3
•keep if x>0
Test of OR=1 : z= 0.10 p = 0.923
Stata result
metan casec casea controlc controla if country=="Asian",or label(namevar=study) random
Study
| OR [95% Conf. Interval]
➢ sort x ➢ gsort x ➢ gsort -x
对变量x中数值从小到大进行排列 对变量x中数值从小到大进行排列 对变量x中数值从大到小进行排列
删除(或保留)变量或记录
删除变量或记录 drop varlist drop if exp drop in range
保留变量或记录 keep varlist keep if exp keep in range [if exp]
数据的输入与存储
• 数据输入 – 数据编辑窗口; – 复制和粘贴。
• 数据储存 – save命令 – FileSave As
数据编辑窗口
数据编辑按钮 窗口
使用数据编辑窗口输入
每一列代表一个 变量
每一行代表一条 记录
数据库的排序
sort 变量名1 变量名2 …… gsort +/- 变量清单
–replace age = 25 in 2 /* 将第2条记录中的变量age替换为25。
Fixed and random effects meta-analysis
metan varlist [if exp] [in range] [, rr or rd fixed random fixedi randomi peto by(byvar) label(namevar=name, yearvar=year)]
1.11 ( 0.61, 2.04)
8.8
1.17 ( 0.91, 1.50) 50.2
1.36 ( 0.84, 2.20) 12.7
1.72 ( 1.04, 2.86)
9.7
1.39 ( 0.59, 3.26)
3.9
1.23 ( 1.03, 1.47) 100.0
3.25849
Stata result
_LCI Lower confidence limit for ES
_UCI Upper confidence limit for ES
_WT Study percentage weight
_SS
Study sample size
Example 1
Study
Misra RR Hou SM Zhou W Spitz MR David-Beabes GL1 Ling G Chen S Park JY David-beabes GL2
/* 产生新变量y,其值为所有x>0的对数 log(x),当x<=0时,用缺失值代替。
替换已存在的变量值
replace 变量=表达式
–replace bolck=6 if block==0 /* 将block=0的数全部替换为6。
–replace z=. if z<0 /* 将所有小于0的z值用缺失值代替。
理软件、统计分析软件、绘图软件、矩阵计算 软件和程序语言的特点 。
STATA的进入和退出
进入:双击STATA软件图标
退出:菜单方式: File→Exit 窗口方式 命令方式:exit
STATA的用户界面
菜单和工具栏
命令回顾
变量列表
结果输出 命令输入
STATA数据管理
• 数据的输入与储存 • 数据库的排序 • 删除变量或记录 • 保留变量或记录 • 产生新变量 • 替换已存在的变量值
metan casec casea controlc controla if country=="Asian",or label(namevar=study)
Study
| OR [95% Conf. Interval]
% Weight
---------------------+---------------------------------------------
Heterogeneity chi-squared = 6.81 (d.f. = 2) p = 0.033 I-squared (variation in OR attributable to heterogeneity) = 70.6% Estimate of between-study variance Tau-squared = 0.9175
Ling G
| 2.358
0.902
6.166
25.55
Chen S
| 0.442
0.190
1.027
71.85
Park JY
| 1.980
0.080 48.927
2.60
---------------------+---------------------------------------------
M-H pooled OR
| 1.233
1.035
1.469
100.00
---------------------+----------------------------------------------
Heterogeneity chi-squared = 2.61 (d.f. = 5) p = 0.760 I-squared (variation in OR attributable to heterogeneity) = Test of OR=1 : z= 2.34 p = 0.019
Study
| OR [95% Conf. Interval]
% Weight
---------------------+----------------------------------------------
Misra RR
| 1.060
相关文档
最新文档