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 (December 2010)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 11 Dec 2010 06:16:26 -0800
Reply-To:     Bruce Weaver <bruce.weaver@hotmail.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Bruce Weaver <bruce.weaver@hotmail.com>
Subject:      Re: Macro to run TTEST
In-Reply-To:  <201012101638.oBABkmaH024052@wasabi.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii

While following David's advice re the manual, pay attention to the difference between !CHAREND and !CMDEND.

Also note that your lines

!do !X !in(!XLIST) !do !Y !in(!YLIST)

T-TEST GROUPS =!X(0 1) /MISSING=ANALYSIS /VARIABLE=!Y.

!doend !doend

will result in one t-test for every combination of variables in the two lists, which is not what you want. To get what you want (A/E; B/F; C/G; D/H), you'll need to walk through the two lists in parallel. Here's an example of how to do that using !HEAD and !TAIL (courtesy of David a few years ago).

!LET !XCOPY=!XLIST **PARALLEL PROCESS VARIABLE LISTS ** !DO !Y !IN (!YLIST) !LET !X = !HEAD(!XCOPY) !LET l!XCOPY=!TAIL(!XCOPY) T-TEST GROUPS=!X(0,1) /VARIABLES=!Y. !doend

HTH.

Ray Haraf wrote: > > I worked around 30 t-tests by cutting and pasting the first SPSS syntax. > However, I am curious to know an efficient way to cut and paste. I > modified a macro posted by Bruce Weaver in October 2009 to run logistic > regression (thanks, Bruce!). The following modified macro fails to run. No > results, no error message. > > DEFINE MyTTEST (XLIST !CMDEND/YLIST !CMDEND) > > !do !X !in(!XLIST) > !do !Y !in(!YLIST) > > T-TEST GROUPS =!X(0 1) > /MISSING=ANALYSIS > /VARIABLE=!Y. > > !doend > !doend > !ENDDEFINE. > > MyTTEST xlist=A B C D /ylist =E F G H. > > I also tried > > MyTTEST xlist=A(0 1) B(0 1) C(0 1) D(0 1)/ylist =E F G H. replacing !X(0 > 1) with !X > > Modifying lirdoall (Do All Univariate Linear Regression MACRO by Marta > http://www.spsstools.net/Syntax/RegressionRepeatedMeasure/DoAllUnivariateLi > nearAndLogisticRegressions.txt) gives me results in the xlist/ylist format > for A/E F G H; B/E F G H; C/E F G H and D/E F G H. This is not what I > want. I would like to obtain results for A/E; B/F; C/G and D/H > > Thanks for your care, > Ray > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > >

----- -- Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.

-- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Macro-to-run-TTEST-tp3300721p3301520.html Sent from the SPSSX Discussion mailing list archive at Nabble.com.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


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