|
Greetings
I have seen this question posted years ago, but maybe in the interim the situation has changed. I have a data file with many variables and wish to "define variable sets" that contain subsets of the data file, and wish to do so via syntax. There are about 15 variable sets I want to create, all of which can be quickly defined using "A to Z" type lists so this could be done in a snap using syntax, but would be laborious via point and click and would need to be repeated every time the data file is recreated. So, finally the question. Is it possible with SPSS 15 either via Syntax or via Python to define variable sets via syntax (rather than Utilities then Define Variable sets). Many thanks, Michael Mitchell ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Because variable sets are invisible to regular syntax, there is also no regular syntax to define them. This is still true. This would be convenient, no doubt, but also a bit confusing since you might expect to be able to use those set names in your regular syntax. That, too, would be convenient, although there are other ways to create such sets (macro, Python, TO).
However, your set definitions are saved with the dataset, so define them once, save the file, and they will be there when you reopen that file. HTH, Jon Peck -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Michael Mitchell Sent: Tuesday, March 18, 2008 12:44 PM To: [hidden email] Subject: [SPSSX-L] Define Variable Sets via Syntax Greetings I have seen this question posted years ago, but maybe in the interim the situation has changed. I have a data file with many variables and wish to "define variable sets" that contain subsets of the data file, and wish to do so via syntax. There are about 15 variable sets I want to create, all of which can be quickly defined using "A to Z" type lists so this could be done in a snap using syntax, but would be laborious via point and click and would need to be repeated every time the data file is recreated. So, finally the question. Is it possible with SPSS 15 either via Syntax or via Python to define variable sets via syntax (rather than Utilities then Define Variable sets). Many thanks, Michael Mitchell ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Michael Mitchell-3
I recommend setting up a "master" data set with all the variables
defined and save one record. Then create a program to create the subsets you need and use APPLY DICTIONARY to refer to the variable definitions in the "master" file. Just list the variables you want to keep in each SAVE. This approach is very simple to implement. Dennis Deck, PhD RMC Research Corporation 111 SW Columbia Street, Suite 1200 Portland, Oregon 97201-5843 voice: 503-223-8248 x715 voice: 800-788-1887 x715 fax: 503-223-8248 [hidden email] -----Original Message----- From: Michael Mitchell [mailto:[hidden email]] Sent: Tuesday, March 18, 2008 11:44 AM Subject: Define Variable Sets via Syntax Greetings I have seen this question posted years ago, but maybe in the interim the situation has changed. I have a data file with many variables and wish to "define variable sets" that contain subsets of the data file, and wish to do so via syntax. There are about 15 variable sets I want to create, all of which can be quickly defined using "A to Z" type lists so this could be done in a snap using syntax, but would be laborious via point and click and would need to be repeated every time the data file is recreated. So, finally the question. Is it possible with SPSS 15 either via Syntax or via Python to define variable sets via syntax (rather than Utilities then Define Variable sets). Many thanks, Michael Mitchell ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Dear Dennis
Thank you for this fabulous idea. This works like a champ. So, to share with everyone else, I have a file called "bigfile.sav" and then I created a copy with actually 0 records (via select if (0). ). I then manually pointed and clicked and created the sets and saved it as "sets.sav" (and while I was at it, I adjusted the column widths). I then ran this syntax... get file = "bigfile.sav". apply dictionary from "sets.sav" /fileinfo varsets=replace /varinfo width. and the "sets" are defined in the currently active file, and I can replicate all of this automatically via syntax. Thanks many times for taking the time to share this very clever idea! Best regards, Michael Mitchell On Tue, Mar 18, 2008 at 10:00 PM, Dennis Deck <[hidden email]> wrote: > I recommend setting up a "master" data set with all the variables > defined and save one record. > Then create a program to create the subsets you need and use APPLY > DICTIONARY to refer to the variable definitions in the "master" file. > Just list the variables you want to keep in each SAVE. > This approach is very simple to implement. > > Dennis Deck, PhD > RMC Research Corporation > 111 SW Columbia Street, Suite 1200 > Portland, Oregon 97201-5843 > voice: 503-223-8248 x715 > voice: 800-788-1887 x715 > fax: 503-223-8248 > [hidden email] > > > -----Original Message----- > From: Michael Mitchell [mailto:[hidden email]] > Sent: Tuesday, March 18, 2008 11:44 AM > Subject: Define Variable Sets via Syntax > > Greetings > > I have seen this question posted years ago, but maybe in the interim > the situation has changed. I have a data file with many variables and > wish to "define variable sets" that contain subsets of the data file, > and wish to do so via syntax. There are about 15 variable sets I want to > create, all of which can be quickly defined using "A to Z" type lists so > this could be done in a snap using syntax, but would be laborious via > point and click and would need to be repeated every time the data file > is recreated. > > So, finally the question. Is it possible with SPSS 15 either via > Syntax or via Python to define variable sets via syntax (rather than > Utilities then Define Variable sets). > > Many thanks, > > Michael Mitchell > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
