|
Hello Dear All:
I wonder if you have any experince with script in spss.I have 108 data files ,one of my variables contains the name of agency which is not consistent.I mean ,within each datafile, for some records I have "PCC" for some other records I have "Peel Children Centre".Up to know I am going throug each file change them to uniq name manually.But I am pretty sure that there is an automatic way.I am thinking about creating a file with all desire names for 108 agency and inorder I get the name and copy this name to agencyname column for each dataset separately. Just the big problem is """I don't know how"""! I apprecaite if you can share your experience with me .Maybe it's not possible at all! Thank you Behnaz Shirazi _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |
|
Hi Behnaz
one possible solution would be the following: DATA LIST LIST/agency(A20). BEGIN DATA 'Peel Children Centre' 'Peel Children Centre' 'Peel Children Centre' 'PCC' END DATA. String agency_New(A20). IF agency = 'Peel Children Centre' agency_New = 'Peel Children Centre' . IF agency = 'PCC' agency_New = 'Peel Children Centre' . Freq var agency_New. Hope that helps, Christian ******************************* la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 Ch-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] internet: http://www.lavolta.ch/ -----Ursprüngliche Nachricht----- Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von behnaz shirazi Gesendet: Mittwoch, 23. Mai 2007 17:29 An: [hidden email] Betreff: copy & past using a source file Hello Dear All: I wonder if you have any experince with script in spss.I have 108 data files ,one of my variables contains the name of agency which is not consistent.I mean ,within each datafile, for some records I have "PCC" for some other records I have "Peel Children Centre".Up to know I am going throug each file change them to uniq name manually.But I am pretty sure that there is an automatic way.I am thinking about creating a file with all desire names for 108 agency and inorder I get the name and copy this name to agencyname column for each dataset separately. Just the big problem is """I don't know how"""! I apprecaite if you can share your experience with me .Maybe it's not possible at all! Thank you Behnaz Shirazi Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |
|
In reply to this post by behnaz shirazi-2
Hi Behnaz,
If all of the cases in your dataset have the same value for the variable "name of agency," you can simply create a new variable with consistent labeling. I would use a numeric value instead of a string (alphanumeric), because strings always cause trouble. Try: Compute NAGENCY = 1. Var Label NAGENCY 'Agency Name'. Val Label NAGENCY 1 'Peel Children Center'. If you add cases with other agencies to the dataset, you can simply give them new values and value labels. For Example, with Shirazi Children Center, code NAGENCY = 2. Val Label NAGENCY 1 'Peel Children Center' 2 'Shirazi Children Center'. Good Luck. Charla ************************************** See what's free at http://www.aol.com. |
| Free forum by Nabble | Edit this page |
