UNIVERSIT DU QUBEC MONTRAL - Laboratoire d'études de la ...
UNIVERSIT DU QUBEC MONTRAL - Laboratoire d'études de la ...
UNIVERSIT DU QUBEC MONTRAL - Laboratoire d'études de la ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
l’écart-type).<br />
egen rank_x1 = rank(x1) Rang <strong>de</strong> l’observation<br />
egen min_x = rmin(x1 x2 x3) Valeur minimale entre (x1, x2, x3)<br />
egen max_x = rmax(x1 x2 x3) Valeur maximale entre (x1, x2, x3)<br />
gen et egen ne peuvent que créer <strong>de</strong> nouvelles variables. Pour changer une variable<br />
existante, on doit utiliser l’instruction rep<strong>la</strong>ce.<br />
rep<strong>la</strong>ce oldvarname = exp1 [if exp2] [in range]<br />
L’instruction suivante permet <strong>de</strong> changer <strong>la</strong> valeur d’une variable par une autre valeur :<br />
rep<strong>la</strong>ce [variable concernée]=[nouvelle valeur] if (conditions)<br />
Pour remp<strong>la</strong>cer <strong>la</strong> valeur 97 <strong>de</strong> <strong>la</strong> variable pvreg25 par un point, il suffirait d’entrer :<br />
rep<strong>la</strong>ce pvreg25=. if pvreg25==97<br />
Conseil :<br />
Lorsque Stata rencontre un point (.) comme valeur, il considère <strong>la</strong> donnée comme<br />
manquante et ne <strong>la</strong> traite tout simplement pas.<br />
Par contre, dans une condition, toute valeur numérique est inférieure au point.<br />
Par exemple, rep<strong>la</strong>ce adult=1 if age>18 remp<strong>la</strong>cerait le point par 1 parce que<br />
Stata considère le point supérieur à 18. Il faudrait plutôt inscrire rep<strong>la</strong>ce adult=1<br />
if age>18 & age