Computing top box percentages

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

Computing top box percentages

Mark Webb-5
I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.

--
Mark Webb

+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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: Computing top box percentages

ViAnn Beadle

IIRC, Custom Tables will generate tables with top box percents by subtotaling. Otherwise, recode your variables and use FREQUENCIES or CROSSTABS

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: Tuesday, October 27, 2009 6:59 AM
To: [hidden email]
Subject: Computing top box percentages

 

I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.


--
Mark Webb
 
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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: Computing top box percentages

tjohnson
In reply to this post by Mark Webb-5

Hi Mark

 

If I understand you correctly, this can easily be done via the RECODE function and DESCRIPTIVES.

 

For example:

 

RECODE v1 v2 v3 (0 1 2 3 4 5 6 7 = 0) (8 9 10 = 1) INTO v1x v2x v3x.

DESCRIPTIVES v1x v2x v3x .

 

The trick here is that the mean score is now the percentage of all respondents above a certain score (in this case >=8 on a 10 point scale).

 

If you have any missing responses, you can decide whether to include them in the percentage base (by coding SYSMIS = 0) or to exclude them.

 

Hope this helps

Tim

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: 27 October 2009 12:59
To: [hidden email]
Subject: Computing top box percentages

 

I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.


--
Mark Webb
 
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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: Computing top box percentages

John F Hall
That gives you proportions, not percent.  If you want %% you need to recode to 100, not 1.  Also using LO or HI can be dangerous if there any values outside the range 0 - 10 which you don't know about.
 
If you want any breakdown (as means used to be called)  you can use
 
means v1x to v3x by ... [by ....]
 
and fiddle around with the pivot table.
 
----- Original Message -----
Sent: Tuesday, October 27, 2009 3:26 PM
Subject: Re: Computing top box percentages

Hi Mark

 

If I understand you correctly, this can easily be done via the RECODE function and DESCRIPTIVES.

 

For example:

 

RECODE v1 v2 v3 (0 1 2 3 4 5 6 7 = 0) (8 9 10 = 1) INTO v1x v2x v3x.

DESCRIPTIVES v1x v2x v3x .

 

The trick here is that the mean score is now the percentage of all respondents above a certain score (in this case >=8 on a 10 point scale).

 

If you have any missing responses, you can decide whether to include them in the percentage base (by coding SYSMIS = 0) or to exclude them.

 

Hope this helps

Tim

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: 27 October 2009 12:59
To: [hidden email]
Subject: Computing top box percentages

 

I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.


--
Mark Webb
 
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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: Computing top box percentages

tjohnson

That is correct, thanks John! I always get these terms confused :)

 

From: John F Hall [mailto:[hidden email]]
Sent: 27 October 2009 16:10
To: Johnson, Timothy; [hidden email]
Subject: Re: Re: Computing top box percentages

 

That gives you proportions, not percent.  If you want %% you need to recode to 100, not 1.  Also using LO or HI can be dangerous if there any values outside the range 0 - 10 which you don't know about.

 

If you want any breakdown (as means used to be called)  you can use

 

means v1x to v3x by ... [by ....]

 

and fiddle around with the pivot table.

 

----- Original Message -----

Sent: Tuesday, October 27, 2009 3:26 PM

Subject: Re: Computing top box percentages

 

Hi Mark

 

If I understand you correctly, this can easily be done via the RECODE function and DESCRIPTIVES.

 

For example:

 

RECODE v1 v2 v3 (0 1 2 3 4 5 6 7 = 0) (8 9 10 = 1) INTO v1x v2x v3x.

DESCRIPTIVES v1x v2x v3x .

 

The trick here is that the mean score is now the percentage of all respondents above a certain score (in this case >=8 on a 10 point scale).

 

If you have any missing responses, you can decide whether to include them in the percentage base (by coding SYSMIS = 0) or to exclude them.

 

Hope this helps

Tim

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: 27 October 2009 12:59
To: [hidden email]
Subject: Computing top box percentages

 

I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.

--
Mark Webb
 
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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: Computing top box percentages

John F Hall
This is a bit longer than a normal posting, but I hope it helps.
 
My suggested use of means in my last posting may not have been clear.  I'm not quite sure what you want the tables to look like, but if the values of interest are recoded 0,100 a mean is then a %.  It's an old trick, but useful for summary tables.  Here's something I just tried out on a survey, "Quality of Life in Britain", in collaboration with Ann Arbor.  It's from 1975, hence capital letters and var*** names. The survey is full of 0 - 10 rating scales on various life domains and subdomains. 
 
temp.

recode var149 (0 thru 7 = 0)(8,9,10 = 100)(else = sysmis).

means var149 by agegroup by sex.

then fiddle with pivot table to move sex to cols, dump stats to layer to get...

                                                         Report

 

QA14  OVERALL HOUSE SATISFACTION

Mean

 

Agegroup of repondent

Sex of Respondent

Men

Women

Total

17-29

61.4

60.9

61.1

30-44

58.9

64.2

62.0

45-59

67.9

68.5

68.2

60 or over

83.7

78.5

80.4

Total

68.1

68.9

68.6

 
I've also just had another look at your original query and been playing around with data from the same survey.
 
Analyze
...Tables
   ...Tables of Frequencies
 
Be nice if I could just scroll down the Data Editor, ctrl click the variables I want, right click and send direct to a menu, but there you go.  It takes a while because the you can't see much in the display and I couldn'b bothered to switch to varname display, but it's my lazy way of getting the  syntax and at least the variables are adjacent in the file!  It's taken an hour or so, but it gets my head round pivoting and I think I've found a solution. 
 
SPSS auto syntax was....

TABLES

/FORMAT BLANK MISSING('.') /TABLES

(LABELS) BY

( var136 + var137 + var138 + var139 + var140 + var141 + var142 + var143 +

var144 + var145 + var146 + var147 + var148 + var149 )

/STATISTICS

CPCT ((PCT7.1) ) .

(Double spacing straight from SPSS, not me)  but that only does it with the original 0-10 values (even though I'd already done a temp recode in syntax) and SPSS doesn't know what value 100 is, so I copied the above it to a syntax file and stuck my temp recodes and a var label at the beginning and reran it.
 
temp.

recode var136 to var149 (0 thru 7 = 0)(8,9,10 = 100)(else = sysmis).

val lab var136 to var149 0 'Dissatisfied' 100 'Satisfied'.

TABLES

/FORMAT BLANK MISSING('.') /TABLES

(LABELS) BY

( var136 + var137 + var138 + var139 + var140 + var141 + var142 + var143 +

var144 + var145 + var146 + var147 + var148 + var149 )

/STATISTICS

CPCT ((PCT7.1) ) .

...then a bit fiddly with the pivoting to get the table below. 
 

 

Dissatisfied

Satisfied

QA13A KITCHEN

Count Percent

50.5%

49.5%

QA13B NUMBER OF ROOMS

Count Percent

26.4%

73.6%

QA13C SHAPE AND SIZE OF ROOMS

Count Percent

32.5%

67.5%

QA13D KEEPING WARM IN WINTER

Count Percent

44.2%

55.8%

QA13E KEEPING IT CLEAN AND TIDY

Count Percent

26.0%

74.0%

QA13F BATHS OR SHOWERS

Count Percent

22.3%

77.7%

QA13G FREEDOM FROM NOISE

Count Percent

26.4%

73.6%

QA13H FREEDOM FROM DAMP

Count Percent

33.9%

66.1%

QA13I VIEW FROM WINDOWS

Count Percent

42.5%

57.5%

QA13J PRIVACY FROM NEIGHBOURS

Count Percent

22.3%

77.7%

QA13K COST OF RATES,REPAIRS

Count Percent

57.3%

42.7%

QA13L STATE OF REPAIR

Count Percent

33.4%

66.6%

QA13M APPEARANCE FROM OUTSIDE

Count Percent

39.5%

60.5%

QA14  OVERALL HOUSE SATISFACTION

Count Percent

31.6%

68.4%

 
 
Don't really need dissatisfied or the % signs and certainly not the count percent: far too cluttered for publication. 
 
 It's certainly not what I'd be looking for, but I persevered, had a brainwave and came up with a neat solution. 

temp.

recode var136 to var149 (0 thru 7 = 0)(8,9,10 = 100)(else = sysmis).

mult resp groups

Satisfied (var136 to var149 (100))

/freq satisfied.

It took a bit of editing the pivot, copying to Word, editing in Word to adjust column widths and get rid of hidden column separators to get this much more presentable table.  Old Dog, Old Tricks again, eh?
 

 

Percent of Cases

 

QA13A KITCHEN

50.3%

 

QA13B NUMBER OF ROOMS

74.9%

 

QA13C SHAPE AND SIZE OF ROOMS

68.7%

 

QA13D KEEPING WARM IN WINTER

56.7%

 

QA13E KEEPING IT CLEAN AND TIDY

75.4%

 

QA13F BATHS OR SHOWERS

79.1%

 

QA13G FREEDOM FROM NOISE

74.9%

 

QA13H FREEDOM FROM DAMP

67.3%

 

QA13I VIEW FROM WINDOWS

58.5%

 

QA13J PRIVACY FROM NEIGHBOURS

79.1%

 

QA13K COST OF RATES,REPAIRS

41.8%

 

QA13L STATE OF REPAIR

67.8%

 

QA13M APPEARANCE FROM OUTSIDE

61.4%

 

QA14  OVERALL HOUSE SATISFACTION

69.1%

 
I'd also get rid of the percent signs and just have a single % in the column header.
I'd also get rid of the percent signs and just have a single % in the column header From: [hidden email]
Sent: Tuesday, October 27, 2009 5:39 PM
Subject: Re: Computing top box percentages

That is correct, thanks John! I always get these terms confused :)

 

From: John F Hall [mailto:[hidden email]]
Sent: 27 October 2009 16:10
To: Johnson, Timothy; [hidden email]
Subject: Re: Re: Computing top box percentages

 

That gives you proportions, not percent.  If you want %% you need to recode to 100, not 1.  Also using LO or HI can be dangerous if there any values outside the range 0 - 10 which you don't know about.

 

If you want any breakdown (as means used to be called)  you can use

 

means v1x to v3x by ... [by ....]

 

and fiddle around with the pivot table.

 

----- Original Message -----

Sent: Tuesday, October 27, 2009 3:26 PM

Subject: Re: Computing top box percentages

 

Hi Mark

 

If I understand you correctly, this can easily be done via the RECODE function and DESCRIPTIVES.

 

For example:

 

RECODE v1 v2 v3 (0 1 2 3 4 5 6 7 = 0) (8 9 10 = 1) INTO v1x v2x v3x.

DESCRIPTIVES v1x v2x v3x .

 

The trick here is that the mean score is now the percentage of all respondents above a certain score (in this case >=8 on a 10 point scale).

 

If you have any missing responses, you can decide whether to include them in the percentage base (by coding SYSMIS = 0) or to exclude them.

 

Hope this helps

Tim

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: 27 October 2009 12:59
To: [hidden email]
Subject: Computing top box percentages

 

I want to compute top 2 or 3 box % which are the number of respondents above a certain score [like >8 on a 10 point scale] as a % of all answering the question.
I have some syntax that works but isn't very elegant when there are many such calculations to do.
Does anyone have a more elegant solution that is useful for many calculations.

My version is shown below ....

Compute unity = 1.
exe.

count xx=qq179(71.4 thru hi).    [this is top 3 cut point for my 7 point scale 0-100]
count yy=qq179(0 thru hi).         [this excludes those not rating this question.]
exe.

AGGREGATE
  /OUTFILE=*
  MODE=ADDVARIABLES
  /BREAK=unity
  /xx_sum = SUM(xx) /yy_sum = SUM(yy).

Compute T3q179x = ((xx_sum/yy_sum))*100.
exe.

--
Mark Webb
 
+27 21 786 4379
+27 72 199 1000
Skype - webbmark
[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