Anexo Metodológico_Programas

7. Programas de Computo utilizados

1. ASIGNA1.PRG

SET TALK OFF
CLOSE DATABASES
CLEAR
? "EN PROCESO"
USE cpvtip2
SELE 2
USE dominio INDEX dominio NOUP
I = 0
SELE 1
DO WHILE !EOF()
   WCLAVE = ddepartam+dprovincia+ddistrito
   SELE 2
   SEEK WCLAVE
   IF FOUND()
       wdominio = dominio
       sele 1
       repla dominio with wdominio
   ELSE
       I = I + 1
   ENDIF
   SELE 1
   SKIP
ENDDO
? "NO SE HAN ENCONTRADO "+STR(I)
SET TALK ON

2. ASIGNA2.PRG

SET TALK OFF
CLOSE DATABASES
CLEAR
? "EN PROCESO"
USE censoviv
SELE 2
USE dominio INDEX dominio NOUP
I = 0
SELE 1
DO WHILE !EOF()
   WCLAVE = ddepartam+dprovincia+ddistrito
   SELE 2
   SEEK WCLAVE
   IF FOUND()
       wdominio = dominio
       sele 1
       repla dominio with wdominio
   ELSE
       I = I + 1
   ENDIF
   SELE 1
   SKIP
ENDDO
? "NO SE HAN ENCONTRADO "+STR(I)
SET TALK ON

3. DISTRITO.PRG

SET TALK OFF
CLOSE DATABASES
CLEAR
+? "EN PROCESO INDIVIV"
USE cpvtip2 INDEX WCLAVE
SELE 2
USE DISTRITO
ZAP
SELE 1
DO WHILE !EOF()
   wclave = ddepartam+dprovincia+ddistrito
   wind1 = 0
   wind2 = 0
   wind3 = 0
   wind4 = 0
   wind5 = 0
   wind6 = 0
   wind7 = 0
   wind8 = 0
   wind9 = 0
   wind10 = 0
   wind11 = 0
   wind12 = 0
   wind13 = 0
   wind14 = 0
   wind15 = 0
   DO WHILE !EOF() AND WCLAVE = ddepartam+dprovincia+ddistrito
        IF P03b_edad>="15"
            IF P13_COD_SI>="01" AND P13_COD_SI<="03"
               wind1 = wind1 + 1
            endif
        endif
******************
        IF P03b_edad>="15"
            IF P02_sexo="2"
               wind2 = wind2 + 1
            endif
        endif
******************
        IF P03b_edad>="15"
            wind3 = wind3 + 1
        endif
******************
        IF P13_COD_SI>="01" AND P13_COD_SI<="03"
            wind4 = wind4 + 1
        endif
******************
        IF P03b_edad>="06" and P03b_edad<="14"
            wind5 = wind5 + 1
        endif
******************
        IF P03b_edad>="09" and P03b_edad<="15"
            IF P10_asiste = "2"
               wind6 = wind6 + 1
            endif
        endif
******************
        IF P03b_edad>="13" and P03b_edad<="17"
            wind7 = wind7 + 1
        endif
******************
        IF P03b_edad>="06" and P03b_edad<="12"
            wind8 = wind8 + 1
        endif
******************
        IF p01_parent="1"
            wind9 = wind9 + 1
        endif
******************
        IF P03b_edad>="05" and P03b_edad<="12"
            if p11a_nivel="02"
                if p11b_anio="1"
                    wind10 = wind10 + 1
                endif
            endif
        endif
******************
        IF P03b_edad>="15"
            IF P13_COD_SI>="01" AND P13_COD_SI<="05"
                wind11 = wind11 + 1
            endif
        endif
******************
        IF P02_sexo="2"
            IF P18_estado="6"
                IF P03b_edad>="15" and P03b_edad<="49"
                     wind12 = wind12 + 1
                ENDIF
            endif
        endif
******************
        IF P03b_edad>="15" and P03b_edad<="49"
            wind13 = wind13 + 1
        ENDIF
******************
        wind14 = wind14 + 1
******************
        IF AREA="3"
            wind15 = wind15 + 1
        ENDIF
******************
        SKIP
   ENDDO
   SELE 2
   APPEN BLANK
   REPLA DISTRITO WITH WCLAVE
   REPLA IND1 WITH WIND1
   REPLA IND2 WITH WIND2
   REPLA IND3 WITH WIND3
   REPLA IND4 WITH WIND4
   REPLA IND5 WITH WIND5
   REPLA IND6 WITH WIND6
   REPLA IND7 WITH WIND7
   REPLA IND8 WITH WIND8
   REPLA IND9 WITH WIND9
   REPLA IND10 WITH WIND10
   REPLA IND11 WITH WIND11
   REPLA IND12 WITH WIND12
   REPLA IND13 WITH WIND13
   REPLA IND14 WITH WIND14
   REPLA IND15 WITH WIND15
   SELE 1
ENDDO
SET TALK ON

4. ENAHO984.SPS

GET
FILE='C:\tito\INDICA1.sav'.
EXECUTE .
WEIGHT
BY factorto .
******************************* Definicion de Dominios
variable label dominio "DOMINIO".
value label dominio
1 "Costa Norte"
2 "Costa Centro"
3 "Costa Sur"
4 "Sierra Norte"
5 "Sierra Centro"
6 "Sierra Sur"
7 "Selva"
8 "Lima Metropolitana".
IF((dominio =1 or dominio =2 or dominio=3) & estrato <=3) DOMINIO2= 1.
IF((dominio =1 or dominio =2 or dominio=3) & estrato >=4) DOMINIO2= 2.
IF((dominio =4 or dominio =5 or dominio=6) & estrato <=3) DOMINIO2= 3.
IF((dominio =4 or dominio =5 or dominio=6) & estrato >=4) DOMINIO2= 4.
IF((dominio =7) & estrato <=3) DOMINIO2= 5.
IF((dominio =7) & estrato >=4) DOMINIO2= 6.
IF((dominio =8) & estrato <=3) DOMINIO2= 7.
variable label dominio2 "DOMINIO2".
value label dominio2
1 "Costa Urbana"
2 "Costa Rural"
3 "Sierra Urbana"
4 "Sierra Rural"
5 "Selva Urbana"
6 "Selva Rural"
7 "Lima Metropolitana".
recode estrato (1 thru 3=1) (4 thru 5=2) into area.
variable labels area "AREA".
value labels area
1 "Urbana"
2 "Rural".
recode dominio (1 thru 3=1) (4 thru 6=2) (7=3)(8=4) into regnat.
variable labels regnat "Region Natural".
value labels regnat
1 "Resto costa"
2 "Sierra"
3 "Selva"
4 "Lima Metropolitana".
 if (dominio=8) dominio3=1.
 if (ubi=010101 & estrato<=3) dominio3=2.
 if (ubi=020101 & estrato<=3) dominio3=2.
 if (ubi=030101 & estrato<=3) dominio3=2.
 if (ubi=040101 & estrato<=3) dominio3=2.
 if (ubi=050101 & estrato<=3) dominio3=2.
 if (ubi=060101 & estrato<=3) dominio3=2.
 if (ubi=080101 & estrato<=3) dominio3=2.
 if (ubi=090101 & estrato<=3) dominio3=2.
 if (ubi=100101 & estrato<=3) dominio3=2.
 if (ubi=110101 & estrato<=3) dominio3=2.
 if (ubi=120101 & estrato<=3) dominio3=2.
 if (ubi=130101 & estrato<=3) dominio3=2.
 if (ubi=140101 & estrato<=3) dominio3=2.
 if (ubi=160101 & estrato<=3) dominio3=2.
 if (ubi=170101 & estrato<=3) dominio3=2.
 if (ubi=180101 & estrato<=3) dominio3=2.
 if (ubi=190101 & estrato<=3) dominio3=2.
 if (ubi=200101 & estrato<=3) dominio3=2.
 if (ubi=210101 & estrato<=3) dominio3=2.
 if (ubi=220101 & estrato<=3) dominio3=2.
 if (ubi=230101 & estrato<=3) dominio3=2.
 if (ubi=240101 & estrato<=3) dominio3=2.
 if (ubi=250101 & estrato<=3) dominio3=2.
 if (sysmiss(dominio3) & estrato <=3) dominio3=3.
 if (estrato>=4) dominio3=4.
variable labels dominio3 "CIUDADES".
value labels dominio3
1 "Lima Metropolitana"
2 "Ciudades capitales de dpto"
3 "Ciudades menores"
4 "Rural".
execute.
  
***************************************** Calculo de indicadores vivienda
  
 recode p110 (4 thru 7=1) (else=0) into indi01.
 recode p111 (5 thru 6=1) (else=0) into indi02.
 if (indi01=1 & indi02=1) indi03=1.
 recode p102 (3=1) (else=0) into indi05.
 recode p103 (6=1) (else=0) into indi06.
 recode p1121 (0=1) (else=0) into indi08.
 if (p1131=1) indi09=1.
 if (p1132=1) indi09=1.
 execute.
 recode indi03 indi09(sysmiss=0).
 compute tiequi_1=p612$02+p612$03+p612$04+p612$05+p612$06+p612$07+p612$08+p612$16.
 recode tiequi_1 (0=1) (else=0) into indi10.
 
************************************* General Tables.
  
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= ipcm gpcm
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi01 + indi02 + indi03 BY t2 + dominio .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= ipcm gpcm
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi01 + indi02 + indi03 + nbi2 + indi05 + indi06 + nbi1 + indi08 +
  indi09 + indi10 + nbi5 + ipcm + gpcm + nbi4 BY t2 + dominio2 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= ipcm gpcm
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi01 + indi02 + indi03 + nbi2 + indi05 + indi06 + nbi1 + indi08 +
  indi09 + indi10 + nbi5 + ipcm + gpcm +nbi4 BY t2 + dominio3 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= ipcm gpcm
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi01 + indi02 + indi03 + nbi2 + indi05 + indi06 + nbi1 + indi08 +
  indi09 + indi10 + nbi5 + ipcm + gpcm +nbi4 BY t2 + area .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= ipcm gpcm
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi01 + indi02 + indi03 + nbi2 + indi05 + indi06 + nbi1 + indi08 +
  indi09 + indi10 + nbi5 + ipcm + gpcm+nbi4 BY t2 + regnat .
  
***************************poblacion***********.
  
 if (ocu500e=1 & p507=5) indi12=1.
 execute.
 recode indi12(sysmiss=0).
 
USE ALL.
COMPUTE filter_$=(p208a >= 15 & p204=1 & (p203 ~= 7 & p203 ~= 8)).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi12 BY t2 + dominio
  /STATISTICS
  cpct( indi12( F5.1 ) 'Col %':dominio ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi12 BY t2 + dominio2
  /STATISTICS
  cpct( indi12( F5.1 ) 'Col %':dominio2 ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi12 BY t2 + dominio3
  /STATISTICS
  cpct( indi12( F5.1 ) 'Col %':dominio3 ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi12 BY t2 + AREA
  /STATISTICS
  cpct( indi12( F5.1 ) 'Col %':AREA ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi12 BY t2 + REGNAT
  /STATISTICS
  cpct( indi12( F5.1 ) 'Col %':REGNAT ).
 
USE ALL.
COMPUTE filter_$=(p208a >= 14 & ocu500e>=1 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
 

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + ocu500e BY t2 +dominio .

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + ocu500e BY t2 +dominio2 .

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + ocu500e BY t2 +dominio3 .

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + ocu500e BY t2 +area .

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + ocu500e BY t2 +regnat .
  
***************************************HOGARES**************************.
  

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI15 BY t2 +dominio
  /STATISTICS
  cpct( indi15( F5.1 ) 'Col %':dominio ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI15 BY t2 +dominio2
  /STATISTICS
  cpct( indi15( F5.1 ) 'Col %':dominio2 ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI15 BY t2 +dominio3
  /STATISTICS
  cpct( indi15( F5.1 ) 'Col %':dominio3 ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI15 BY t2 +area
  /STATISTICS
  cpct( indi15( F5.1 ) 'Col %':AREA ).

TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI15 BY t2 +regnat
  /STATISTICS
  cpct( indi15( F5.1 ) 'Col %':REGNAT ).
  
*****************************tasa de asistencia***************.
  
 if (edadfem=1 & p208a>=3 & p208a<=5) edad1=1.
 if (edadfem=1 & p208a>=6 & p208a<=11) edad1=2.
 if (edadfem=1 & p208a>=12 & p208a<=16) edad1=3.
 if (edadfem=1 & p208a>=17 & p208a<=24) edad1=4.
 if (edadfem=1 & p208a>=25 ) edad1=5.
 variable labels edad1 "Edad".
 value labels edad1
 1 "menos de 6"
 2 "6 a 11"
 3 "12 a 16"
 4 "17 a 24"
 5 "25 y más".
 recode p304a(sysmiss=0).
 
USE ALL.
COMPUTE filter_$=( p208a >= 6 & p208a <=11 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
if (p304a=2 & p304c=1) p304a=1.
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio2 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio3 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +area .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +regnat .
USE ALL.
COMPUTE filter_$=( p208a >= 12 & p208a <=17 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio2 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +dominio3 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +area .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p304a BY t2 +regnat .
USE ALL.
COMPUTE filter_$=( p208a >= 15 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p302 + p301a BY t2 +dominio
  /STATISTICS
  cpct(p302( F5.1 ) 'Col %':dominio )
  cpct(p301a( F5.1 ) 'Col %':dominio ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p302 + p301a BY t2 +dominio2
  /STATISTICS
  cpct(p302( F5.1 ) 'Col %':dominio2 )
  cpct(p301a( F5.1 ) 'Col %':dominio2 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p302 + p301a BY t2 +dominio3
  /STATISTICS
  cpct(p302( F5.1 ) 'Col %':dominio3 )
  cpct(p301a( F5.1 ) 'Col %':dominio3 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p302 + p301a BY t2 +regnat
  /STATISTICS
  cpct(p302( F5.1 ) 'Col %':regnat )
  cpct(p301a( F5.1 ) 'Col %':regnat ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p302 + p301a BY t2 +area
  /STATISTICS
  cpct(p302( F5.1 ) 'Col %':area )
  cpct(p301a( F5.1 ) 'Col %':area ).
if (p301a <=3 ) indi22=1.
recode indi22 (sysmiss=0).
USE ALL.
COMPUTE filter_$=(p208a >= 15 & p207=2 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI22 BY t2 +dominio
  /STATISTICS
  cpct( indi22( F5.1 ) 'Col %':dominio ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI22 BY t2 +dominio2
  /STATISTICS
  cpct( indi22( F5.1 ) 'Col %':dominio2 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI22 BY t2 +dominio3
  /STATISTICS
  cpct( indi22( F5.1 ) 'Col %':dominio3 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI22 BY t2 +area
  /STATISTICS
  cpct( indi22( F5.1 ) 'Col %':AREA ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI22 BY t2 +regnat
  /STATISTICS
  cpct( indi22( F5.1 ) 'Col %':REGNAT ).
USE ALL.
COMPUTE filter_$=(p208a >= 15 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
 if (p301a=1or p301a=2 or (p301a=3 & p301c=1)) años=0.
 if (p301a=3 & p301b>=1 & p301b<=4) años=p301b.
 if (p301a=3 & p301b>=5 & p301b<=5) años=4.
 if (p301a=3 & p301c>=2 & p301b<=5) años=p301c-1.
 if (p301a=4) años=5.
 if (p301a=5 & p301b>=1 & p301b<=4) años=5+p301b.
 if (p301a=6) años=10.
 if (p301a=7 & p301b>=1 & p301b<=4) años=10+p301b.
 if (p301a=8 & p301b>=3 & p301b<=5) años=10+p301b.
 if (p301a=9 & p301b>=1 & p301b<=6) años=10+p301b.
 if (p301a=10 & p301b>=4 & p301b<=7) años=10+p301b.
 if (p301a=99 & p301b=9) años=99.
 format años(f2.0).
 missing value años(99).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= años
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + años BY t2 + dominio .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= años
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + años BY t2 + dominio2 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= años
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + años BY t2 + dominio3 .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= años
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + años BY t2 + area .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /OBSERVATION= años
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + años BY t2 + regnat .
USE ALL.
COMPUTE filter_$=( p303= 2 & p208a >=6 & p208a <= 24 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
 if (p310=4) indi24=1.
 execute.
 recode indi24 (sysmiss=0).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI24 BY t2 +dominio
  /STATISTICS
  cpct( indi24( F5.1 ) 'Col %':dominio ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI24 BY t2 +dominio2
  /STATISTICS
  cpct( indi24( F5.1 ) 'Col %':dominio2 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI24 BY t2 +dominio3
  /STATISTICS
  cpct( indi24( F5.1 ) 'Col %':dominio3 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI24 BY t2 +area
  /STATISTICS
  cpct( indi24( F5.1 ) 'Col %':AREA ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + INDI24 BY t2 +regnat
  /STATISTICS
  cpct( indi24( F5.1 ) 'Col %':REGNAT ).
  
***************************SALUD*************.
  
USE ALL.
COMPUTE filter_$=( p401=1 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
 if (p40414=1 or p40415=1) indi26=0.
 execute.
 recode indi26 (sysmiss=1).
  
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi26 + p4042 BY t2 +dominio.
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi26 + p4042 BY t2 +dominio2.
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi26 + p4042 BY t2 +dominio3.
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi26 + p4042 BY t2 +area.
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + indi26 + p4042 BY t2 +regnat.
USE ALL.
COMPUTE filter_$=( p401=1 & p40415=1 & (p204=1 & (p203 ~= 7 & p203 ~= 8))).
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p4112 BY t2 +dominio
  /STATISTICS
  cpct( p4112( F5.1 ) 'Col %':dominio ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p4112 BY t2 +dominio2
  /STATISTICS
  cpct( p4112( F5.1 ) 'Col %':dominio2 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p4112 BY t2 +dominio3
  /STATISTICS
  cpct( p4112( F5.1 ) 'Col %':dominio3 ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p4112 BY t2 +area
  /STATISTICS
  cpct( p4112( F5.1 ) 'Col %':area ).
TABLES
  /FORMAT BLANK MISSING('.')
  /GBASE=CASES
  /PTOTAL= t1 "Total" t2 "Total"
  /TABLE=t1 + p4112 BY t2 +regnat
  /STATISTICS
  cpct( p4112( F5.1 ) 'Col %':regnat ).