Hi!
I'm working on a macro to calculate the discrimination index (part-whole corrected) WITHOUT the command reliability... The macro should be adapted easily for different data sets! I don't know why - but it is not working (syntax error in vector dv)... I'm at a loss... THANKS Alex SET MPRINT=no. DEFINE !partwhole(nby=!CMDEND). VECTOR dv = i1 TO i7 /score_without_item(7). COMPUTE sum_score_gesamt = 0. * Calculating total score. !DO !index1=1 !TO !nby. - COMPUTE score_all = score_all + dv(!index1). !DOEND. !DO !index2=1 !TO !nby. * part-whole-corrected total score. COMPUTE score_without_item(!index2) = score_all - dv(!index2). * correlation item-total score (corrected). TITLE 'Discrimination index (Part-Whole correction)'. CORRELATION dv(!index2) WITH score_without_item(!index2). * correlation item-total score (without correction). TITLE 'Discrimination index (without Part-Whole correction)'. CORRELATION dv(!index2) WITH score_all. !DOEND. !ENDDEFINE. SET MPRINT=yes. !partwhole nby=7. EXECUTE. |
Hi
Try this untested code (if it does not work, please send me a sample data file to facilitate debugging) SET MPRINT=no. */////////////////////////////. DEFINE !partwhole(nby=!CMDEND) VECTOR dv = i1 TO !CONCAT('i',!nby) /score_without_item( !nby ). COMPUTE score_all = SUM(i1 TO !CONCAT('i',!nby)) . !DO !index2=1 !TO !nby COMPUTE !CONCAT("score_without_item",!index2 ) = score_all - !CONCAT("dv", !index2) . TITLE 'Discrimination index (Part-Whole correction)'. CORRELATION !CONCAT("dv", !index2) WITH !CONCAT("score_without_item", !index2 ). TITLE 'Discrimination index (without Part-Whole correction)'. CORRELATION !CONCAT("dv", !index2) WITH score_all. !DOEND !ENDDEFINE. */////////////////////////////. SET MPRINT=yes. !partwhole nby=7. Cheers! Raynald Levesque [hidden email] Visit my SPSS site: http://www.spsstools.net -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Alex Zimmerhofer Sent: September 8, 2006 6:35 AM To: [hidden email] Subject: macro - discrimination index (part-whole-corrected) Hi! I'm working on a macro to calculate the discrimination index (part-whole corrected) WITHOUT the command reliability... The macro should be adapted easily for different data sets! I don't know why - but it is not working (syntax error in vector dv)... I'm at a loss... THANKS Alex SET MPRINT=no. DEFINE !partwhole(nby=!CMDEND). VECTOR dv = i1 TO i7 /score_without_item(7). COMPUTE sum_score_gesamt = 0. * Calculating total score. !DO !index1=1 !TO !nby. - COMPUTE score_all = score_all + dv(!index1). !DOEND. !DO !index2=1 !TO !nby. * part-whole-corrected total score. COMPUTE score_without_item(!index2) = score_all - dv(!index2). * correlation item-total score (corrected). TITLE 'Discrimination index (Part-Whole correction)'. CORRELATION dv(!index2) WITH score_without_item(!index2). * correlation item-total score (without correction). TITLE 'Discrimination index (without Part-Whole correction)'. CORRELATION dv(!index2) WITH score_all. !DOEND. !ENDDEFINE. SET MPRINT=yes. !partwhole nby=7. EXECUTE. |
In reply to this post by Alex Zimmerhofer
Hi Raynald!
Thanks for your fast response. Great work! But the macro isn't working (Text: dv1¬ SYNTAX ERROR--A subcommand or variable name is expected here. Perhaps a variable name is misspelled. Valid subcommands for this procedure are VARIABLES, MISSING, PRINT, FORMAT, MATRIX, and STATISTICS.¬ This command not executed.¬). My data file contains 7 variables i1 to i7 (the item raw scores; each case is the data set for one person)! Thanks! Alex |
Free forum by Nabble | Edit this page |