DOC: Create a numerical variable by script (English & French versions)
Summary | This article describes how create a numerical variable by script in AskiaAnalyse. The French version follows the English version. |
Applies to | AskiaAnalyse |
Written for | Data processor |
Keywords | numerical; script; analyse; askiaanalyse |
Documentation note : merge with http://analysishelp.askia.com/numeric_by_script
Create a numerical variable by script
This option enables you to:
- Recode a variable with items in a numerical variable.
- Route impossible values of a numerical question.
- Carry out calculations ( addition, division, multiplication, etc.).
- Determine the number of responses given to a multiple closed question.
From the «Edit» menu, select «create a variable»
Give the name of the new variable you wish to create in the caption window.
Examples:
1. Assign a value to each item of the question Q1 Satisfaction
- Totally satisfied (value to assign «10»)
- Satisfied (value to assign «7»)
- Almost satisfied (value to assign «4»)
- Not satisfied (value to assign «0»)
Then in the bottom window, write:
On(??Q1??=1,10,7,4,0)
Then validate.
2. To remove the value 99 on a numerical variable Q1 from 1 to 99 . . .
Then, in the bottom window, write:
On(??Q1??= 99,NR,??Q1??)
3. Carry out a calculation on 2 numerical variables Q1 + Q2 . . .
Then in the bottom window, write:
- Sum:
CVDKNA(??Q1??) + CVDKNA (??Q2??)
NB: The function CVDKNA allows you to transform the Non-responses or Not-asked to 0. - Multiply:
CVDKNA(??Q1??) * CVDKNA(??Q2??)
- Divide:
CVDKNA(??Q1??) / CVDKNA(??Q2??)
4. Find the middle number of responses given to Q1 (Multiple responses) . . .
SIZE(??Q1??)
French version
Créer une variable numérique par script
Cette option vous permet :
- Re codifier une variable à modalités en variable numérique
- Filtrer les valeurs aberrantes d'une question numérique
- Effectuer des opérations (somme, division, multiplication...)
- Déterminer le nombre de réponses données à une question à réponses multiples
Dans le menu Edition, sélectionnez «créer une variable numérique par scripte»
Indiquez le nom de la nouvelle variable que vous voulez créer dans la fenêtre « raccourci » et « libellé » et dans la fenêtre « après » la position de création.
Exemples:
1. Affecter une valeur à chaque modalité de la question Q1 Satisfaction
- Très satisfait (valeur à affecter «10»)
- Assez satisfait (valeur à affecter «7»)
- Peu satisfait (valeur à affecter «4»)
- Pas du tout satisfait (valeur à affecter «0»)
Puis dans la fenêtre du bas, inscrire:
On(??Q1??,10,7,4,0)
Puis validez.
Pour filtrer une variable numérique, c'est à dire enlever du calcul les valeurs aberrantes.
2. Enlever la valeur 99 sur une variable numérique Q1 allant de 1 à 99.
Puis dans la fenêtre du bas, inscrire:
On(??Q1??= 99,NR,??Q1??)
3. Effectuer une opération sur 2 variables numériques Q1 + Q2.
Puis dans la fenêtre du bas, inscrire:
- Somme:
CVDKNA(??Q1??) + CVDKNA(??Q2??)
NB: La fonction CVDKNA transforme les Non-réponses et Non-interrogés en 0. - Multiplication:
CVDKNA(??Q1??) * CVDKNA(??Q2??)
- Division:
CVDKNA(??Q1??) / CVDKNA(??Q2??)
4. Trouver le nombre de réponses citées en Q1 (Question à choix multiple) . . .
SIZE(??Q1??)