I have three solutions for this problem but none of it fit nearly to my
needs. There are six variables with the values 0 or 1. There is a question about why the subject like its job. And there are six possible checkbox-answers ("because of the coffee", "money", "...") and there can me more than one checkmarks. Each checkbox is one variable. Now I just want to know how many have checked (=1) the answers. I need the SUM, the percent and a descending order. 1. FREQUENCIES VARIABLES=v50a v50b v50c v50d v50e v50f /ORDER=ANALYSIS. This is the quite ugliest solution. Six variables produce six tables and I am not able to display them in a way that I can compare them. 2. DESCRIPTIVES VARIABLES=v50a v50b v50c v50d v50e v50f /STATISTICS=SUM /SORT=SUM (D). This is the simplest and nearest do my needs solution. One table, ordering. But DESCRIPTIVES doesn't offer me percent. And it displaying the count is a fixed behavior that can not be changed. But STATISTICS need an argument so I choose SUM because all the other possibilities makes no sense in my case. So the count and SUM is displayed - it is the same of course. Looks not nice but would be ok for me if I had percents there. 3. CTABLES /TABLE v50a [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50b [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50c [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50d [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50e [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50f [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1]. Complex but most powerful solution I think. I tried the ordering with the CATAGORIES subcommand. But it had no effect on the whole table (I understand why). Is there a solution for my needs (one table, sum/count & percent, ordering)? Maybe my problem depends on the design of that variables? Would you choose another variables-structure to represent this type of question (multiple-choice, multiple answer)? ===================== 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 |
Moon Kid,
Do you have other professional resources from whom you can solicit help? Perhaps enroll in an introductory statistics course. As I posted in a different string, this listserv is a forum for the collaborative exchange of ideas, problems and suggestions. And, more importantly, as it seems to me, it should fortify or augment one's own working knowledge of statistics and more loosely, research design and methodology. This forum, and the gracious support of so many here should not supplant your responsibility to learn. While I appreciate your dogged determination to find the solution to your endless list of needs, I do not appreciate what seems to me to be your effort to circumvent actual learning. There is a parable that perhaps you've heard, it seems apropos here; "If you give a man a fish you feed him for a day. If you teach a man to fish you feed him for a lifetime. ===================== 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 |
Administrator
|
In reply to this post by Moon Kid
The mean of a bunch of 1-0 variables will give you the proportion that are equal to 1. Is that good enough? If you need to express it as a percentage, you could use OMS to send the output to another dataset, and multiply the mean by 100, and use SUMMARIZE to generate a table (with or without the COUNT included).
DESCRIPTIVES VARIABLES=v50a v50b v50c v50d v50e v50f /STATISTICS=SUM MEAN /SORT=SUM (D).
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Looks like a multiple response set to me for the basic counts and percents. Look at CTABLES or MULT RESPONSE. On Sat, Apr 5, 2014 at 1:05 PM, Bruce Weaver <[hidden email]> wrote: The mean of a bunch of 1-0 variables will give you the proportion that are My pictures: http://picasaweb.google.com/vab88011
Twitter: vibeadle
|
In reply to this post by Moon Kid
Sounds like you just need to compute the
sum of the six variables (compute thesum = sum(v50a to v50f)) and then
tabulate that.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Moon Kid <[hidden email]> To: [hidden email], Date: 04/05/2014 12:32 PM Subject: [SPSSX-L] simple description of 6 boolean variables Sent by: "SPSSX(r) Discussion" <[hidden email]> I have three solutions for this problem but none of it fit nearly to my needs. There are six variables with the values 0 or 1. There is a question about why the subject like its job. And there are six possible checkbox-answers ("because of the coffee", "money", "...") and there can me more than one checkmarks. Each checkbox is one variable. Now I just want to know how many have checked (=1) the answers. I need the SUM, the percent and a descending order. 1. FREQUENCIES VARIABLES=v50a v50b v50c v50d v50e v50f /ORDER=ANALYSIS. This is the quite ugliest solution. Six variables produce six tables and I am not able to display them in a way that I can compare them. 2. DESCRIPTIVES VARIABLES=v50a v50b v50c v50d v50e v50f /STATISTICS=SUM /SORT=SUM (D). This is the simplest and nearest do my needs solution. One table, ordering. But DESCRIPTIVES doesn't offer me percent. And it displaying the count is a fixed behavior that can not be changed. But STATISTICS need an argument so I choose SUM because all the other possibilities makes no sense in my case. So the count and SUM is displayed - it is the same of course. Looks not nice but would be ok for me if I had percents there. 3. CTABLES /TABLE v50a [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50b [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50c [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50d [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50e [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1] + v50f [C][COUNT 'n' F40.0, TABLEPCT.TOTALN '%' PCT40.1]. Complex but most powerful solution I think. I tried the ordering with the CATAGORIES subcommand. But it had no effect on the whole table (I understand why). Is there a solution for my needs (one table, sum/count & percent, ordering)? Maybe my problem depends on the design of that variables? Would you choose another variables-structure to represent this type of question (multiple-choice, multiple answer)? ===================== 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 |
Administrator
|
In reply to this post by Moon Kid
Moon Kid,
Please desist from using this list as your personal training/consulting resource. Consider hiring a trainer. Your frequent posts regarding minor aspects of the software have become an issue with a number of list members. Please consult the archives of this list in the future before posting additional questions. As one of the administrators of the nabble archive I felt it necessary to step forward and state what should have been put forth several days ago.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
David,
How about we make a deal. We request Moon Kid to reduce his use of the SPSSX-L list, of which you are not an administrator. We ask you to reduce your level of rudeness on what is supposed to be a professional list. Just in the last 48 hours, "Frank, Did the zombies eat your brains?" "WAKE UP FRANK! !CONCAT('"',!UNQUOTE(!EVAL(!timestamp1)),'"') BUILDS THE DOUBLE QUOTED STRING!!!!!!!!!!!!!!!!!!!!!!! "2014-03-01 00:00:00" !UNQUOTE you silly Kraut!!!!!!!!!" In my dictionary, Kraut is classified as an offensive word. I hear many more complaints about your rudeness than I do about Moon Kid. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: David Marso <[hidden email]> To: [hidden email], Date: 04/05/2014 05:28 PM Subject: Re: [SPSSX-L] simple description of 6 boolean variables Sent by: "SPSSX(r) Discussion" <[hidden email]> Moon Kid, Please desist from using this list as your personal training/consulting resource. Consider hiring a trainer. Your frequent posts regarding minor aspects of the software have become an issue with a number of list members. Please consult the archives of this list in the future before posting additional questions. As one of the administrators of the nabble archive I felt it necessary to step forward and state what should have been put forth several days ago. ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/simple-description-of-6-boolean-variables-tp5725329p5725338.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 Moon Kid
At 02:31 PM 4/5/2014, Moon Kid wrote:
>There are six variables, v50a v50b v50c v50d v50e v50f, with the >values 0 or 1. There is a question about why the subject like its >job. And there are six possible checkbox-answers ("because of the >coffee", "money", "...") and there can me more than one checkmarks. >Each checkbox is one variable. Here's an approach: 'unroll', so each response is in a separate record within subject: |-----------------------------|---------------------------| |Output Created |06-APR-2014 00:06:07 | |-----------------------------|---------------------------| [TestData] Subject v50a v50b v50c v50d v50e v50f 1001 1 1 1 0 1 0 1002 0 0 1 1 1 1 1003 1 0 0 1 0 0 1004 0 0 0 0 0 0 1005 1 0 1 1 1 1 1006 1 0 1 1 0 1 1007 1 1 0 0 1 0 1008 1 0 0 1 1 0 1009 1 0 0 1 0 0 1010 0 1 0 0 0 1 Number of cases read: 10 Number of cases listed: 10 DATASET COPY Unroll. DATASET ACTIVATE Unroll WINDOW=FRONT. VARSTOCASES /MAKE Marked FROM v50a TO v50f /INDEX = Reason "Cause for job satisfaction"(Marked) /KEEP = Subject /NULL = KEEP. Variables to Cases |-----------------------------|---------------------------| |Output Created |06-APR-2014 00:06:08 | |-----------------------------|---------------------------| [Unroll] Generated Variables |------|---------------| |Name |Label | |------|---------------| |Reason|Cause for job | | |satisfaction | |------|---------------| |Marked|<none> | |------|---------------| Processing Statistics |-------------|-| |Variables In |7| |-------------|-| |Variables Out|3| |-------------|-| Now you can do a simple CROSSTABS -- and if you do, yours will come out better looking than this, below: CROSSTABS /TABLES=Marked BY Reason /FORMAT=AVALUE TABLES /CELLS =COUNT COLUMN /COUNT ROUND CELL . Crosstabs |-----------------------------|---------------------------| |Output Created |06-APR-2014 00:06:08 | |-----------------------------|---------------------------| [Unroll] Case Processing Summary [suppressed] Marked * Reason Cause for job satisfaction Crosstabulation |------|-|---------|-----------------------------------------|------| | | | |Reason Cause for job satisfaction |Total | | | | |------|------|------|------|------|------| | | | | |v50a |v50b |v50c |v50d |v50e |v50f | | |------|-|---------|------|------|------|------|------|------|------| |Marked|0|Count |3 |7 |6 |4 |5 |6 |31 | | | |% within |30.0% |70.0% |60.0% |40.0% |50.0% |60.0% |51.7% | | | | Reason | | | | | | | | | |-|---------|------|------|------|------|------|------|------| | |1|Count |7 |3 |4 |6 |5 |4 |29 | | | |% within |70.0% |30.0% |40.0% |60.0% |50.0% |40.0% |48.3% | | | | Reason | | | | | | | | |------|-|---------|------|------|------|------|------|------|------| |Total |Count |10 |10 |10 |10 |10 |10 |60 | | |% within |100.0%|100.0%|100.0%|100.0%|100.0%|100.0%|100.0%| | | | Reason | | | | | | | | |--------|---------------|------|------|------|------|------|------|------| Or, you can create a dataset summarizing the statistics by reason, and just print it: DATASET DECLARE Summary. AGGREGATE /OUTFILE=Summary /BREAK =Reason /Total 'Times this reason selected' = SUM(Marked) /Fract 'Fraction of subjects selecting' = MEAN(Marked). DATASET ACTIVATE Summary WINDOW=FRONT. FORMATS Total (F4) Fract (F6.3). SORT CASE BY Fract (D). LIST. List |-----------------------------|---------------------------| |Output Created |06-APR-2014 00:06:09 | |-----------------------------|---------------------------| [Summary] Reason Total Fract v50a 7 .700 v50d 6 .600 v50e 5 .500 v50c 4 .400 v50f 4 .400 v50b 3 .300 Number of cases read: 6 Number of cases listed: 6 ================================= APPENDIX: Test data, and all code ================================= * C:\Documents and Settings\Richard\My Documents . * \Technical\spssx-l\Z-2014\ . * 2014-04-05 Moon Kid-simple description of 6 boolean variables.SPS. * In response to posting . * Date: Sat, 5 Apr 2014 20:31:37 +0200 . * From: Moon Kid <[hidden email]> . * Subject: simple description of 6 boolean variables . * To: [hidden email] . * "There are six variables, v50a v50b v50c v50d v50e v50f, with the . * values 0 or 1. There is a question about why the subject like its . * job. And there are six possible checkbox-answers . * ('because of the coffee', 'money', '...') and there can me more . * than one checkmarks. Each checkbox is one variable. . * . * Now I just want to know how many have checked (=1) the answers. . * I need the SUM, the percent and a descending order." . * ................................................................. . * ................. Test data ..................... . SET RNG = MT /* 'Mersenne twister' random number generator */ . SET MTINDEX = 2398 /* Providence, RI telephone book */ . NEW FILE. INPUT PROGRAM. . NUMERIC Subject (F4). . NUMERIC v50a v50b v50c v50d v50e v50f (F2). . VECTOR v50 =v50a TO v50f. . VECTOR #pb(6,F6.4). . LOOP #Vidx = 1 TO 6. . COMPUTE #pb(#Vidx) = RV.UNIFORM(0.2,0.8). . END LOOP. . LOOP Subject = 1001 TO 1010. . LOOP #Vidx = 1 TO 6. . COMPUTE v50(#Vidx) = RV.BERNOULLI(#pb(#Vidx)). . END LOOP. . END CASE. . END LOOP. END FILE. END INPUT PROGRAM. DATASET NAME TestData WINDOW=FRONT. . /**/ LIST /*-*/. DATASET COPY Unroll. DATASET ACTIVATE Unroll WINDOW=FRONT. VARSTOCASES /MAKE Marked FROM v50a TO v50f /INDEX = Reason "Cause for job satisfaction"(Marked) /KEEP = Subject /NULL = KEEP. . /*-- LIST /*-*/. CROSSTABS /TABLES=Marked BY Reason /FORMAT=AVALUE TABLES /CELLS =COUNT COLUMN /COUNT ROUND CELL . DATASET DECLARE Summary. AGGREGATE /OUTFILE=Summary /BREAK =Reason /Total 'Times this reason selected' = SUM(Marked) /Fract 'Fraction of subjects selecting' = MEAN(Marked). DATASET ACTIVATE Summary WINDOW=FRONT. FORMATS Total (F4) Fract (F6.3). SORT CASE BY Fract (D). LIST. ===================== 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 |
Free forum by Nabble | Edit this page |