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 (July 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 30 Jul 2003 10:08:45 -0400
Reply-To:   "Jed J. Teres" <jjt2002@med.cornell.edu>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   "Jed J. Teres" <jjt2002@med.cornell.edu>
Subject:   do if vs if
Content-Type:   text/plain; charset="us-ascii"; format=flowed

Can someone please explain the difference between "do if" and just regular "if" for me? I tried to use the following syntax, and if failed:

do if (bdpj(#i) lt 3 AND bdpn(#i) lt 2). compute bdep(#i)=0. else if (bdpj(#i) lt 3 AND missing(bdpn(#i))) compute bdep(#i)=0. else if (missing(bdpj(#i)) AND bdpn(#i) ge 2) compute bdep(#i)=1. end if.

But the following worked fine. I'm coming from a MATLAB background, and I don't see a difference... what -is- the difference?

if (bdpj(#i) lt 3 AND bdpn(#i) lt 2) bdep(#i)=0. if (bdpj(#i) lt 3 AND missing(bdpn(#i))) bdep(#i)=0. if (missing(bdpj(#i)) AND bdpn(#i) ge 2) bdep(#i)=1.

Thanks-

Jedediah Teres Data Analyst Weill Medical College of Cornell University Department of Psychiatry 525 East 68th Street New York, NY 10021 (212) 746-3874


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