cases by variables split

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

cases by variables split

Postby FibonaciSPSS » Tue Feb 11, 2014 1:37 pm

First of all hello to everybody. Sorry for my bad English if you dont understand something.

I am college student and use SPSS for my science project.

My problem is:
I have 100 different cases, and 10 variables. Every variable has 3 values (positive, negative, intermediate).
I want to count how much of my cases has 1 positive out of 10 variables, how much has 2, 3, 4 positive variables of 10...
example: 20 cases have 1 positive variable
30 cases have 2 positive variables
50 cases have 5 positive variables.

I hope you understood me, and I expect some good answers. Thank you! :D
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: cases by variables split

Postby GerineL » Tue Feb 11, 2014 3:28 pm

The count function will probably get you what you need.

transform -> count values within cases
FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

Re: cases by variables split

Postby FibonaciSPSS » Tue Feb 11, 2014 3:49 pm

I have done it. But know another question. It counts a number of positive values for each case and represents it as new variable.
But I wanna know another thing. I have 10 variables, i count positive values for each case among them.
Example: case 1 is positive for 3 of 10 values, can I know somehow labels of those positive values? I know it is not problem to read them for one case, but for multiple number it is....
Thanks in advance, and thanks for last answer :) :) :)
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: cases by variables split

Postby GerineL » Tue Feb 11, 2014 5:07 pm

I am not sure what you mean.

Do you mean you want to know the total number of cases that gives a positive score to a certain variable?

If yes, and they are coded 1 = positive 0 = negative, you can use aggregate (n) function.
FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

Re: cases by variables split

Postby FibonaciSPSS » Tue Feb 11, 2014 8:52 pm

Ok! Your first comment works brilliant. Count function shows me number of positive values in variables for each case.
What I want now to know is:

Count function tells me that CASE1 is postive on 3 from 10 variables. That is totally ok.
But is there a function in SPSS that shows me which are those 3 of 10 variables? Can it be listed by name or label, in sort of output?

My science project is about bacterias and antimicrobial resistance.
If my bacteria1 is resistant to 3 of 10 antibiotics (count function tells me this), I want to have a list of those 3 antibiotics, I hope you understand now :)
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: cases by variables split

Postby GerineL » Thu Feb 13, 2014 12:21 pm

what I would do here is make sure the "resistance" variables are coded 1 - 0 (or something like that).

now use restructure to create a file where you have

bacteria 1 - antibiotic 1 - resistance
bacteria 1 - antibiotic 2 - resistance
bacteria 1 - antibiotic 3 - resistance
bacteria 1 - antibiotic 4 - resistance
bacteria 1 - antibiotic 5 - resistance

then use select cases command to delete cases with resistance = 0.
FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

Re: cases by variables split

Postby FibonaciSPSS » Thu Feb 13, 2014 1:28 pm

Ok! Do I use restructure variable to cases, cases to variables, or transpose all data? :cry:
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: cases by variables split

Postby GerineL » Thu Feb 13, 2014 1:51 pm

variable to cases. send me a pm with your email adress, I'll send you a manual I wrote.
FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

Re: cases by variables split

Postby FibonaciSPSS » Thu Feb 13, 2014 3:59 pm

I managed to do variable to cases, buy now I cant see what i wanted again....
I have 9 bacteria species, and 10 antibiotics.
For example:
First 20 cases are one species, second 34 cases are second species...
How can I manage to sort them with this to see: to antbiotic1, 2 and 3, are restistan 5 species1
: to antibiotic 4,5 are resistant 10 species 1
: rest 5 species 1 are not resistant
And so on for every species, I cant figure it out of your tutorial...
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: cases by variables split

Postby GerineL » Fri Feb 14, 2014 9:07 am

are there an equal amount of cases per bacteria?
FibonaciSPSS
Posts: 6
Joined: Tue Feb 11, 2014 1:31 pm

Re: cases by variables split

Postby FibonaciSPSS » Fri Feb 14, 2014 10:35 am

no, number of cases per bacteria is di#erwnt...

Who is online

Users browsing this forum: No registered users and 4 guests

cron