Sunteți pe pagina 1din 6

SPSS Quancept script help

SPSS QC scripting help:


Basics:
How to ask a questionThe way a question is declared in the script is as follows [Question identifier] ASK question text RESP [response type] answer1 / answer2

Naming conventions:
Questions can be named anything (using the characters A-Z numbers 0-9 and symbols) although, as a rule questions are named as either Qx or Questix (where x is the number of the question) There are however exceptions that use their question text (or a shortened version of it) as the identifier: Name, Gender, Age, Social grade (sometimes called socgrad), Address, telephone number (often called phone) Keywords are not case sensitive but it is conventional to write them in capitals and the script you get from using the Build option on dimensions writes them in capitals.

Response types:
SP Single response (Single punched, multiple choices but only a single answer.) MP Multiple response (Multi punched, multiple choices can choose multiple answers.) CODED Open ended answer (No options, just an empty textbox to enter an answer.)

Example: Q1 ASK What colour are your shoes?@ RESP SP Red / Blue / Black

SPSS Quancept script help All question marks much have an at (@) symbol after them when uploading to Quancept or it will have trouble compiling. The forward slash marks the division between questions, if you want to use a forward slash in a question text or answer then you must use instead a double slash //.

Comments:
To add a comment to your code you use the keyword COMMENT. Comments may be added to code to help the scripter, or to help other people when they are looking at your code when you are not there to explain it. Comments only last a single line, so COMMENT must be declared at the start of each line you wish to comment out. Comments can also be used to remove old or obsolete code from a script without the need to rewrite it entirely. Example: COMMENT Now we ask what kind of shoe they are wearing Q2 ask What kind of shoe are you wearing?@ resp coded

Displaying text:
Instead of a question sometimes it is necessary to simply display a text message; to do this we have two keywords: DISPLAY Used for messages that you want to appear on a single screen. PROTECT Used for messages that you want to appear across multiple or all of the screens. To remove the protected text, you must use the keyword UNPROTECT. Example: Title PROTECT Shoes and footwear survey. Txt1 DISPLAY Now, regarding your other footwear. PAUSE

The PAUSE keyword simply keeps the message contained in txt1 onscreen until the interviewer clicks next.

SPSS Quancept script help

Repeating questions:
Sometimes we have to ask a question several times for different subjects for example if we needed to ask What are your opinions on the footwear manufacturer? but we needed to ask it for Nike, Addidas, Fila, DC, Etinies, Converse and Airwalk. For this kind of question we would use a loop, which works like this: [Loop identifier] FOR [variable] = subject1 / subject2 / subject3

Insert questions to be asked here


NEXT

The next keyword marks the end of the questions that need to be asked for each subject, you can ask multiple questions for each subject if required. Variable names for loops are usually a lower case i and a number (or numbers) between 0-9 in this case the loop is the first from the top of the script file so Ive named it i0. Here is an example: Loop1 FOR i0 = Nike' / Addidas / Fila / DC / Etnies/ Converse / Airwalk Questi1 ASK What are your opinions on +i0+ ? RESP CODED NEXT It is possible to add the name of the currently selected subject in the loop into the text of a question or a text item by using this: ask question content +variable+? where variable is the name used to define the subjects. Equally you can use the variable with text on only one side of it like this: variable+ is a good company. Or Do you like +variable You can print the variable name on its own like this: Q3 ask variable or txt1 display variable. Examples:

SPSS Quancept script help

Subject pause

display i0+'.'

Randomisation, Rotation and Alphabetical Sorting:


If you want to ask the subjects in a random order (or equally question responses in a random order) You simply add the keyword RAN at the end of the subject or the start of a response list. Examples: Loop1 FOR i0 = Nike' / Addidas / Fila / DC / Etinies/ Converse / Airwalk RAN Questi1 ASK What are your opinions on +i0+ ?@ RESP CODED NEXT Q1 ASK What colour are your shoes?@

RESP SP RAN Red / Blue / Black / Green / Brown / White / Yellow / Pink / Purple

As well as randomising response lists you can organise them in several other ways. You can display items in rotation, but using the keyword ROT at the start of a response list or the end of a subject list. You can display items in Alphabetical order, by using the keyword ATOZ at the start of a response list or the end of a subject list.

SPSS Quancept script help

Loop1 FOR i0 = Nike' / Addidas / Fila / DC / Etinies/ Converse / Airwalk ROT Questi1 ASK What are your opinions on +i0+ ? RESP CODED NEXT Loop2 FOR i1 = Nike' / Addidas / Fila / DC / Etinies/ Converse / Airwalk ATOZ Questi2 ASK When did you last purchase +i1+ shoes?@ RESP CODED NEXT

Q1

ASK What colour are your shoes?@

RESP SP ROT Red / Blue / Black / Green / Brown / White / Yellow / Pink / Purple

Q2 ASK If you could have shoes of any colour which colour would you choose?@ RESP SP ATOZ Red / Blue / Black / Green / Brown / White / Yellow / Pink / Purple If you want some of the items to stay in the position they are listed (i.e. item 3 would always stay as the third response in the list with the rest of the responses following a rotated, randomised or alphabetical order.) then you use the ROTRANFIX keyword, in the response/subject list directly after the items you wish to remove from the ordering process. Example: Q1 ASK What colour are your shoes?@

RESP SP RAN Red / Blue / Black / Green / Brown / White / Yellow ROTRANFIX / Pink / Purple

In this case Yellow will stay at position 7 in the response list, however the remaining responses will be displayed randomly, essentially what is happening is ROTRANFIX is anchoring yellow to position 7 while

SPSS Quancept script help the rest of the responses are sorted in whichever way was specified. This can be used to position other or dont know answers at the end of response lists even if those lists have been randomised or rotated.

S-ar putea să vă placă și