Sum Percents in spss-tables?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sum Percents in spss-tables?

marlene-7
Hello,
I’m trying to use SPSS-tables to calculate and display SUM percents rather
than count percents.

My survey datafile contains one case for each school.  Each case includes
variables that report the enrollments in various demographic categories
(number of male students, number of female students, number of minority
students, etc.).

Raw data look like this:
School … Men … Women … total
Univ-X … 11 ……..  33 ……..44
Univ-Y …  23  â€¦â€¦.10 ……..33
Univ-Z …  20 ……..22………..42

My attempt at syntax…

 tables
  /observation total men women white minority
  /ptotal=t1 'N='
  /table= t1 +  men + women +white +minority by (statistics)
  /statistics= sum spct validn.

…just displays “100%” for each variable.

Is there a way to get spss to report, for example, what percent of the total
are women?

I want the table to look like this:

Total  119:…..100 %
men:    54…....45%
women: 65…..   55%

Thanks in advance for any advice.
Marlene
Reply | Threaded
Open this post in threaded view
|

Re: Sum Percents in spss-tables?

ViAnn Beadle
You're going about this the wrong way given the way your data are structured.

The sum percent statistic is calculated across groups defined by a variable. You don't have a group variable. Do you really want a simple table with one percentage for each of your variables across all universities? If so here is a simple example. All of the actual calculations are done with AGGREGATE which creates a single case; and COMPUTE which calculates the percentage.

The only function of TABLES is to flip the results into a little nicely printable table.

----------------------------------------------------------------------------------

data list list / university(a1) men women total.
begin data
x 11 33 44
y 23 10 33
z 20 22 42
end data.
compute nobreak=1.

AGGREGATE
 /OUTFILE=*
 /BREAK=nobreak
 /men_sum = SUM(men)
 /women_sum = SUM(women)
 /tot_sum = SUM(total).

DO REPEAT demopcts= men women total/demosums=men_sum women_sum tot_sum.
COMPUTE demopcts=demosums/tot_sum *100.
END REPEAT..
VARIABLE LABELS men "Men" women "Women" total "Total".

FORMATS men women total (pct6.2).
* General Tables.
TABLES
 /OBSERVATION= total men women
 /TABLE=total + men + women  .





-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of marlene
Sent: Thursday, July 05, 2007 2:23 PM
To: [hidden email]
Subject: Sum Percents in spss-tables?

Hello,
I’m trying to use SPSS-tables to calculate and display SUM percents rather
than count percents.

My survey datafile contains one case for each school.  Each case includes
variables that report the enrollments in various demographic categories
(number of male students, number of female students, number of minority
students, etc.).

Raw data look like this:
School … Men … Women … total
Univ-X … 11 ……..  33 ……..44
Univ-Y …  23  â€¦â€¦.10 ……..33
Univ-Z …  20 ……..22………..42

My attempt at syntax…

 tables
  /observation total men women white minority
  /ptotal=t1 'N='
  /table= t1 +  men + women +white +minority by (statistics)
  /statistics= sum spct validn.

…just displays “100%” for each variable.

Is there a way to get spss to report, for example, what percent of the total
are women?

I want the table to look like this:

Total  119:…..100 %
men:    54…....45%
women: 65…..   55%

Thanks in advance for any advice.
Marlene