## survey dataset - combining cases

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

newbie11
Posts: 4
Joined: Mon Feb 10, 2014 12:19 am

### survey dataset - combining cases

Hi everyone:

I'm working with survey data. I'm interested in people who report having been victims of crime. The survey asks people several questions about whether they've been the victim of different types of crime (for example, stolen property, assault, and so on...).

What I want to do is combine all of those separate crime variables into a single variable that's just an aggregate victimization variable. I'm a total newbie (see the name!) so I don't know how to do this without making some mistake like counting cases twice (e.g. someone who reports having been the victim of multiple types of crime gets counted once for each crime reported).

I'm assuming (hoping!) that this is a "dumb" question. Can anyone help?

Thank you!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: survey dataset - combining cases

What does your datafile look like?
e.g., is there one line per case and then all the possible crime variables next to each other, or does one person have multiple lines for each crime?
newbie11
Posts: 4
Joined: Mon Feb 10, 2014 12:19 am

### Re: survey dataset - combining cases

I confess to not being entirely sure how to answer.

Each case (or survey respondent) is a row in the data set. Each crime variable is a column. So, "have you been assaulted in the last 12 months" is a column and it's next to "have you had property >\$50 stolen in past 12 months?" And so on.

There are about five crime questions/variables in the data set.

Does that sort of get at what you asked me? I'm not sure. Thanks for the response!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: survey dataset - combining cases

Ok so is there just 1 = yes 0 = no for each variable?
What do you want to compute?
A total of how many crimes? a mean over some other variable? What is it you want to achieve?
newbie11
Posts: 4
Joined: Mon Feb 10, 2014 12:19 am

### Re: survey dataset - combining cases

Yes, each is 1=yes, 0=no.

I'm interested in whether being a victim of crime is correlated with a few attitudinal and behavioral variables.

So, for instance, whether victimization is correlated with hours devoted to community service each month, or something like that. I'm supposed to run a few bivariate regressions.

GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: survey dataset - combining cases

Ok I think you can simply use an if funtion to get what you need!!

if (crime1 = 1 | crime2 = 1 | crime3 = 1 etc.) EverVictim = 1.
execute.

between ( ) put every variable you have for victim. So replace crime1 with your first variable name etc.

EverVictim will be the new variable.

recode EverVictim (sysmis = 0).
execute.

this part recodes all misings to 0, so if there was no crime defined in the first part, this gets a 0.
Note! this will only work if you have no missings, because it will replace all missings by 0, also those you may not have had information on. just skip this part if you want.
newbie11
Posts: 4
Joined: Mon Feb 10, 2014 12:19 am

### Re: survey dataset - combining cases

Gutnre - this is wonderful! Thank you.

My big concern was that I don't count respondents/cases twice. For instance, if someone has been the victim of an assault and a property crime, I don't want to count them twice. So, no matter how many times they've been victimized, I just want to know whether they've "ever been a victim," to paraphrase your last response. Will your method avoid the double-counting concern?

Thanks so much for your help. Last question out of me!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

### Re: survey dataset - combining cases

yes, it gets a 1 if a person is a victim, and it gets a 1 again if a person is a victim for another crime again, but that doesn't matter (1 is 1).

### Who is online

Users browsing this forum: No registered users and 2 guests