I have variables that contain either a 0 or a 1 and to count the number of
1's I'm using the aggregate function. When there is only a single 1 in the column, the aggregate sum is 0. Know anything about this? Thanks! ===================== 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 |
I created a break variable consisting of a single value based on previous
code from David Marso and it works. I hesitate to ask but... should I have been aware of this issue?? Does everyone know to use a break variable even though SPSS can aggregate without? Thanks. ===================== 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 Matt Freeman
Please paste your AGGREGATE syntax and a small dataset that duplicates the problem. Thanks.
--
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/). |
In reply to this post by Matt Freeman
On Tue, 5 Feb 2013 14:51:53 -0800, Bruce Weaver <[hidden email]>
wrote: >Please paste your AGGREGATE syntax and a small dataset that duplicates the >problem. Thanks. > > > >Matt Freeman wrote >> I have variables that contain either a 0 or a 1 and to count the number of >> 1's I'm using the aggregate function. When there is only a single 1 in >> the column, the aggregate sum is 0. Know anything about this? Thanks! >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to > >> LISTSERV@.UGA > >> (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 >[hidden email] >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- tp5717907p5717908.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 Bruce - I'm using v21 at work and v20 at home. I just tried the exact same thing I tried at work, at home - not using syntax in either case - and it worked just fine. At work, on v21, I just entered, in VAR00001, 5 0s and a single 1, moving the 1 around from case to case. I ran aggregate (sum)on VAR00001, with no break variable, from the dialogue and I got a column full of 0s each and every time. Could this be a v21 issue? Thanks for your interest in my problem. Matt ===================== 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 Bruce Weaver
ALWAYS PROVIDE such to save an iteration of Q&A!!
Without a reproducible context it is unlikely you will receive any resolution. All too often it is user error or expectations contrary to documented functionality. Sometimes something else. - Can't do much/anything without details (mock data, syntax, expected result, actual result). -------------------------------------------
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?" |
Administrator
|
In reply to this post by Matt Freeman
Repeat after me.....
DATA LIST blah blah blah... AGGREGATE blah blah blah. LIST.... --------------
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?" |
In reply to this post by Matt Freeman
Syntax to find sum of X and Y values...
DATA LIST FREE / X Y. BEGIN DATA 0 0 0 0 0 0 1 2 0 0 0 0 END DATA. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= / X_sum Y_sum = SUM(X Y). LIST. And the results... X Y X_sum Y_sum .00 .00 .00 2.00 .00 .00 .00 2.00 .00 .00 .00 2.00 1.00 2.00 .00 2.00 .00 .00 .00 2.00 .00 .00 .00 2.00 Number of cases read: 6 Number of cases listed: 6 And the expected results... X Y X_sum Y_sum .00 .00 1.00 2.00 .00 .00 1.00 2.00 .00 .00 1.00 2.00 1.00 2.00 1.00 2.00 .00 .00 1.00 2.00 .00 .00 1.00 2.00 ===================== 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
|
When I run your syntax (using version 20.0.0.1 under Windoze 7), I get this output:
X Y X_sum Y_sum .00 .00 1.00 2.00 .00 .00 1.00 2.00 .00 .00 1.00 2.00 1.00 2.00 1.00 2.00 .00 .00 1.00 2.00 .00 .00 1.00 2.00 Number of cases read: 6 Number of cases listed: 6
--
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/). |
Administrator
|
In reply to this post by Matt Freeman
Thanks Matt,
I would be inclined to call that a 'bug'. Odd that it works for the Y variable but not the X variable. Perhaps JoNoH might comment? Hopefully there is a patch. David
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?" |
Administrator
|
In reply to this post by Bruce Weaver
So it looks like some tender bits got twisted in v 21.
ARGH (I'm likely to get my mitts on v 21 soon ). --
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?" |
In reply to this post by Matt Freeman
At 07:04 PM 2/5/2013, Matt Freeman wrote:
>On Tue, 5 Feb 2013 14:51:53 -0800, Bruce Weaver <[hidden email]> >wrote: > >>Please paste your AGGREGATE syntax and a small dataset that >>duplicates the problem. Thanks. > >Bruce - I'm using v21 at work and v20 at home. I just tried the exact same >thing I tried at work, at home - not using syntax in either case - and it >worked just fine. An important point about SPSS, especially for debugging: For most functions, you *are* using syntax, whether you're writing the syntax or using the menus. That is, SPSS implements most of the menu functions by first creating, and then running, the necessary syntax. The generated syntax should appear in your output exactly as written syntax would; but you can also have SPSS keep a log of all syntax that it runs, and it is very wise to have it do so -- particularly, so you can know exactly what you did, for your own information or when asking for help. On menu item Edit > Options..., select 'General' tab. Look for section 'Session Journal'; select 'Record syntax in Journal' and (I recommend) 'Append'; select 'Browse' to navigate to the directory where you want to place the journal, and give it what name you like. (Staying with extension '.jnl' is recommended.) SPSS will write a time-stamp into the journal at the start of every session, so it's possible to keep straight when you did particular things, or find what you did on some date. ===================== 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 David Marso
I don't see that behavior in V21.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: David Marso <[hidden email]> To: [hidden email], Date: 02/06/2013 12:35 PM Subject: Re: [SPSSX-L] Aggregating a Binary 0/1 Variable Sent by: "SPSSX(r) Discussion" <[hidden email]> So it looks like some tender bits got twisted in v 21. ARGH (I'm likely to get my mitts on v 21 soon ). -- Bruce Weaver wrote > When I run your syntax (using version 20.0.0.1 under Windoze 7), I get > this output: > > X Y X_sum Y_sum > > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > 1.00 2.00 1.00 2.00 > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > > Number of cases read: 6 Number of cases listed: 6 > > > Matt Freeman wrote >> Syntax to find sum of X and Y values... >> >> DATA LIST FREE / X Y. >> BEGIN DATA >> 0 0 >> 0 0 >> 0 0 >> 1 2 >> 0 0 >> 0 0 >> END DATA. >> AGGREGATE >> /OUTFILE=* MODE=ADDVARIABLES >> /BREAK= >> / X_sum Y_sum = SUM(X Y). >> LIST. >> >> And the results... >> >> X Y X_sum Y_sum >> >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> 1.00 2.00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> >> >> Number of cases read: 6 Number of cases listed: 6 >> >> And the expected results... >> >> X Y X_sum Y_sum >> >> .00 .00 1.00 2.00 >> .00 .00 1.00 2.00 >> .00 .00 1.00 2.00 >> 1.00 2.00 1.00 2.00 >> .00 .00 1.00 2.00 >> .00 .00 1.00 2.00 >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to >> LISTSERV@.UGA >> (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Aggregating-a-Binary-0-1-Variable-tp5717907p5717922.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 Richard Ristow
Thank you for your email. Please note that I am offsite at the Administrator Leadership Program. I will respond to your email upon my return to the office on Friday February 8.
Valerie Villella Education Coordinator & Policy and Program Analyst OANHSS 905-851-8821 ext. 228 ===================== 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 Jon K Peck
When I run the syntax for version 21.0.0.0 I get the unexpected results....
X Y X_sum Y_sum .00 .00 .00 2.00 .00 .00 .00 2.00 .00 .00 .00 2.00 1.00 2.00 .00 2.00 .00 .00 .00 2.00 .00 .00 .00 2.00 Number of cases read: 6 Number of cases listed: 6 Damir |
In reply to this post by Matt Freeman
Jon - I've run this on three different machines, each with a licensed
client version of SPSS v21. Same result on all three. Any ideas??? DATA LIST FREE / X Y. >> BEGIN DATA >> 0 0 >> 0 0 >> 0 0 >> 1 2 >> 0 0 >> 0 0 >> END DATA. >> AGGREGATE >> /OUTFILE=* MODE=ADDVARIABLES >> /BREAK= >> / X_sum Y_sum = SUM(X Y). >> LIST. >> >> And the results... >> >> X Y X_sum Y_sum >> >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> 1.00 2.00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 ===================== 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 Jon K Peck
Hmm, I have access to both 20.0.0.2/64-bit and 21.0.0.0/64-bit. I get correct results in 20 and incorrect results (exactly as displayed below) in 21. --
Daniel Robertson Senior Research and Planning Associate Institutional Research and Planning Cornell University / irp.cornell.edu From: SPSSX(r) Discussion [mailto:[hidden email]]
On Behalf Of Jon K Peck I don't see that behavior in V21.
|
In reply to this post by David Marso
Well, I've never used that style of syntax
for aggregate, which I think is rather goofy, but I tried it in 21, and
it worked correctly.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: David Marso <[hidden email]> To: [hidden email], Date: 02/06/2013 12:35 PM Subject: Re: [SPSSX-L] Aggregating a Binary 0/1 Variable Sent by: "SPSSX(r) Discussion" <[hidden email]> Thanks Matt, I would be inclined to call that a 'bug'. Odd that it works for the Y variable but not the X variable. Perhaps JoNoH might comment? Hopefully there is a patch. David Matt Freeman wrote > Syntax to find sum of X and Y values... > > DATA LIST FREE / X Y. > BEGIN DATA > 0 0 > 0 0 > 0 0 > 1 2 > 0 0 > 0 0 > END DATA. > AGGREGATE > /OUTFILE=* MODE=ADDVARIABLES > /BREAK= > / X_sum Y_sum = SUM(X Y). > LIST. > > And the results... > > X Y X_sum Y_sum > > .00 .00 .00 2.00 > .00 .00 .00 2.00 > .00 .00 .00 2.00 > 1.00 2.00 .00 2.00 > .00 .00 .00 2.00 > .00 .00 .00 2.00 > > > Number of cases read: 6 Number of cases listed: 6 > > And the expected results... > > X Y X_sum Y_sum > > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > 1.00 2.00 1.00 2.00 > .00 .00 1.00 2.00 > .00 .00 1.00 2.00 > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (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 ----- Please reply to the list and not to my personal email. Those desiring my consulting or training services please feel free to email me. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Aggregating-a-Binary-0-1-Variable-tp5717907p5717921.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 Matt Freeman
Matt, what happens if you take the "/break=" out? I agree with Jon that that seems quite odd but, that aside, what happens?
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Matt Freeman Sent: Wednesday, February 06, 2013 3:52 PM To: [hidden email] Subject: Re: Aggregating a Binary 0/1 Variable Jon - I've run this on three different machines, each with a licensed client version of SPSS v21. Same result on all three. Any ideas??? DATA LIST FREE / X Y. >> BEGIN DATA >> 0 0 >> 0 0 >> 0 0 >> 1 2 >> 0 0 >> 0 0 >> END DATA. >> AGGREGATE >> /OUTFILE=* MODE=ADDVARIABLES >> /BREAK= >> / X_sum Y_sum = SUM(X Y). >> LIST. >> >> And the results... >> >> X Y X_sum Y_sum >> >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 >> 1.00 2.00 .00 2.00 >> .00 .00 .00 2.00 >> .00 .00 .00 2.00 ===================== 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 |
Administrator
|
Great minds think alike ;-) I was just about to suggest that (per ex in FM).
--
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?" |
In reply to this post by Matt Freeman
On Tue, 5 Feb 2013 16:16:11 -0800, David Marso <[hidden email]>
wrote: >Repeat after me..... >DATA LIST blah blah blah... >AGGREGATE blah blah blah. >LIST.... >-------------- > >Matt Freeman wrote >> On Tue, 5 Feb 2013 14:51:53 -0800, Bruce Weaver < > >> bruce.weaver@ > >> > >> wrote: >> >>>Please paste your AGGREGATE syntax and a small dataset that duplicates >>>problem. Thanks. >>> >>> >>> >>>Matt Freeman wrote >>>> I have variables that contain either a 0 or a 1 and to count the number >> of >>>> 1's I'm using the aggregate function. When there is only a single 1 in >>>> the column, the aggregate sum is 0. Know anything about this? Thanks! >>>> >>>> ===================== >>>> To manage your subscription to SPSSX-L, send a message to >>> >>>> LISTSERV@.UGA >>> >>>> (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@ > >>>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/Aggregating-a-Binary-0-1-Variable- >> tp5717907p5717908.html >>>Sent from the SPSSX Discussion mailing list archive at Nabble.com. >>> >>>===================== >>>To manage your subscription to SPSSX-L, send a message to >>> > >> LISTSERV@.UGA > >> (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 - I'm using v21 at work and v20 at home. I just tried the exact >> thing I tried at work, at home - not using syntax in either case - and it >> worked just fine. >> At work, on v21, I just entered, in VAR00001, 5 0s and a single 1, moving >> the >> 1 around from case to case. I ran aggregate (sum)on VAR00001, with no >> break >> variable, from the dialogue and I got a column full of 0s each and every >> time. >> Could this be a v21 issue? >> >> Thanks for your interest in my problem. >> >> Matt >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to > >> LISTSERV@.UGA > >> (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 > > > > > >----- >Please reply to the list and not to my personal email. >Those desiring my consulting or training services please feel free to >-- >View this message in context: http://spssx- discussion.1045642.n5.nabble.com/Aggregating-a-Binary-0-1-Variable- tp5717907p5717912.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 Eugene/David - Removing the '/BREAK=' does not change the output. Also, Jon, my 'goofy' syntax is only a slight variation of the pasted syntax from running the aggregate command from the dialogue. In fact it is from the dialogue that I discovered this issue. The syntax is only there for those who asked to see it. SPSS's Syntax AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK= /X_sum=SUM(X) /Y_sum=SUM(Y). My 'Goofy' Syntax > AGGREGATE > /OUTFILE=* MODE=ADDVARIABLES > /BREAK= > / X_sum Y_sum = SUM(X Y). > 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 |