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
bootstrap: 'size() must not be greater than number of clusters' and 'insufficient observations to compute bootstrap standard errors'Hi, I want to use bootstrap to estimate subsample regressions. I use two ways but both don't work. …
How to run a regression per observationDear all, I'm trying to determine the degree of conservatisme In order to do that I want to use the…
Should ATT equal ATU?Dear Stata users, This is a question pertaining to propensity score matching, or put it more correc…
How to avoid scientific notation when displaying valuesI would like to know the total number of non-missing observations as well as the number of distinct …
Stata help overconfidence MeasureHi, I am doing research which requires me to calculate a variable of Overconfidence measure for CEO…
Subscribe to:
Post Comments (Atom)
0 Response to Help needed: Dummy coding for Canadian Community Health Survey
Post a Comment