|
Hi Dorra Thank you once again for sending me the quickest options for creating value label syntax. I am experienced in doing that. The fastest way would be to get a frequencies on polregx and copy paste the output table - remove the unwanted text, put the ' ' and run it in a syntax file. This way it is also permanently available on file. I have done it now. Viann - thanks a lot once again for the options you have suggested. The last one was the best - that is to let my data provider know about my exact requirements. I have already done that and he has agreed to sent it to me. thanks regards Thara Vardhan Senior Statistician Performance Improvement & Planning NSW Police Tel: (02) 8835-8526
Hi Thara, To make your life easier, you might want to explore value label command. Example: val lab v1 '1' 'abc' '2' "It's mine" '3' 'ok then'. Do take note that the labelling will be given to 1, 2 and 3 in your data only. The rest of the labels will be deleted. Take note of the labelling done for 2 because of the it's you will need a double quotation instead of a single quote. The full stop is at the last value label that you want to do, in my case, value 3 after 'ok then'. A shorter way If you have a variable dictionary given for your polregx normally given in excel telling you what are the value labels on the values, example In Excel 1 abc 2 It's Mine 3 Ok then Just 1. Copy and paste it into the syntax window. 2. add in all the quotes and the full stop '1' 'abc' '2' "It's mine" '3' 'ok then'. Then add the command and the variable on the first value. val lab v1 '1' 'abc' '2' "It's mine" '3' 'ok then'. I hope you understand what I mean. Try it out. This is much faster. Have fun. Cheers Dorraj Date: Wed, 29 Apr 2009 13:23:18 +1000 From: [hidden email] Subject: Re: thanks DorraJ To: [hidden email] Hi Dorra Thanks for your response. Indeed soon after I sent my mail to Melissa and all I realised that what I am looking for is to change the value labels. This is what I am doing now using SPSS syntax editor. Thank you once again. regards Thara Vardhan
Hi thara, You mentioned that "More importantly I have checked the variable polregx and it is defined as numeric with value labels" Number 1 This means that the following syntax cannot work. STRING REGION (A20). COMPUTE REGION = SUBSTR (polregx, 7, 20). Exe. reason: substr is meant for string variables only and it is use to shorten the length of a string variable. Number 2 The following syntax cannot work as well. Numeric region (N20). compute region =NUMBER(substr(polregx,7,20),F20). Reason: This is because, 1. numeric region declare a numerical variable region but the format should be (f20) not (n20). 2. number is used to convert a string variable to a numeric variable it is not applicable on your polregx. You should be now more concern on changing the value label of polregx instead. example 1 in polregx is labeled as NSW - Ashfield , it should be changed to Ashfield. This can be done easily in the variable view of SPSS Editor Window. Cheers Dorraj Date: Wed, 29 Apr 2009 12:24:43 +1000 From: [hidden email] Subject: seeking help deleting characters from a string variable - reply to Viann, Melissa and Nirit To: [hidden email] Hi Viann, Melissa and Nirit Thank you for replying to my earlier email seeking help with deleting characters from a string variable. I was of f sick for a while and have resumed work only today. Hence I could not work on my syntax problem. My question: polregx NSW - Ashfield NSW - Eastern Beaches NSW - Bankstown NSW - Blue Mountains NSW - Brisbane Water I! want to remove the first 3 letters and the - for instance NSW-Eastern Beaches should read as only Eastern beaches. As pointed out by all of you I added the period after string region (A20). But I still get an error message. However today I have run the syntax as follows: STRING REGION (A20). COMPUTE REGION = SUBSTR (polregx, 7, 20). Exe. I get the following message Error # 4311 in column 40. Text: ) The string argument required for the function specified was not supplied. This command not executed. Exe. More importantly I have checked the variable polregx and it is defined as numeric with value labels. Hence I tried this as an alternative however i still get the same error message. Numeric region (N20). compute region =NUMBER(substr(polregx,7,20),F20). >Error # 4311 in column 43. Text: ) >The string argument required for the function specified was not supplied. >This command not executed. execute. Can you help me please? thanks regards thara Thara Vardhan Senior Statistician Performance Improvement & Planning NSW PoliceTel: (02) 8835-8526
Chat online and in real-time with friends and family! Windows Live Messenger
See all the ways you can stay connected to friends and family
|
| Free forum by Nabble | Edit this page |
