How to do?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to do?

Ekoué KOUEVIDJIN
I have a database which concerned 30 villages. I have to enumarate. As i am not well in english, i prefer give you an example. In this example of base, it is possible to find the total number or 200101 for example (variable b) by using AGREGATE. By to give one number for each of them from 1 to the total, i do not the syntax?  So for great database, i still have a problem to obtain same result like variable c.
For those who know stata, it is obtained by using gen which bysort.
Thanks you.
abc
20010141
20010142
20010143
20010144
20010261
20010262
20010263
20010264
20010265
20010266
20010321
20010322
20010451
20010452
20010453
20010454
20010455
20010561
20010562
20010563
20010564
20010565
20010566
20010641
20010642
20010643
20010644
20010611

 
Ekoué KOUEVIDJIN
Ingénieur des Travaux Statistiques
Technicien Supérieur en Electronique


     
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: How to do?

meljr
Hi Ekoué,
Here if for example your variable "a" is the first 5 numbers = 20010 all the way down.
And your variable "b" is always the next 2 numbers right after 20010.
Then to get "c" (the last number), or the count of the number of "b"
Then try this syntax.

compute case = $casenum.
rank case by b.

Good Luck!
meljr


Ekoué KOUEVIDJIN wrote
I have a database which concerned 30 villages. I have to enumarate. As i am not well in english, i prefer give you an example. In this example of base, it is possible to find the total number or 200101 for example (variable b) by using AGREGATE. By to give one number for each of them from 1 to the total, i do not the syntax?  So for great database, i still have a problem to obtain same result like variable c.
For those who know stata, it is obtained by using gen which bysort.
Thanks you.
abc
20010141
20010142
20010143
20010144
20010261
20010262
20010263
20010264
20010265
20010266
20010321
20010322
20010451
20010452
20010453
20010454
20010455
20010561
20010562
20010563
20010564
20010565
20010566
20010641
20010642
20010643
20010644
20010611

 
Ekoué KOUEVIDJIN
Ingénieur des Travaux Statistiques
Technicien Supérieur en Electronique


     
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
Reply | Threaded
Open this post in threaded view
|

Re: How to do?

F. Gabarrot
In reply to this post by Ekoué KOUEVIDJIN
Bonjour Ekoué,

Ekoué KOUEVIDJIN wrote
I have a database which concerned 30 villages. I have to enumarate. As i am not well in english, i prefer give you an example. In this example of base, it is possible to find the total number or 200101 for example (variable b) by using AGREGATE. By to give one number for each of them from 1 to the total, i do not the syntax?  So for great database, i still have a problem to obtain same result like variable c.
For those who know stata, it is obtained by using gen which bysort.
Thanks you.
Généralement, pour pouvoir utiliser la commande AGREGATE qui me permet de calculer la moyenne, l'écart-type ou encore l'effectif pour une variable, je crée une variable constante i = 1 et ensuite, j'utilise la commande suivante (ici, pour la moyenne de tout mon échantillon sur la variable qui m'intéresse) :

AGGREGATE  /outfile=* MODE=ADDVARIABLES OVERWRITE=NO /BREAK=i /<VarMean> = MEAN(<Var>).

J'utilise ma variable constante i pour la sous commande BREAK (qu'on ne peut pas enlever de la commande).
J'espère que cela est utile. Bonne journée.

/ To sum up in English what I just said /
Generally, to be able to use the AGREGATE command which enables me to calculate the mean, the standard deviation or n for a variable, I create a constant variable i = 1 and then, I use this constant as a BREAK variable. Have a nice Day.

Fabrice.