Dear SPSS Experts, I have two different files now: Excel and SPSS files. The excel file contains the list of 1500 "city address" with corresponding values/codes(e.g., 1= city1, 2=city2, 3=city3, ....1500=city1500). Now, I will add the "city address" to my SPSS file. Is there a way to input the codes/values to SPSS without encoding manually the 1500 codes/values? Your help is highly solicited. Thank you. Eins |
I will be out of the office October 18th-22nd, returning on the 23rd. If you need immediate assistance please call the main office number 503/223-8248 or 800/788-1887
and an office assistant will ensure that your need is addressed. Kelly |
In reply to this post by E. Bernardo
Dear Eins,
This sounds like you basically need a "match files" command with one file and one table. IIRC (but I usually mess up this part) the Excel file will be the file (unique keys) and the SPSS file the table (possibly duplicate keys, there can be multiple respondents with the same city code). You may first need to read the xls into SPSS and apply a bit of editing, depending on the exact format. HTH, Ruben Date: Thu, 18 Oct 2012 10:50:46 +0800 From: [hidden email] Subject: importing codes/values from excel to spss To: [hidden email] Dear SPSS Experts, I have two different files now: Excel and SPSS files. The excel file contains the list of 1500 "city address" with corresponding values/codes(e.g., 1= city1, 2=city2, 3=city3, ....1500=city1500). Now, I will add the "city address" to my SPSS file. Is there a way to input the codes/values to SPSS without encoding manually the 1500 codes/values? Your help is highly solicited. Thank you. Eins |
In reply to this post by E. Bernardo
Eins, there’s some things missing in your problem description. I’ve seen what Ruben said and agree. In addition, I wonder if the two files have a common key. I also wonder if there is a one to one correspondence between rows in the excel file and rows in the spss file. If there were a 1-to-1 correspondance you could create a key using $casenum. Or, use match files without a BY subcommand (I think I recall that I did this and it worked and yielded no errors.) Gene Maguin From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eins Bernardo Dear SPSS Experts, I have two different files now: Excel and SPSS files. The excel file contains the list of 1500 "city address" with corresponding values/codes(e.g., 1= city1, 2=city2, 3=city3, ....1500=city1500). Now, I will add the "city address" to my SPSS file. Is there a way to input the codes/values to SPSS without encoding manually the 1500 codes/values? Your help is highly solicited. Thank you. Eins |
Administrator
|
In reply to this post by E. Bernardo
It is not entirely clear what you require.
If I am reading your mind correctly then I suspect you want to create a VALUE LABELS command. Consult the FM for the required content and build a formula (=A2 & " '" & B2 & "'") in Excel. Drag it and populate the remaining rows. Then copy/paste the result into a syntax window and run it against your data file. VALUE LABELS city 1 'city1' 2 'city2' ..... .
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |