A few days ago I posted syntax similar to that below
to
input a set of multiple response variables create a target set of dichotomous variables score the input variables into the target variables. In this example I made up names for the dichotomous variables. has anybody automated something like the DO REPEAT section: -- to assign names for the target variables -- to create VAR LABELS for the target variables -- and then create some output to generate something like this in the output. [begin example output] Scoring key details item1 ==> steamed "score for 'Which method of cooking meat is generally healthiest?' " right 'a' 'steamed' wrong 'b' 'deep fried' wrong 'c' 'sauteed' wrong 'd' 'with cream sauce' item2 ==> avocado "score for 'Which food has the most calories in a serving?' " wrong 'a' 'bean sprouts' right 'b' 'avocado' wrong 'c' 'celery' wrong 'd' 'lettuce' item3 ==> deep_fried "score for 'Which method of cooking meat is generally the least healthy?' " wrong 'a' 'steamed' wrong 'b' 'sauteed' right 'c' 'deep fried' wrong 'd' 'broiled' item4 ==> sugar_free_jello "score for 'Which food has the least calories in a serving?' " wrong 'a' 'cake' wrong 'b' 'candy' wrong 'c' 'trail mix' right 'd' 'sugar free jello' [end example output] data list list /id (f3) item1 to item4(4a1). begin data 001 a b c a 002 a b a d 003 a a c d 004 a b c d 005 b c d a 006 b c d a 007 a a a a 008 b b b b 009 c c c c 010 d d d d end data. dataset name items. var labels item1 'Which method of cooking meat is generally healthiest?'/ item2 'Which food has the most calories in a serving?'/ item3 'Which method of cooking meat is generally the least healthy?'/ item4 'Which food has the least calories in a serving?'. value labels item1 'a' 'steamed' 'b' 'deep fried' 'c' 'sauteed' 'd' 'with cream sauce'/ item2 'a' 'bean sprouts' 'b' 'avocado' 'c' 'celery' 'd' 'lettuce'/ item3 'a' 'steamed' 'b' 'sauteed' 'c' 'deep fried' 'd' 'broiled'/ item4 'a' 'cake' 'b' 'candy' 'c' 'trail mix' 'd' 'sugar free jello'. *******. *given a data file similar to the above. * this is the section I would like to automate. * vvvvv. do repeat item= item1 to item4/ key = 'a','b','c','d'/ num_item = steamed avocado deep_fried sugar_free_jello. compute num_item = item eq key. end repeat. variable labels steamed "score for 'Which method of cooking meat is generally healthiest?' "/ avocado "score for 'Which food has the most calories in a serving?' "/ deep_fried "score for 'Which method of cooking meat is generally the least healthy?' "/ sugar_free_jello "score for 'Which food has the least calories in a serving?' ". value labels steamed to sugar_free_jello 1 'right' 2 'wrong'. variable level item1 to item4 steamed to sugar_free_jello (nominal). * ^^^^^ . reliability variables = steamed to sugar_free_jello /scale (knowledge) = steamed to sugar_free_jello /model = alpha /statistics = correlations scale /summary = means variances correlations total. Art Kendall Social Research Consultants ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (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
Art Kendall
Social Research Consultants |
Free forum by Nabble | Edit this page |