Frequency table when one does not have CTABLES

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

Frequency table when one does not have CTABLES

Mark Webb-5
Is it possible to product a summary frequency table [shown below] without CTABLES in SPSS ? The percentages shown could also be frequency counts.


 

Consumption

Brand A

Brand B

Heavy user

30%

10%

Medium user

60%

30%

Light user

10%

60%

 


--
Mark Webb

Line +27 (21) 786 4379
Cell +27 (72) 199 1000
Fax to email +27 (86) 5513075
Skype  webbmark
Email  [hidden email]
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: Frequency table when one does not have CTABLES

Marta Garcia-Granero
El 29/09/2010 6:59, Mark Webb escribió:
Is it possible to product a summary frequency table [shown below] without CTABLES in SPSS ? The percentages shown could also be frequency counts.


 

Consumption

Brand A

Brand B

Heavy user

30%

10%

Medium user

60%

30%

Light user

10%

60%

 

Hi Mark:

Maybe this is too simple, but if I understand your question correctly, CROSSTABS would do something very close to what you want (although there are some row&column totals you should get rid of later, perhaps using OMS):

* Fake data *.
DATA LIST LIST/consumption brand frequency (3 F8).
BEGIN DATA
1 1 3
1 2 1
2 1 6
2 2 3
3 1 1
3 2 6
END DATA.
WEIGHT BY frequency.

CROSSTABS
  /TABLES=consumption  BY brand
  /FORMAT= AVALUE TABLES
  /CELLS= COLUMN.


Best regards,
Marta GG

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/
Reply | Threaded
Open this post in threaded view
|

Re: Frequency table when one does not have CTABLES

Mark Webb-5
  Sorry - I wasn't clear enough.
My brands aren't in one variable.
Each brand has it's own variable [column] in which the brands
consumption is indicated.

Record Brand A   Brand B
1                2               3
2                1               2
3                 3              3

So it's a summary crosstab showing only the total columns for each brand.

Mark Webb

Line +27 (21) 786 4379
Cell +27 (72) 199 1000
Fax to email +27 (86) 5513075
Skype  webbmark
Email  [hidden email]


On 2010/09/29 08:44 AM, Marta García-Granero wrote:

> * Fake data *.
> DATA LIST LIST/consumption brand frequency (3 F8).
> BEGIN DATA
> 1 1 3
> 1 2 1
> 2 1 6
> 2 2 3
> 3 1 1
> 3 2 6
> END DATA.
> WEIGHT BY frequency.
>
> CROSSTABS
>   /TABLES=consumption  BY brand
>   /FORMAT= AVALUE TABLES
>   /CELLS= COLUMN.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Frequency table when one does not have CTABLES

Marta Garcia-Granero
  El 29/09/2010 9:19, [hidden email] escribió:

>  Sorry - I wasn't clear enough.
> My brands aren't in one variable.
> Each brand has it's own variable [column] in which the brands
> consumption is indicated.
>
> Record Brand A   Brand B
> 1                2               3
> 2                1               2
> 3                 3              3
>
> So it's a summary crosstab showing only the total columns for each brand.

OK, what about this then?

DATA LIST LIST/Record BrandA BrandB (3 F8).
BEGIN DATA
1 2 3
2 1 2
3 3 3
END DATA.

COMPUTE K=1.
AGGREGATE
   /OUTFILE=*
   MODE=ADDVARIABLES
   /BREAK=K
   /BrandA_sum = SUM(BrandA)
   /BrandB_sum = SUM(BrandB).
COMPUTE PercentA = 100*BrandA/BrandA_sum .
COMPUTE PercentB = 100*BrandB/BrandB_sum .
FORMAT PercentA PercentB (Pct8.1).
VAR LABEL PercentA 'Brand A (%)' PercentB 'Brand B (%)'.

SUMMARIZE
   /TABLES=PercentA PercentB
   /FORMAT=LIST NOCASENUM TOTAL
   /TITLE='Percent by Brand'
   /MISSING=VARIABLE
   /CELLS=NONE.


--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Frequency table when one does not have CTABLES

ViAnn Beadle
When you have to tabulate multiple vars in a single table where each column
is a variable without CTABLES, the most direct route is to restructure the
file using VARSTOCASES. This will create an index variable and in this
particular case 2 times as many cases. I'll leave to the OP to figure this
out.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Marta García-Granero
Sent: Wednesday, September 29, 2010 1:32 AM
To: [hidden email]
Subject: Re: Frequency table when one does not have CTABLES

  El 29/09/2010 9:19, [hidden email] escribió:

>  Sorry - I wasn't clear enough.
> My brands aren't in one variable.
> Each brand has it's own variable [column] in which the brands
> consumption is indicated.
>
> Record Brand A   Brand B
> 1                2               3
> 2                1               2
> 3                 3              3
>
> So it's a summary crosstab showing only the total columns for each brand.

OK, what about this then?

DATA LIST LIST/Record BrandA BrandB (3 F8).
BEGIN DATA
1 2 3
2 1 2
3 3 3
END DATA.

COMPUTE K=1.
AGGREGATE
   /OUTFILE=*
   MODE=ADDVARIABLES
   /BREAK=K
   /BrandA_sum = SUM(BrandA)
   /BrandB_sum = SUM(BrandB).
COMPUTE PercentA = 100*BrandA/BrandA_sum .
COMPUTE PercentB = 100*BrandB/BrandB_sum .
FORMAT PercentA PercentB (Pct8.1).
VAR LABEL PercentA 'Brand A (%)' PercentB 'Brand B (%)'.

SUMMARIZE
   /TABLES=PercentA PercentB
   /FORMAT=LIST NOCASENUM TOTAL
   /TITLE='Percent by Brand'
   /MISSING=VARIABLE
   /CELLS=NONE.


--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
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