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
Creating a dummy based on groupI am having some data by group and would want to create a dummy of whether there’s at least one case…
panel data with 2 different kinds of time unitsHello! I have an issue with some data I want to work with. I like to use panel data to execute a dif…
Expand year month in data A to merge with monthly data B -date function?Dear all, My goal is to merge DataA with DataB based on ticker and matching year and month in order …
Calculating portfolio returns before formationHi all, I am trying to create hedge portfolios for different asset pricing models like Daniel, Mota,…
Reshape data and order contents in columnsDear community, I would like to transfer a data record from the long to the wide format and combine…
Subscribe to:
Post Comments (Atom)
0 Response to Help needed: Dummy coding for Canadian Community Health Survey
Post a Comment