help with creating new variable

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

Posts: 1
Joined: Fri May 30, 2014 7:41 pm

help with creating new variable

Postby yupha2005 » Fri May 30, 2014 7:44 pm


I am working on a data set about voter behavior with few level 1 variables such as age, gender, etc. I have created a household size variable, meaning I counted the number of times people with the same last name live at the same address. Thus, if there are three Schmidts at the exact same address, each were assigned a 3 as a count of family size.

Now, I want to create a variable describing the party mix for household (are people in a family voting homogeneously?). We have a variable describing which party a person is affiliated with.

I have no idea how to do that, and was hoping I might find some help or inspiration here... The dataset has 4 million registered voters in it, and I am a little lost on how to proceed.
Looking forward to your ideas!

Posts: 100
Joined: Mon May 19, 2014 6:06 am

Re: help with creating new variable

Postby RubenGeert » Fri May 30, 2014 8:15 pm

Hi Annette,

Since "vote" is a nominal variable, I'd say you can only describe homogeneity in votes by counting the distinct votes within each household and perhaps divide that by the household size? Or perhaps regress the number of different votes on the household sizes and use the residuals ("what can not be accounted for by the natural relation between household size and the number of different votes in a household")?

I assume your cases are persons in households and you want to keep your data at person (not household) level, right?

Kind regards,

Ruben Geert van den Berg

Who is online

Users browsing this forum: No registered users and 1 guest