There doesn’t appear to be a facility in MULT RESP to arrange rows or columns in ascending/descending order of frequencies. Be nice if we could. John F Hall (Mr) [Retired academic survey researcher] Email: [hidden email] Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/1-survey-analysis-workshop |
Download the Extension STATS CATEGORY ORDER.
Which is designed to achieve this, and more, such as anchoring "Other" &/or "Don't know" to the bottom. |
John, You can do this directly in CTABLES, see CATEGORIES VARIABLES sub command. I've also shown how you can use STATS CATEGORY ORDER to anchor Other/Don't know, if required.
dataset close all. new file. output close all. set seed = 10. input program. loop #i = 1 to 500. compute case = #i. vector v(20). loop #j=1 to 20. compute v(#j)=rnd(rv.uniform(0,1)). end loop. end case. end loop. end file. end input program. dataset name sim. execute. descrip v1 to v20 /stat sum. mrsets /mdgroup name=$mrsset_origOrderVars categorylabels=varlabels variables = v1 to v20 value=1 /display name=[$mrsset_origOrderVars]. ctables /table $mrsset_origOrderVars /titles title="Table1: Unodered". ctables /table $mrsset_origOrderVars /titles title="Table2: Ordered" /categories variables=$mrsset_origOrderVars order=d key=count. stats category order items=$mrsset_origOrderVars prefix=dorder specialvars=v19 v20 other=no /options order=d categorylabels=varlabels specialsloc=after missing=exclude. ctables /table $dorder_$mrsset_origOrderVars /titles title="Table3: Ordered (via STATS CATEGORY ORDER with Other/DK anchored)". |
PS. If you wrap syntax code with "Raw text" tag then it fails to come through in email
So here's the code for those not reading via nabble (but email): dataset close all. new file. output close all. set seed = 10. input program. loop #i = 1 to 500. compute case = #i. vector v(20). loop #j=1 to 20. compute v(#j)=rnd(rv.uniform(0,1)). end loop. end case. end loop. end file. end input program. dataset name sim. execute. descrip v1 to v20 /stat sum. mrsets /mdgroup name=$mrsset_origOrderVars categorylabels=varlabels variables = v1 to v20 value=1 /display name=[$mrsset_origOrderVars]. ctables /table $mrsset_origOrderVars /titles title="Table1: Unodered". ctables /table $mrsset_origOrderVars /titles title="Table2: Ordered" /categories variables=$mrsset_origOrderVars order=d key=count. stats category order items=$mrsset_origOrderVars prefix=dorder specialvars=v19 v20 other=no /options order=d categorylabels=varlabels specialsloc=after missing=exclude. ctables /table $dorder_$mrsset_origOrderVars /titles title="Table3: Ordered (via STATS CATEGORY ORDER with Other/DK anchored)". |
In reply to this post by John F Hall
You can control the sort order of MR (or
regular) variables in CTABLES. The output can be order by category
value, category label, or category count. In syntax it would look
like this
/CATEGORIES VARIABLES=$myMRvariable ORDER=D KEY=COUNT Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: John F Hall <[hidden email]> To: [hidden email] Date: 06/01/2015 02:58 AM Subject: [SPSSX-L] Ascending-descending frequencies in mult response Sent by: "SPSSX(r) Discussion" <[hidden email]> There doesn’t appear to be a facility in MULT RESP to arrange rows or columns in ascending/descending order of frequencies. Be nice if we could.
John F Hall (Mr) [Retired academic survey researcher]
Email: johnfhall@... Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/1-survey-analysis-workshop
===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 ===================== 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 |
Jon Many thanks for this. My version was: mult resp groups= Q2 'Quals working for..' (v109 to v112 (1,7)) /freq q2.
It took me an hour to work out what to do and then write something in CTABLES, (only one error, used # instead of $ for setname: print in TFM too small) but I eventually got to: MRSETS /McGROUP NAME= $Q2 LABEL= 'Quals working for..' VARIABLES= v109 to v112 /DISPLAY NAME= [$Q2]. ctables /tab $q2 /CATEGORIES VARIABLES=$q2 ORDER=D KEY=COUNT.
Will play with CTABLES to get % and TOTAL displayed, then see if I can decipher Jignesh’s fearsome code. Nice to see /FORMAT CONDENSE still available in MULT RESPONSE: can’t see when I’d use it, but why was it ever removed from FREQUENCIES? John From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jon K Peck You can control the sort order of MR (or regular) variables in CTABLES. The output can be order by category value, category label, or category count. In syntax it would look like this
John F Hall (Mr) [Retired academic survey researcher] Email: [hidden email] Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/1-survey-analysis-workshop ===================== 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 ===================== 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 |
In reply to this post by Jignesh Sutar
Jignesh My variables are MCGROUP, not MDGROUP. I've modified your syntax, but it effectively comes out the same as Jon's. mrsets /mcgroup name=$q17 label = 'Newspapers read' variables = v207 to v213 /display name=[$q17]. ctables /table $q17 /titles title="Table1: Unordered". ctables /table $q17 /titles title="Table2: Ordered" /categories variables=$q17 order=d key=count.
Even after RTFM I can't get any %% displayed, just error messages. For some reason COLPCT.COUNT and others cause errors. John -----Original Message----- PS. If you wrap syntax code with "Raw text" tag then it fails to come through in email So here's the code for those not reading via nabble (but email): dataset close all. new file. output close all. set seed = 10. input program. loop #i = 1 to 500. compute case = #i. vector v(20). loop #j=1 to 20. compute v(#j)=rnd(rv.uniform(0,1)). end loop. end case. end loop. end file. end input program. dataset name sim. execute. descrip v1 to v20 /stat sum. mrsets /mdgroup name=$mrsset_origOrderVars categorylabels=varlabels variables = v1 to v20 value=1 /display name=[$mrsset_origOrderVars]. ctables /table $mrsset_origOrderVars /titles title="Table1: Unodered". ctables /table $mrsset_origOrderVars /titles title="Table2: Ordered" /categories variables=$mrsset_origOrderVars order=d key=count. stats category order items=$mrsset_origOrderVars prefix=dorder specialvars=v19 v20 other=no /options order=d categorylabels=varlabels specialsloc=after missing=exclude. ctables /table $dorder_$mrsset_origOrderVars /titles title="Table3: Ordered (via STATS CATEGORY ORDER with Other/DK anchored)". -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Ascending-descending-frequencies-in-mult-response-tp5729660p5729667.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
In reply to this post by John F Hall
Jignesh Well spotted! I really don’t have time to study all this syntax: it took me the whole morning to get that far!. Undergrad students would have gone home hours ago. Why can’t they just have /FOR DVAL in MULT RESP? It’s not for me but I was checking the data from a 1989 survey in FE colleges and Sixth Forms of Attitudes to Proposed Student Loans (conducted by the National Union of Students) which Edinburgh have agreed to curate, so I can clear it from my machine. (See: http://stats.datalib.edina.ac.uk/sdaweb/analysis/?dataset=nus89) Essex Re-share is too bureaucratic (I don’t have authorisation for the data and no-one answers repeated requests, but I’m loath to destroy them). At least Essex can store and distribute the SPSS *.sav file: with Edinburgh you have to re-create it (in Stata and SAS as well as SPSS) but why anyone would want to use Stata or SAS on small surveys is beyond my comprehension. John From: [hidden email] [mailto:[hidden email]] On Behalf Of Jignesh Sutar You don't want "Other" floating around there in the middle! Have no fear, start studying! Happy to help out if you get stuck... On 2 June 2015 at 11:00, John F Hall <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |