Calculating a proportion

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

Calculating a proportion

Jeff A

 

Here’s a description of what I want to do:

 

I have XX survey participants where variable A is the number of cases each year that each participant handles and variable B is the total number of yes’s among those A cases. So I can easily calculate a variable C that is the proportion of yes’s per participant as B/A. …but how do I work with a single value in SPSS to get an overall proportion of yes’s among all participants. E.g., if there are 2500 cases total for the 100 participants and 250 of those are yes’s how can I use SPSS syntax to print out 10% - 250/2500 ? Stated another way, I need to Sum B among the 100 and divide by Sum A. Obviously, I can do this by hand, but it has to be done numerous times so I want to do it within spss.

 

Jeff

 

===================== 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: Calculating a proportion

Maguin, Eugene

Look at the aggregate command.

You won’t specify break variables because the dataset is the group. Sum variable A and sum variable B. I’m not sure what you want for the outcome. If you want append SumA and SumB to the existing data set specify mode=addvariables. If you want create a new dataset which will have one record then do no specify mode=add variables. Either way, the one remaing step is the divide SumA by SumB.

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Jeff
Sent: Wednesday, January 08, 2020 11:13 PM
To: [hidden email]
Subject: Calculating a proportion

 

 

Here’s a description of what I want to do:

 

I have XX survey participants where variable A is the number of cases each year that each participant handles and variable B is the total number of yes’s among those A cases. So I can easily calculate a variable C that is the proportion of yes’s per participant as B/A. …but how do I work with a single value in SPSS to get an overall proportion of yes’s among all participants. E.g., if there are 2500 cases total for the 100 participants and 250 of those are yes’s how can I use SPSS syntax to print out 10% - 250/2500 ? Stated another way, I need to Sum B among the 100 and divide by Sum A. Obviously, I can do this by hand, but it has to be done numerous times so I want to do it within spss.

 

Jeff

 

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

Re: Calculating a proportion

Jeff A

 

Thanks. I’ll try later when I’m able. I figured that I would have to create another data set but wasn’t aware of the addvariables option.

 

Jeff

 

 

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Maguin, Eugene
Sent: Thursday, January 9, 2020 11:39 PM
To: [hidden email]
Subject: Re: Calculating a proportion

 

Look at the aggregate command.

You won’t specify break variables because the dataset is the group. Sum variable A and sum variable B. I’m not sure what you want for the outcome. If you want append SumA and SumB to the existing data set specify mode=addvariables. If you want create a new dataset which will have one record then do no specify mode=add variables. Either way, the one remaing step is the divide SumA by SumB.

 

Gene Maguin

 

 

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Jeff
Sent: Wednesday, January 08, 2020 11:13 PM
To: [hidden email]
Subject: Calculating a proportion

 

 

Here’s a description of what I want to do:

 

I have XX survey participants where variable A is the number of cases each year that each participant handles and variable B is the total number of yes’s among those A cases. So I can easily calculate a variable C that is the proportion of yes’s per participant as B/A. …but how do I work with a single value in SPSS to get an overall proportion of yes’s among all participants. E.g., if there are 2500 cases total for the 100 participants and 250 of those are yes’s how can I use SPSS syntax to print out 10% - 250/2500 ? Stated another way, I need to Sum B among the 100 and divide by Sum A. Obviously, I can do this by hand, but it has to be done numerous times so I want to do it within spss.

 

Jeff

 

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

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