Archive

Another Pendragon Forms / SPSS tip

I found a helpful trick yesterday that saved me a lot of time preparing my SPSS data file that was exported from Pendragon Forms 5.1 (Pendragon Forms –> MS Excel –> SPSS). I don’t claim to have discovered fire or the wheel or anything, but what I learned was useful for me. If you want to save a lot of time defining your variables, read on.

As I mentioned in a previous post about automation and Pendragon Forms, I like to create survey protocols in MS Excel. Here is a screen shot of a survey developed for work in Northern Uganda. Excel makes it easy to create, translate, and back-translate survey items.


With my Pendragon data file loaded in SPSS, I was looking for a way to import variable labels (i.e., descriptions). But SPSS does not have a point-and-click command for importing variable labels. However, I found a way to use syntax and Excel to avoid one-by-one entry.


SPSS allows several data definition syntax commands (see here). For defining variable labels, use:

VARIABLE LABELS varname1 ‘label1′ .
VARIABLE LABELS varname2 ‘label2′ .
VARIABLE LABELS varname3 ‘label3′ .

In my case, I needed a way to get all of my excel information into a syntax file with a command for each item. So I used CONCATENATE to combine my variable name and survey item into the correct syntax command format: VARIABLE LABELS cys016 ‘How many?’ .


I typed this formula in cell D2:
=CONCATENATE(“VARIABLE LABELS “,B17,” ‘”,C17,”‘”,” .”)

Notice the spaces after variable labels, before the first apostrophe, and before the period.

The last step is to fill down this formula, copy all of the new syntax, and paste (Ctrl+V rather than Edit Paste) into an SPSS syntax file. Run the syntax and watch your variable labels import.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>