Copyright
©The Author(s) 2015.
World J Meta-Anal. Oct 26, 2015; 3(5): 215-224
Published online Oct 26, 2015. doi: 10.13105/wjma.v3.i5.215
Published online Oct 26, 2015. doi: 10.13105/wjma.v3.i5.215
Table 2 Example of SAS code to simulate a meta-analysis on 15 datasets with 15 records generated from a Gamma distribution (alpha = 2 and beta = 5 vs alpha = 2 and beta = 7 for the treatment and control groups, respectively)
* q is the assigned library; |
**************************************************; |
* SIMULATIONS; |
**************************************************; |
%let s = gamma; |
%let ndset = 15; |
* Simulation of n = 15 dataset using the Gamma distributions; |
%macro simul; |
%do q = 1 %to &ndset; |
%let seed = %sysevalf(1234567 + &q); |
%let num_i = %sysevalf(&ndset); |
%let v = %sysevalf(0 + &q); |
data s&q; |
k = &q; |
%do i = 1%to &num_i; |
var1 = 5*rangam(&seed,2); |
var2 = 7*rangam(&seed,2); |
output; |
%end; |
run; |
%end; |
* Dataset combining; |
data simul_&s; |
set |
%do w = 1%to &ndset; |
s&w |
%end; |
; |
run; |
%mend; |
%simul; |
* Descriptive statistics for each dataset; |
ods trace on; |
ods output summary = summary_&s; |
proc means data = simul_&s mean std median q1 q3; |
class k; |
var var1 var2; |
run; |
ods trace off; |
data summary_&s; |
set summary_&s; |
l1 = (var1_Median-var1_Q1)/0.6745; |
l2 = (var2_Median-var2_Q1)/0.6745; |
u1 = (var1_Q3-var1_Median)/0.6745; |
u2 = (var2_Q3-var2_Median)/0.6745; |
if l1 > u1 then MeSD_v1_cons=l1; else MeSD_v1_cons=u1; |
if l2 > u2 then MeSD_v2_cons=l2; else MeSD_v2_cons=u2; |
if l1 > u1 then MeSD_v1_prec=u1; else MeSD_v1_prec=l1; |
if l2 > u2 then MeSD_v2_prec=u2; else MeSD_v2_prec=l2; |
MeSD_v1_mean=(var1_Q3-var1_Q1)/1.349; |
MeSD_v2_mean=(var2_Q3-var2_Q1)/1.349; |
* Median difference; |
MeD = var1_Median-var2_Median; |
*1 conservative estimate of standard deviation; |
a1sd = ((MeSD_v1_cons)**2)/NObs; |
b1sd = ((MeSD_v2_cons)**2)/NObs; |
MeSD_cons=sqrt(a1sd + b1sd); |
*2 less conservative estimate of standard deviation; |
a2sd = ((MeSD_v1_prec)**2)/NObs; |
b2sd = ((MeSD_v2_prec)**2)/NObs; |
MeSD_prec = sqrt(a2sd + b2sd); |
*3 mean estimate of standard deviation; |
a3sd = ((MeSD_v1_mean)**2)/NObs; |
b3sd = ((MeSD_v2_mean)**2)/NObs; |
MeSD_mean = sqrt(a3sd + b3sd); |
*4 Interquartile range; |
a4sd = ((var1_Q3-var1_Q1)**2)/NObs; |
b4sd = ((var2_Q3-var2_Q1)**2)/NObs; |
MeSD_iqr = sqrt(a4sd + b4sd); |
* Mean difference and pooled standard deviation; |
MD = var1_Mean-var2_Mean; |
asd = ((var1_StdDev)**2)/NObs; |
bsd = ((var2_StdDev)**2)/NObs; |
SD = sqrt(asd + bsd); |
drop l1 l2 u1 u2 asd bsd a1sd b1sd a2sd b2sd a3sd b3sd a4sd b4sd; |
run; |
*************************; |
* Meta-analyses; |
data sum_&s; |
set summary_&s; |
keep k NObs MeD MeSD_cons MeSD_prec MeSD_mean MeSD_iqr MD SD qq; |
run; |
*1 Median and conservative estimate of standard deviation; |
data meta_&s.1; |
set sum_&s; |
model = "Conservative SD"; |
MDz = MeD; |
SDz = MeSD_cons; |
w = 1/(SDz**2); |
MDw = MDz*w; |
keep model k NObs MDz SDz w MDw; |
run; |
*2 Median and less conservative estimate of standard deviation; |
data meta_&s.2; |
set sum_&s; |
model = "Less Conservative SD"; |
MDz = MeD; |
SDz = MeSD_prec; |
w = 1/(SDz**2); |
MDw = MDz*w; |
keep model k NObs MDz SDz w MDw; |
run; |
*3 Median and mean estimate of standard deviation; |
data meta_&s.3; |
set sum_&s; |
model = "Mean SD"; |
MDz = MeD; |
SDz = MeSD_mean; |
w = 1/(SDz**2); |
MDw=MDz*w; |
keep model k NObs MDz SDz w MDw; |
run; |
*4 Median and interquartile range; |
data meta_&s.4; |
set sum_&s; |
model = "IQR"; |
MDz = MeD; |
SDz = MeSD_iqr; |
w = 1/(SDz**2); |
MDw = MDz*w; |
keep model k NObs MDz SDz w MDw; |
run; |
*Mean and standard deviation (reference); |
data meta_&s.5; |
set sum_&s; |
model = "Reference"; |
MDz = MD; |
SDz = SD; |
w = 1/(SDz**2); |
MDw = MDz*w; |
keep model k NObs MDz SDz w MDw; |
run; |
proc format; |
value model |
1 = "conservative SD" |
2 = "Less Conservative SD " |
3 = "Mean SD " |
4 = "IQR" |
5 = "Reference" |
; |
run; |
*** Fixed effect model meta-analysis - Inverse of Variance method; |
%macro meta_iv; |
%do i = 1%to 5; |
ods output Summary = somme&i; |
proc means data = meta_&s&i sum; |
var MDw w; |
run; |
data somme&i; |
set somme&i; |
model = &i; |
format model model.; |
theta = MDw_Sum/w_Sum; |
se_theta = 1/(sqrt(w_sum)); |
lower = theta - (se_theta*1.96); |
upper = theta + (se_theta*1.96); |
mtheta = sqrt(theta**2); |
CV = se_theta/mtheta; |
keep model theta se_theta lower upper cv; |
run; |
%end; |
data aaMeta_&s; |
set |
%do w = 1% to 5; |
somme&w |
%end; |
; |
run; |
title "distr = &s - k = &ndset"; |
proc print; run; |
%mend; |
%meta_iv; |
- Citation: Greco T, Biondi-Zoccai G, Gemma M, Guérin C, Zangrillo A, Landoni G. How to impute study-specific standard deviations in meta-analyses of skewed continuous endpoints? World J Meta-Anal 2015; 3(5): 215-224
- URL: https://www.wjgnet.com/2308-3840/full/v3/i5/215.htm
- DOI: https://dx.doi.org/10.13105/wjma.v3.i5.215