I’m making good progress on finding concordant and discordant pairs of value labels. I modify Jon Peck’s Python code to produce the names of variables matching the specified criteria. The lists produced so far have contained from around 50 to almost 3000 names. Variables to be processed can be identified by eyeballing the lists, but It’s quicker to copy them from the spv to Excel (so they stay in columns: if I copy them to Word they form a continuous line) and copy/paste them into Notepad. I open a new syntax file, write RECODE and copy/paste part of the list from Notepad or Excel into the syntax file, add a period and an EXECUTE command, followed by ADD VALUE LABELS, copy/paste the list again and add the required value label. The first example discovered variables with the pair of value labels 8 “Don’t know” and -8 “Don’t know”. The syntax file structure for the first run was RECODE <varlist> (771 lines, one name per line) (8=-8). EXECUTE. ADD VALUE LABELS <varlist> (771 lines, one name per line) -8 “Don’t know”. It worked fine with the first <varlist> but I have encountered a problem with the second and subsequent ones. When I try to copy/paste the next <varlist> into SPSS only the previous <varlist> appears. This happens whether I delete the previous block from a syntax file or create a new syntax file. It makes no difference whether I’m copying from Word or Notepad, or if I use right click COPY/PASTE or Ctrl+A/Ctrl+V. Is this because my computer is still processing the Ctrl+A from Notepad or Excel when I press Ctrl+V to paste into SPSS, or could there be some other reason? John F Hall (Mr) [Retired academic survey researcher] Email: [hidden email] Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/1-survey-analysis-workshop PS D-Day was 72 years ago today. Throughout Normandy there will be ceremonies to commemorate all those who died. |
Diana Thanks for the compliment. Hope you don’t mind, but I’ve copied the SPSS list in. I’m not particularly au fait with Excel facilities except for moving stuff around: apart from this work-around I only use it to keep track of personal income and expenditure. Since this morning I have cut out Word from the cycle and copy from SPSS spv output direct to Excel, but only to store the names and value labels in column format. I’m keeping all the Python output in the same Excel file, so the columns will always contain cells up to the longest list found, in this case 2,680 names. This explains why the Notepad files have blank pages which get copied into SPSS. Now that I know what is happening I can delete the blanks pages in SPSS. The sequence is now: Python >> spv >> Notepad >> SPSS. All I have to do is insert the RECODE, EXECUTE and ADD VALUE LABELS commands, and copy the list of names from the RECODE command to the ADD VALUE LABELS command. Jon Peck’s Python code is brilliant at extracting combinations of value labels. So far I’m only extracting concordant pairs where pairs of positive values to be treated as missing and their equivalent negative values (recoded by me) share the same value label. There are dozens of unique combinations to be dealt with: even an extra space in the same label warrants its own Python run, as does “dont know” [sic] in addition to “Don’t know”. After that there are discordant pairs where the positive value has one label and the negative value another. This may be my fault for working too quickly in the early stages. After that there are many other (missing) values to be tracked and changed. Sometimes these are easy to spot [0 “Skipped” and its variations] and some obvious ones in the 95 – 99, 990 – 999 and similar ranges where basically the missing values have one more digit than the valid value. In other cases, it’s not so clear. In yet more there are existing negative values in the range -6 to -1 for which there are no labels at all and which will need checking against the original documentation. Now that I have got a system that works, it shouldn’t be too long before there is a beta version of the whole file with only a few remaining glitches to sort out. You asked for a copy of the variable list. There isn’t a single list, but I’ll send you an Excel example off-list and a copy of the small file containing only a single case from each year of the survey (n = 30). This way I shall not be in breach of my UKDS licence and you can use APPLY DICTIONARY to copy the metadata to any BSA files you are using yourself. I take it Dr Christeen George (who was one of my PNL Survey Research Unit staff) has now retired from Hertfordshire as Course Leader, Occupational Psychology? Best John F Hall (Mr) [Retired academic survey researcher] Email: [hidden email] Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/1-survey-analysis-workshop PS D-Day is tomorrow, not today (mea culpa). This morning was the annual ceremony to commemorate the crew (Australian pilot, British crew) of a Lancaster bomber shot down in Cerisy-la-Salle early on 6 June 1944 (Parade of combat veterans and flag-bearers with marching band, laying of wreaths, reading out of names, short silence, Last Post, national anthems of UK and France, followed by un verre d’honneur or three and nibbles under an avenue of lime trees. Previous ceremoinies can be seen on my page [http://surveyresearch.weebly.com/monument-to-lancaster-bomber-crew.html] Photos and videos from this morning will be uploaded later today. From: Professor Diana Kornbrot http://dianakornbrot.wordpress.com/ http://go.herts.ac.uk/Diana_Kornbrot +44 (0) 208 444 2081 +44 (0) 7403 18 16 12 skype: kornbrotme Work University of Hertfordshire College Lane, Hatfield, Hertfordshire AL10 9AB, UK Home 19 Elmhurst Avenue London N2 0LT, UK Dear John this is stirling work of benefit to all I would be tempted to do the recode in excel via VLOOKUP and then transfer to SPSS would really appreciate seeing the variable labels you have identified - in EXCEL best Diana Dear John this is stirling work of benefit to all
I would be tempted to do the recode in excel via VLOOKUP and then transfer to SPSS
would really appreciate seeing the variable labels you have identified - in EXCEL
best
Diana
___________
Professor Diana Kornbrot
+44 (0) 208 444 2081
+44 (0) 7403 18 16 12
skype:
kornbrotme
Work
University of Hertfordshire
College Lane, Hatfield, Hertfordshire AL10 9AB, UK
Home
19 Elmhurst Avenue
London N2 0LT, UK
|
Free forum by Nabble | Edit this page |