WOW !! MUCH LOVE ! SO WORLD PEACE !
Fond bitcoin pour l'amélioration du site: 1memzGeKS7CB3ECNkzSn2qHwxU6NZoJ8o
  Dogecoin (tips/pourboires): DCLoo9Dd4qECqpMLurdgGnaoqbftj16Nvp


Home | Publier un mémoire | Une page au hasard

 > 

L'équité dans la mise en oeuvre des projets de marketing social: étude du cas de PSI-Bénin. (Population Services International )

( Télécharger le fichier original )
par Hugues Pascal S. SETHO
Fondation universitaire Mercure Belgique - Master gestion des projets 2010
  

précédent sommaire

Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy

Annexes

Syntaxes

Jeunes Apprenties KfW

*Niveau socio-économique. FACTOR

/VARIABLES Q109 Q110A Q110B Q110C Q110D Q110E Q110G

/MISSING PAIRWISE

/ANALYSIS Q109 Q110A Q110B Q110C Q110D Q110E Q110G

/PRINT INITIAL CORRELATION EXTRACTION ROTATION

/FORMAT BLANK(.25)

/CRITERIA MINEIGEN(1) ITERATE(25) /EXTRACTION PC

/CRITERIA ITERATE(25) /ROTATION VARIMAX /SAVE REG(ALL)

/METHOD=CORRELATION . compute ses=fac1_1.

*Compute behavior_var *Abstinence primaire

compute abstprim=1 - q301.

var lab abstprim "Abstinence primaire".

val lab abstprim 1"Oui" 0"Non". compute nonabstp=1-abstprim. val lab nonabstp 1"Oui" 0"Non". fre abstprim nonabstp q301. *Abstinence secondaire compute abstsec=0.

if q303b=0 abstsec=1.

var lab abstsec "Abstinence secondaire".

val lab abstsec 1"Oui" 0"Non".

compute nonabsts=1-abstsec. val lab nonabsts 1"Oui" 0"Non". fre abstsec nonabsts q303b. *Multipartenariat

compute multpart=0.

if q303b>1 multpart=1.

var lab multpart "Multipartenariat". val lab multpart 1"Oui" 0"Non". compute nonmultp=1-multpart.

val lab nonmultp 1"Oui" 0"Non". fre multpart nonmultp.

*Utilisation du condom

fre q319 q323 q327 q332.

compute use=0.

if (q323=1 | q332=1) use=1.

var lab use "Utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier".

val lab use 1"Oui" 0"Non".

filter by multpart.

fre use.

filter off.

compute nonuse=0.

if (q323=0 & q332=0) nonuse=1.

var lab nonuse "Non utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier".

val lab nonuse 1"Oui" 0"Non". filter by multpart.

fre nonuse.

filter off.

**Compute the Concentration index and standart error compute age=q102.

fre age.

fre Q114.

compute sex=q114. fre sex.

fre abstprim.

*cro tab sex by abstprim/cells=count.

*******Utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier

**Jeunes élèves garçons USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonuse=0 | nonuse=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonuse=0 | nonuse=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonuse) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonuse.

compute covar_i=(rnkcon-avgrnk) * (nonuse -avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonuse.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonuse=0 | nonuse=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonuse=0 | nonuse=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonuse) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonuse -avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonuse.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) .

create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

*********Abstinence primaire

**Jeunes élèves garçons

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonabstp=0 | nonabstp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonabstp=0 | nonabstp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabstp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabstp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonabstp.

compute covar_i=(rnkcon-avgrnk) * (nonabstp -avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabstp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonabstp=0 | nonabstp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonabstp=0 | nonabstp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabstp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabstp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonabstp -avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabstp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

*****Abstinence secondaire

**Jeunes élèves garçons

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonabsts=0 | nonabsts=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonabsts=0 | nonabsts=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0). filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabsts. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabsts) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonuse.

compute covar_i=(rnkcon-avgrnk) * (nonabsts-avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabsts.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) .

sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) .

create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonabsts=0 | nonabsts=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonabsts=0 | nonabsts=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabsts) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonabsts-avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabsts.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

******Multipartenariat **Jeunes élèves garçons USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonmultp=0 | nonmultp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonmultp=0 | nonmultp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonmultp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonmultp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonmultp-avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonmultp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonmultp=0 | nonmultp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonmultp=0 | nonmultp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonmultp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonmultp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonmultp-avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv .

descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonmultp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

Jeunes éleves et étudiants KfW

*Niveau socio-économique. FACTOR

/VARIABLES Q109 Q110A Q110B Q110C Q110D Q110E Q110G

/MISSING PAIRWISE

/ANALYSIS Q109 Q110A Q110B Q110C Q110D Q110E Q110G

/PRINT INITIAL CORRELATION EXTRACTION ROTATION

/FORMAT BLANK(.25)

/CRITERIA MINEIGEN(1) ITERATE(25) /EXTRACTION PC

/CRITERIA ITERATE(25) /ROTATION VARIMAX /SAVE REG(ALL) /METHOD=CORRELATION . compute ses=fac1_1.

*Compute behavior_var *Abstinence primaire

compute abstprim=1 - q301.

var lab abstprim "Abstinence primaire". val lab abstprim 1"Oui" 0"Non".

compute nonabstp=1-abstprim. val lab nonabstp 1"Oui" 0"Non". fre abstprim nonabstp q301. *Abstinence secondaire

compute abstsec=0.

if q303b=0 abstsec=1.

var lab abstsec "Abstinence secondaire".

val lab abstsec 1"Oui" 0"Non". compute nonabsts=1-abstsec. val lab nonabsts 1"Oui" 0"Non". fre abstsec nonabsts q303b. *Multipartenariat

compute multpart=0.

if q303b>1 multpart=1.

var lab multpart "Multipartenariat". val lab multpart 1"Oui" 0"Non". compute nonmultp=1-multpart.

val lab nonmultp 1"Oui" 0"Non". fre multpart nonmultp.

*Utilisation du condom

fre q319 q323 q327 q332. compute use=0.

if (q323=1 | q332=1) use=1.

var lab use "Utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier".

val lab use 1"Oui" 0"Non".

filter by multpart.

fre use.

filter off.

compute nonuse=0.

if (q323=0 & q332=0) nonuse=1.

var lab nonuse "Non utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier".

val lab nonuse 1"Oui" 0"Non". filter by multpart.

fre nonuse.

filter off.

**Compute the Concentration index and standart error

fre age. fre Q114.

compute sex=q114.

fre sex.

fre abstprim.

*cro tab sex by abstprim/cells=count.

*******Utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier

**Jeunes élèves garçons USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonuse=0 | nonuse=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonuse=0 | nonuse=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonuse) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonuse.

compute covar_i=(rnkcon-avgrnk) * (nonuse -avgdv) .

fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonuse.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL. COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonuse=0 | nonuse=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonuse=0 | nonuse=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonuse) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonuse -avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonuse.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) .

sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) .

create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

*********Abstinence primaire

**Jeunes élèves garçons

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonabstp=0 | nonabstp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonabstp=0 | nonabstp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabstp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabstp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonabstp.

compute covar_i=(rnkcon-avgrnk) * (nonabstp -avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabstp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonabstp=0 | nonabstp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonabstp=0 | nonabstp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabstp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabstp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonabstp -avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabstp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

*****Abstinence secondaire

**Jeunes élèves garçons

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonabsts=0 | nonabsts=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonabsts=0 | nonabsts=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'.

format filter_$ (f1.0). filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonabsts. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabsts) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonuse.

compute covar_i=(rnkcon-avgrnk) * (nonabsts-avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabsts.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonabsts=0 | nonabsts=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonabsts=0 | nonabsts=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonabsts) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonabsts-avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonabsts.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq)

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

******Multipartenariat **Jeunes élèves garçons USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=1 & (nonmultp=0 | nonmultp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=1 & (nonmultp=0 | nonmultp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonmultp. compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonmultp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonmultp-avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonmultp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

**Jeunes élèves filles

USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & sex=2 & (nonmultp=0 | nonmultp=1)).

variable label filter_$ 'age>=15 & age<= 24 & sex=2 & (nonmultp=0 | nonmultp=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonmultp.

compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonmultp) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

compute covar_i=(rnkcon-avgrnk) * (nonmultp-avgdv) . sort cases by covar_i .

aggregate /outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonmultp.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) . create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

TS IMPACT et KfW

*Niveau socio-économique.

fre q112.

compute ses=q112. *Compute behavior_var compute age=q101. compute nonuse=0.

if (q321=2 ) nonuse=1.

var lab nonuse "Non utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier".

val lab nonuse 1"Oui" 0"Non".

fre nonuse.

**Compute the Concentration index and standart error

*******Utilisation du préservatif au dernier rapport sexuel avec partenaire irrégulier

**TS de 15-24 ans USE ALL.

COMPUTE filter_$= (age>=15 & age<= 24 & (nonuse=0 | nonuse=1)).

variable label filter_$ 'age>=15 & age<= 24 & (nonuse=0 | nonuse=1) (Filter)'.

value labels filter_$ 0'Not Selected' 1'Selected'. format filter_$ (f1.0).

filter by filter_$.

RANK VARIABLES = SES (A) /RFRACTION into rnkcon /PRINT=YES /TIES=MEAN.

sort cases by nonuse.
compute nobreak=1 .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav'

/presorted /break= nobreak /n=N /avgdv= mean(nonuse) /avgrnk=mean(rnkcon).

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav'/by= nobreak .

** Part 3. Calculate: covariance, which is cov(yi, Ri), where Ri is the ith individual's fractional rank in the socioeconomic distribution.

fre nonuse.

compute covar_i=(rnkcon-avgrnk) * (nonuse -avgdv) . fre covar_i.

sort cases by covar_i .

aggregate /outfile= ' C:\Users\joliamour\Documents\tmp\temp1.sav ' /presorted /break= nobreak /sumcovar= sum(covar_i) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav ' /by= nobreak .

compute covar=sumcovar/n .

** Part 4. Get the Concentration index. **Note: incase you have one round of data, then you only need the Concentration index output - using the syntax below.

compute ci=2 * covar/ avgdv . descriptives var= ci.

** Part 5. Calculate: cumy (cumulative of yi), lagy . But first need to be sure all non-targeted respondents should not be included in the calculation of cumy and lagy.

compute newdv= nonuse.

IF missing(rnkcon) newdv = 99 .

recode newdv (99=sysmis) (else=copy) . sort cases by rnkcon (A) .

compute indy= newdv / (n * avgdv) .

create cumy= csum (indy) .

COMPUTE lagy = LAG(cumy) .

** Part 6. Calculate: ai and sum of ai-square.

compute a= (newdv/ avgdv) * (2 * rnkcon -1 - ci) + 2 - lagy - cumy .

compute asq=a*a . sort cases by asq .

aggregate outfile=' C:\Users\joliamour\Documents\tmp\temp1.sav' /presorted /break= nobreak /sumasq= sum(asq) .

match files file=* /table=' C:\Users\joliamour\Documents\tmp\temp1.sav' /by= nobreak .

** Part 7. Calculate variance of ci and standard deviation of ci .

compute var_ci=sumasq/n**2 - (1+ci)**2/n . compute std_ci=(var_ci)**(1/2) .

descriptives var=n ci var_ci std_ci .

execute .

précédent sommaire






Bitcoin is a swarm of cyber hornets serving the goddess of wisdom, feeding on the fire of truth, exponentially growing ever smarter, faster, and stronger behind a wall of encrypted energy








"Le don sans la technique n'est qu'une maladie"