|
Hello,
I have a couple of data files I'd like to export for sharing with by non-SPSS users. I know how to export the data itself as an Excel file, but I don't know how to export the Variable View (including value labels and custom attributes). Ideally, I'd like it to be in a tabular format like the Variable View -- not in a long, text-based data dictionary format that would be hard for non-SPSS users to wade through. When I manually select the Variable View table and copy-paste it into Excel, it cuts off the value labels field at just one item followed by an ellipses. Also, for some reason it does not copy the contents of the custom attribute column(s) but just leaves a blank column. (As a side-question, how do I delete a custom attribute? I tried using "VARIABLE ATTRIBUTE DELETE=[AttributeName]." but it returned the warning "VARIABLES is required. Execution of this command stops.") If it matters, I'm using SPSS 18 for Mac. Thanks in advance, Max -- Max Freund, M.I.I.M. . [hidden email] . (909) 632-1624 Doctoral Student in Organizational Behavior, Claremont Graduate University (www.cgu.edu/sbos) Partner, LF Leadership (www.lfleadership.com) |
|
Jon Peck SPSS, an IBM Company [hidden email] 312-651-3435
Hello, I have a couple of data files I'd like to export for sharing with by non-SPSS users. I know how to export the data itself as an Excel file, but I don't know how to export the Variable View (including value labels and custom attributes). Ideally, I'd like it to be in a tabular format like the Variable View -- not in a long, text-based data dictionary format that would be hard for non-SPSS users to wade through. >>>Have you looked at the CODEBOOK command? It's not a grid, but the output is better organized than DISPLAY DICTIONARY. Of course, if you include things like value labels and missing value codes, the output is intrinsically nonrectangular. CODEBOOK lets you select which attributes to show. When I manually select the Variable View table and copy-paste it into Excel, it cuts off the value labels field at just one item followed by an ellipses. Also, for some reason it does not copy the contents of the custom attribute column(s) but just leaves a blank column. >>>No idea what is going on with that. (As a side-question, how do I delete a custom attribute? I tried using "VARIABLE ATTRIBUTE DELETE=[AttributeName]." but it returned the warning "VARIABLES is required. Execution of this command stops.") >>>There are two kinds of attributes: file and variable. VARIABLE ATTRIBUTE, therefore requires a variable list, e.g., VARIABLE ATTRIBUTE VARIABLES=fred to sam DELETE =attr1 attr2 attr3. If these are file attributes, you need to use DATAFILE ATTRIBUTE. If you just want to control which attributes are displayed in the Data Editor, use View>Customize Variable View HTH, Jon Peck If it matters, I'm using SPSS 18 for Mac. Thanks in advance, Max -- Max Freund, M.I.I.M. . max.freund@... . (909) 632-1624 Doctoral Student in Organizational Behavior, Claremont Graduate University (www.cgu.edu/sbos) Partner, LF Leadership (www.lfleadership.com) |
|
Hi John,
I looked at some info about CODEBOOK, and it looks like the output is a long variable-by-variable text list of attributes as well. I understand what you're saying about the challenge of presenting multiple label or missing values per variable, but there are ways around that -- e.g. a text separator like a semicolon or line break within each cell, or else a nested table display. In any case, I do appreciate the input and I'd welcome any other suggestions you or others have. Is there some way to output just the value labels or missing values, and I can use other means to parse them and copy them into a spreadsheet? Thanks, Max -- Max Freund, M.I.I.M. . [hidden email] . (909) 632-1624 Doctoral Student in Organizational Behavior, Claremont Graduate University (www.cgu.edu/sbos) Partner, LF Leadership (www.lfleadership.com) On Sep 18, 2010, at 6:54 PM, Jon K Peck wrote:
|
|
Max,
Have you explored any Python options? I assume since Jon didn't mention Python that I might be misunderstanding your request, but on the slight chance I might /not/ be I suggest the following as a first step: BEGIN PROGRAM. The above code works in SPSS syntax (so long as you have the Python plugin installed). While the above code is NOT going to give you what I believe you are asking, it may be moving in the right direction; I wrote this because I didn't like the CODEBOOK command (don't ask me what I didn't like - I forgot already :P, I just know that this accomplished what I wanted without the hassle of using CODEBOOK). Now, the above block of code will give you something like this: 1. SSN 2. First_Name 3. Last_Name 4. Gender 5. Var1 ... etc. That's what it prints in the Output window. It is simple enough to have Python take variable names (and I assume all associated values/labels/etc) and write them to a /standard/ .CSV format (comma-separated-values, also known as "tab-delineated" assuming you use tab instead of a comma :P), or even a flat-file/text file. Would it help to have a CSV file with all your variable information? The only trouble might be in the values column. The result might look like this: GENERAL CASE: 1. [VarName], [Data-Type], [Column Width], [Sig-Digits], [LABEL], {[VALUES]}, [MISSING], [Measure] 2. ...etc... SPECIFIC CASE: 1. SSN, Number, 9, 0, Social Security Number, , 222, Nominal 2. First_Name, String, 10, 0 , Participants First Name, , 222, Nominal 3. Gender, String, 2, 0, Sex/Gender of the Participant, {0=Male, 1=Female}, 222, Nominal 4. ...etc... Is this more of what you are trying to accomplish? Alternatively, we can script it so it is tabbed (instead of a comma). 1. SSN Number 9 0 Social Security Number NULL 222 Nominal 2. First_Name String 10 0 Participants First Name NULL 222 Nominal 3. Gender String 2 0 Sex/Gender of the Participant, {0=Male, 1=Female} 222 Nominal 4. ...etc... *I was hesitant to put the tab version as I was unsure how well it would come through on email, but hopefully we all get the idea. Also, I would think, if I were the recipient of such a file, I would have to script something to read the file you gave me to properly read in values and missing value labels, but I'll wait to hear back from you to find out if this is moving in the right direction. HTH, J. R. Carroll Grad. Student in Pre-Doc Psychology at CSUS Research Assistant for Just About Everyone. Email: [hidden email] -or- [hidden email] Phone: (916) 628-4204 On Sat, Sep 18, 2010 at 11:51 PM, Max Freund <[hidden email]> wrote:
|
|
In reply to this post by Max Freund
Never mind, all -- I went back and ran Display File Information, then copy-pasted the output into Excel and knitted together the variable information and attributes.
Problem solved, even if it did take some massaging...
--Max -- Max Freund, M.I.I.M. . [hidden email] . (909) 632-1624 Doctoral Student in Organizational Behavior, Claremont Graduate University (www.cgu.edu/sbos) Partner, LF Leadership (www.lfleadership.com) On Sep 18, 2010, at 11:51 PM, Max Freund wrote:
|
|
Yep, it's sometimes quicker to do a workaround,
especially if time is of the essence and/or money is pouring down the drain
whilst messing around attempting solutions in SPSS.
|
| Free forum by Nabble | Edit this page |
