|
SPSS IBMers! If I use the sum function in aggregate are all values
included. In other words, if there is a category that only has one value, is
that included in the sum, or do I need to use sum.1 as I would in a regular
compute statement to be sure that cases with only one value are included in the
sum. Thanks! Matt Matthew Pirritano, Ph.D. Research Analyst IV Medical Services Initiative (MSI) Orange County Health Care Agency (714) 568-5648 |
|
Dear Matthew,
Do you mean a variable that contains only a single valid value? Can't you try with a small test data set what happens? It seems that sum.2 applies to within-case summation, not summation within a variable over cases. See data list free /tinkywinky. begin data '' '' '' '' '' '' 1 end data. comp dum=0. agg /out * /bre dum /lala=sum.2(tinkywinky). exe. HTH, Ruben van den Berg Date: Mon, 7 Dec 2009 09:43:39 -0800 From: [hidden email] Subject: sum as used in aggregate To: [hidden email] SPSS IBMers!
If I use the sum function in aggregate are all values included. In other words, if there is a category that only has one value, is that included in the sum, or do I need to use sum.1 as I would in a regular compute statement to be sure that cases with only one value are included in the sum.
Thanks! Matt
Matthew Pirritano, Ph.D. Research Analyst IV Medical Services Initiative (MSI) Orange County Health Care Agency (714) 568-5648
New Windows 7: Find the right PC for you. Learn more. |
|
In reply to this post by mpirritano
At 12:43 PM 12/7/2009, Pirritano, Matthew wrote:
SPSS IBMers! Hmmmph. It'll always be SPSS to me, no matter who buys it, or rebrands it. If I use the sum function in aggregate are all values included. In other words, if there is a category that only has one value, is that included in the sum, or do I need to use sum.1 as I would in a regular compute statement to be sure that cases with only one value are included in the sum. From the Command Syntax Reference: By default, AGGREGATE uses all nonmissing values of the source variable to calculate aggregated variables. An aggregated variable will have a missing value only if the source variable is missing for every case in the break group. (Boldface emphasis added) ===================== 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 |
|
Thanks Richard, Not sure how I missed that. Matthew Pirritano, Ph.D. Research Analyst IV Medical Services Initiative (MSI) Orange County Health Care Agency (714) 568-5648 From: SPSSX(r)
Discussion [mailto:[hidden email]] On
Behalf Of Richard Ristow At 12:43 PM 12/7/2009, SPSS IBMers!
If I use the sum function in aggregate are all values included. In
other words, if there is a category that only has one value, is that included
in the sum, or do I need to use sum.1 as I would in a regular compute statement
to be sure that cases with only one value are included in the sum.
By default, AGGREGATE uses
all nonmissing values of the source variable to calculate aggregated variables.
An aggregated variable will have a missing value only if the source variable is
missing for every case in the
break group.
===================== 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 |
