Hi all,
I'm new here, so my apologies if this is the wrong place for a question like this. I am conducting research using data from the Canadian Community Health Survey, and I am having some difficulty with my dummy and coding and was hoping someone would be able to help me out. I am trying to recode a continuous variable (GEODGHR4), the values for which are 5-digit Canadian health region codes. My goal is to recode into two categories: urban and rural. From my understanding, the syntax for this was
"recode [variable] (value/value/value/value = recoded value)"
When I try to recode this GEODGHR4 variable this way:
recode GEODGHR4 (10911/10912/10913/11900/12901/12902/12903/12904/13901/13902/13903/13904/13906/24901/24902/24904/24905/24907/24908/24909/24911/24912/2
> 4915/35926/35927/35931/35933/35934/35935/35938/35939/35940/35941/35942/35943/35947/35949/35952/35955/35956/35957/35958/35960/35961/35962/35966/46902/4
> 6903/46904/46905/47901/47905/47906/47907/47909/48931/48933/48935/59911/59912/59913/59914/59921/59922/59933/59941/59942/59943/59951/59952/59953/60901/6
> 1901/62901=0)(24906/24903/24914/35930/35936/35937/35944/35946/35951/35953/35965/35968/35970/35995/46901/47904/48932/48934/59923/59931/59932=1)
I receive the following error:
unknown el / in rule
r(198);
I know that this means I have invalid syntax, but this is literally the only applicable way our professor taught us to recode. The other way, using the "generate" command" did not seem suited to this many values. If you have any input for a newbie like me, I would greatly appreciate it.
Thanks!
Harrison
Related Posts with Help needed: Dummy coding for Canadian Community Health Survey
Social-Network Peer Effect Regression AnalysisI am estimating peer effect of students on their GPA score using Friendship network model. The model…
What is intreg? What is the theory behind it?The UCLA IDRE website has an article on -intreg- to estimate models with interval dependent variable…
How to create groups of observations based on shared characteristics and create variables around that.So I'm doing some work with election data. The data I have is formatted like this: Code: * Example…
Export multiple xtabond2 resultsHello Statalist users, I need help with exporting multiple xtbond2 estimations along with their pos…
Diff-in-diff graphI am currently running a diff-in-diff analysis on stop and frisk policies in new york city using New…
Subscribe to:
Post Comments (Atom)
0 Response to Help needed: Dummy coding for Canadian Community Health Survey
Post a Comment