LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 30 Oct 2002 09:33:38 +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
Content-Type: text/plain; charset=us-ascii

Hi Jeff:

I wrote the original code, so I will try to help you.

If you get a divsion by cero error, then you have a 0 count in mpos or fneg (the pseodo count code was added to avoid that). I see you have modified the code to load the file inside the MATRIX statement without looking at it. You can't run the pseudo count modification code inside the MATRIX statment. Why don't you load the dataset in memory, run the pseudo count modification code, check that not 0 count remains in the file and then save it again begore running the meta-analysis syntax?

HTH

Marta

Jeff Mather ha escrito:

> Hi, > I have modified the following from a download on Reynald's site. This > is for meta-analysis using Odd's ratio's. > The file this opens has 5 variables: Author, fpos(females_positive), > fneg(females negative), mpos (Males....) and mneg. > When I list the data, instead of getting the file - all works fine. > For ease of use, I need to use the GET DATA..filename. When I do this, > I get a "Division by zero" error after compute > orr=(fpos&*mneg)&/(mpos&*fneg). > > I am thinking that I might have a pending transformation problem here > as when I experiment with this outside of the matrix procedure, I do get > a pending transformation message. So I tried to insert an Execute after > the compute statement apparently you can't use Execute in the matrix > procedure. > > Any help would be greatly appreciated! > > Thanks > Jeff > > * (V) Retrospective studies (case-control) with count data. > * *********************************************************. > *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 > *Finally, create variable COUNT, to be used later to obtain the total > n. > > COMPUTE mpos = pwnm * (pctmale / 100). > > COMPUTE fpos = pwnf * (pctfem / 100). > > COMPUTE mneg = pwnm - mpos. > > COMPUTE fneg = pwnf - fpos. > > *IF ( ~ MISS(mpos)) Count = 1 . > *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 . > > MATRIX. > PRINT /TITLE ' META-ANALYSIS: ODDS RATIO (RANDOM-EFFECTS MODEL)'. > > GET DATA > /FILES="H:\Meta_analysis\DTolin\New_Data_102002\ptsd oct > 2002_PRACTICE.SAV" > /VARIABLES = Author, mpos, mneg, fpos, fneg > /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'. > > Jeffrey F. Mather > Research Analyst > Hartford Hospital > Hartford, Connecticut 06106 > jmather@harthosp.org


Back to: Top of message | Previous page | Main SPSSX-L page