Date: Wed, 30 Oct 2002 10:01:57 +0100
Reply-To: Asesoría Bioestadística
<bioestadistica@eresmas.net>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Asesoría Bioestadística
<bioestadistica@eresmas.net>
Subject: Re: TROUBLE WITH SYNTAX (second answer)
Content-Type: text/plain; charset=us-ascii
Hi Jeff:
I have taken a closer look at your code. Try this modification
*first open the file to be used for analysis
*Second, compute the number in each gender who are PTSD+
*Third, compute the number in each gender that are negative
COMPUTE mpos = RND(pwnm * (pctmale / 100)).
COMPUTE fpos = RND(pwnf * (pctfem / 100)).
COMPUTE mneg = pwnm - mpos.
COMPUTE fneg = pwnf - fpos.
EXECUTE .
* Data modification by pseudo count method *.
DO IF ((fpos=0) OR (mpos=0)).
COMPUTE fpos=fpos+1/2.
COMPUTE mpos=mpos+1/2.
COMPUTE fneg=mneg+1/2.
COMPUTE mneg=mneg+1/2.
END IF.
EXECUTE.
DO IF ((mneg=0) OR (fneg=0)).
COMPUTE mpos=mpos-1/2.
COMPUTE mneg=mneg+1/2.
COMPUTE fpos=fpos-1/2.
COMPUTE fneg=fneg+1/2.
END IF.
EXECUTE.
* Now, the data are ready for statistical analysis .
* I THINK THE PROBLEM IS HERE.
* YOU SOULD SAVE THE MODIFIED DATA, AND YOU DON'T.
SAVE OUTFILE='C:\temp\metadata.sav'
/KEEP=author mpos mneg fpos fneg
/COMPRESSED.
MATRIX.
PRINT /TITLE ' META-ANALYSIS: ODDS RATIO (RANDOM-EFFECTS MODEL)'.
GET DATA
/FILE='C:\temp\metadata.sav'
/NAMES=NAMEVEC
/missing =OMIT
/sysmis=omit.
print data /format="f10.2"
/title=' Author Males+ Males- Females+
Females-'.
get Author.
get mpos.
get mneg.
get fpos.
get fneg.
compute summpos=msum(mpos).
compute summneg=msum(mneg).
compute sumfpos=msum(fpos).
compute sumfneg=msum(fneg).
compute n=nrow(mpos).
compute orr=(fpos&*mneg)&/(mpos&*fneg).
compute selog=sqrt((1/mpos)+(1/mneg)+(1/fpos)+(1/fneg)).
compute wi=(1/selog)&**2.
compute di=ln(orr).
compute cilow=exp(di-1.96&*selog).
compute ciup=exp(di+1.96&*selog).
compute report={orr,selog,cilow,ciup}.
print report
/format="f10.3"
/title=' Odds Ratio se(log) 95%Low CL 95%Upper CL'.
compute dp=sum(wi&*di)/sum(wi).
compute hetchi=sum(wi&*(di-dp)&**2).
compute hetsig=1-chicdf(hetchi,n-1).
print /title='Heterogeneity before taking Tau-square into
consideration'.
print hetchi
/format="f8.4"
/title="Cochran Q chi-square of heterogeneity statistic (df=n-1)".
print hetsig
/format="f8.3"
/title="Significance of Chi-square (H0: Homogeneity)".
compute tau=(hetchi-n-1)/(sum(wi)-(sum(wi&**2))/sum(wi)).
do if tau>0.
compute tau2=tau.
print tau2 /format="f8.3" /title='Tau-square (between trials
variance)'.
else if tau<=0.
compute tau2=0.
print /title='Tau-square=0 (random- & fixed-effect models will yield'
+' identical results)'.
end if.
compute vartilda=tau2+selog&**2.
compute wi=1/vartilda.
compute percwi=100*wi&/sum(wi).
compute num=sum(wi&*di).
compute den=sum(wi).
compute delaiorr=exp(num/den).
compute sedelai=1/sqrt(den).
compute cilowdl=exp((num/den)-1.96*sedelai).
compute ciupdl=exp((num/den)+1.96*sedelai).
compute dl95cl={cilowdl,ciupdl}.
compute achi=((num/den)/sedelai)**2.
compute asig=1-chicdf(achi,1).
print n
/format="f8.0"
/title="Number of trials analysed (n)".
print percwi
/format="f8.1"
/title="Modified weights(%)".
do if tau2>0.
print /title='Dersimonian-Laird statistic:'.
end if.
print delaiorr
/format="f8.3"
/title="Summary OR".
print sedelai
/format="f8.3"
/title="SE log(OR)".
print dl95cl
/format="f8.3"
/title='95% Confidence interval for OR:'.
print achi
/format="f8.4"
/title="Association Chi-square statistic (df=1)".
print asig
/format="f8.3"
/title="Significance of Chi-square (H0: No association)".
compute orr={orr;delaiorr}.
compute selog={selog;sedelai}.
compute percwi={percwi;100}.
compute data={data;n+1,summpos,summneg,sumfpos,sumfneg}.
compute data={data,orr,selog,percwi}.
compute namevec={namevec,"orr","selog","weight"}.
save data /outfile=summary /names=namevec.
end matrix.
* Thanks to Ray Levesque for his help at this step *.
FORMATS trial(F8.0).
compute nobreak=1.
match files file=* /by nobreak /last=last.
do if last=1.
write outfile='c:\temp\syntax.sps' /'VALUE LABEL trial 'trial'
"Total".'.
end if.
execute.
include 'c:\temp\syntax.sps'.
* Forest plot *.
compute loworr=exp(ln(orr)-1.96*selog).
compute highorr=exp(ln(orr)+1.96*selog).
VAR LABEL loworr 'Lower 95%CI' /highorr 'Upper 95%CI' /orr 'OR'.
GRAPH /HILO(SIMPLE)=VALUE( highorr loworr orr ) BY trial
/TEMPLATE='c:\Program Files\SPSS\Looks\forest.sct'.