Recode Variables with Text File Condition/Value List

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

rdone
Posts: 3
Joined: Mon Mar 06, 2017 1:23 pm

Recode Variables with Text File Condition/Value List

Postby rdone » Thu Oct 12, 2017 11:45 pm

I need to recode about 14K possible values into a couple hundred values using a text file of conditions (ICD codes into CCS groupers, in case someone knows of existing SPSS code to do this). My idea is to use a macro and/or loop function, but I haven't found any code out there that references a text file of recoding conditions/values. Apologies in advance if this common knowledge, but can someone point me in the right direction? Thanks.
statman
Administrator
Posts: 2756
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: Recode Variables with Text File Condition/Value List

Postby statman » Fri Oct 13, 2017 12:13 am

Need more info and ............
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
rdone
Posts: 3
Joined: Mon Mar 06, 2017 1:23 pm

Re: Recode Variables with Text File Condition/Value List

Postby rdone » Fri Oct 13, 2017 12:36 am

Win7 Ultimate 64, SPSS 22 64.
The code needs to look at the value of a single variable for every case in my data set, compare it to all of the values in column a of $dxref 2015.csv, and assign the corresponding recode value in column b. At https://www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp#download you can download the zip file for Single Level CCS, unzip, open the file $dxref 2015.csv and see columns a and b.
So can you point me to a solution for referencing the csv file for recoding?
JonPedersen
Posts: 119
Joined: Wed May 25, 2011 7:07 am
Contact:

Re: Recode Variables with Text File Condition/Value List

Postby JonPedersen » Mon Dec 18, 2017 9:47 am

Hi,
In case you have not found a solution:
Translate the CSV to a SPSS dataset
Sort your file with codes, as well as the new dataset (by the full ICD code).
use either match files or Star Join to match the code in the translation dataset to your full ICD codes.
Jon

Who is online

Users browsing this forum: No registered users and 2 guests

cron