Wednesday, June 6, 2012

Recoding Variables

This post is a combined effort of Megan H, Denise M, and Steven B. 

In case you are in the middle of recoding your data here are some tips and an example from our paper and syntax.  First when you recode the data you need to find a way to make your independent variables coded the same.  As seen below we decided to take a number of different survey questions and code them 0-2.  This gave us a chance to categorize the people into categories despite the questions asking different things.  In our example there are three different types of questions being asked but we were able re-code them so we could measure and compare the variables with one another.  This is at the discretion of the researcher but when you do this you should explain why you coded it as you did.   This is our example from our paper. 

In our study we have decided to code all of our independent variables on a 0-2 scale. 0 codes as a non- gamer, 1 as a moderate gamer, and 2 as an extreme gamer.  We decided these measurements were best to get measurable and meaningful results for our research.  We have five independent variables for our study that all have to do with playing computer or internet games. 

First, Xbox live, was measured, originally in the survey each respondent was asked their status of X-box live with the following options, Never Used; Previous User; Currently Active.  We decided to code never used as a zero (non-gamer), previously used as a 1 (moderate gamer), and currently active as a 2 (Extreme Gamer)

Students were asked the same question about World of Warcraft was asked, measured, and coded in the exact same format of x-box live. 
Students were asked in general if they played computer games or not on the survey given.  We coded those who do not as a 0.  We coded those who do as a 2.

Student who originally completed the survey was asked how often they played Facebook Games, the possible responses were  Hourly; Several times a day; Once a day; Several times a week; Once a week; Rarely; Never.  We coded this on the 0-2 scale as well, Never and non-applicable were coded as 0, and, rarely, once a week, and several times a week were all coded as a 1,  Once a day, several times a day, and hourly were all coded a 2.

Students were also asked how frequently they played Internet games in general.   This question had the same possible responses as Facebook games and we coded it the same as Facebook games.

This was our syntax for recoding, Check your syntax for what numbers were originally coded in order to re-code.  If your codebook is not clear you can run summaries and histograms of the variables to try to find out what the code is.  

 S1.SNS.XboxLive<-recode(S1.SNS.XboxLive, "1=0; 2=1; 3=2")
S1.SNS.WoW<-recode(S1.SNS.WoW, "1=0; 2=1; 3=2")
S1.OUT.GameCon<-recode(S1.OUT.GameCon, "NA=0; 7=2")
S1.CU.Games<-recode(S1.CU.Games, "NA=0; 2=2")
S1.FBU.Game<-recode(S1.FBU.Game, "7=0; NA=0; 6=1; 5=1; 4=1; 3=2; 2=2; 1=2")
S1.IU.Games<-recode(S1.IU.Games, "7=0; NA=0; 6=1; 5=1; 4=1; 3=2; 2=2; 1=2")

Check that your re-codes are accurate when you are finished recoding by running histograms of the variables to make sure your recodes were accurate.  This helped us spot multiple mistakes we made before our re-codes were finally done correctly

No comments:

Post a Comment