Over 25 Assets (Collapsed) - Appendix 5

Over 25 Assets (Collapsed) - Appendix 5

Variables Created

  • CVC_HH_NET_WORTH_25 (total net worth)
  • CVC_HOUSE_VALUE_25 (value of owned housing)
  • CVC_HOUSE_DEBT_25 (amount of housing debt)
  • CVC_HOUSE_TYPE_25 (type of housing owned)
  • CVC_ASSETS_FINANCE_25 (value of financial assets)
  • CVC_ASSETS_NONFINANCE_25 (value of non-financial assets, excluding housing)
  • CVC_ASSETS_DEBT_25 (amount of debt, excluding housing)
  • CVC_ASSETS_RND_25 (round in which assets data were collected)

Round 9 initiated the age 25 assets section. Like the age 20 assets section, this module is administered in the first interview after the respondent's 25th birthday. These variables report the respondent's assets at age 25. As with the age 20 assets section, the variables are presented as collapsed variables which contain data from all survey rounds in which the section was administered. (See the description of the age 20 variable program for more information.)

Researchers should note that, like many income and asset variables in the data set, this variable is topcoded to protect respondent privacy. More information about topcoding is available in the Income, Assets & Program Participation section.

Variables Used

/**Variable Names in the Program       Variable Names on the Gator**/

  YAS25_NEW1                            YAST25-NEW1_2010
  YAS25_105                             YAST25-105_2010
  YAS25_4000S1                          YAST25-4000S1_2010
  YAS25_4000S2                          YAST25-4000S2_2010
  YAS25_4000S3                          YAST25-4000S3_2010
  YAS25_4000S3A                         YAST25-4000S3A_2010
  YAS25_4000S4                          YAST25-4000S4_2010
  YAS25_4000S5                          YAST25-4000S5_2010
  YAS25_4000S6                          YAST25-4000S6_2010
  YAS25_4000S7                          YAST25-4000S7_2010
  YAS25_4000S8                          YAST25-4000S8_2010
  YAS25_4000S9                          YAST25-4000S9_2010
  YAS25_4000S9A                         YAST25-4000S9A_2010
  YAS25_4000S10                         YAST25-4000S10_2010
  YAS25_4000S10A                        YAST25-4000S10A_2010
  YAS25_4400                            YAST25-4400_2010
  YAS25_4420                            YAST25-4420_2010
  YAS25_4422                            YAST25-4422_2010
  YAS25_4426                            YAST25-4426_2010
  YAS25_4530                            YAST25-4530_2010
  YAS25_4540A                           YAST25-4540A_2010
  YAS25_4550                            YAST25-4550_2010
  YAS25_4556                            YAST25-4556_2010
  YAS25_4660                            YAST25-4660_2010
  YAS25_4680                            YAST25-4680_2010
  YAS25_4682                            YAST25-4682_2010
  YAS25_4770                            YAST25-4770_2010
  YAS25_4770A                           YAST25-4770A_2010
  YAS25_4770A1                          YAST25-4770A1_2010
  YAS25_4770A2                          YAST25-4770A2_2010
  YAS25_4270                            YAST25-4270_2010
  YAS25_4290                            YAST25-4290_2010
  YAS25_4292                            YAST25-4292_2010
  YAS25_4294l                           YAST25-4294_000001_2010
  YAS25_4294u                           YAST25-4294_000002_2010
  YAS25_4296                            YAST25-4296_2010
  YAS25_4300                            YAST25-4300_2010
  YAS25_4300A                           YAST25-4300A_2010
  YAS25_4300A1                          YAST25-4300A1_2010
  YAS25_4790                            YAST25-4790_2010
  YAS25_4810                            YAST25-4810_2010
  YAS25_4812                            YAST25-4812_2010
  YAS25_4814l                           YAST25-4814_000001_2010
  YAS25_4814u                           YAST25-4814_000002_2010
  YAS25_4816                            YAST25-4816_2010
  YAS25_4840                            YAST25-4840_2010
  YAS25_4842                            YAST25-4842_2010
  YAS25_4846                            YAST25-4846_2010
  YAS25_4010                            YAST25-4010_2010
  YAS25_4030A_01                        YAST25-4030A.01_2010
  YAS25_4032_01                         YAST25-4032.01_2010
  YAS25_4140                            YAST25-4140_2010
  YAS25_4160                            YAST25-4160_2010
  YAS25_4162                            YAST25-4162_2010
  YAS25_4166                            YAST25-4166_2010
  YAS25_4870                            YAST25-4870_2010
  YAS25_4880                            YAST25-4880_2010
  YAS25_5011                            YAST25-5011_2010
  YAS25_5011A                           YAST25-5011A_2010
  YAS25_5012                            YAST25-5012_2010
  YAS25_5015                            YAST25-5015_2010
  YAS25_5015A                           YAST25-5015A_2010
  YAS25_5016                            YAST25-5016_2010
  YAS25_5018                            YAST25-5018_2010
  YAS25_5020                            YAST25-5020_2010
  YAS25_5040                            YAST25-5040_2010
  YAS25_5050_01                         YAST25-5050~000001_2010
  YAS25_5050_02                         YAST25-5050~000002_2010
  YAS25_5050_03                         YAST25-5050~000003_2010
  YAS25_5050_04                         YAST25-5050~000004_2010
  YAS25_5050_05                         YAST25-5050~000005_2010
  YAS25_5050_06                         YAST25-5050~000006_2010
  YAS25_5050_07                         YAST25-5050~000007_2010
  YAS25_5050_08                         YAST25-5050~000008_2010
  YAS25_5050_09                         YAST25-5050~000009_2010
  YAS25_5050_10                         YAST25-5050~000010_2010
  YAS25_5050_11                         YAST25-5050~000011_2010
  YAS25_5050_12                         YAST25-5050~000012_2010
  YAS25_5050_13                         YAST25-5050~000013_2010
  YAS25_5050_14                         YAST25-5050~000014_2010
  YAS25_5050_15                         YAST25-5050~000015_2010
  YAS25_5050_16                         YAST25-5050~000016_2010
  YAS25_5050_17                         YAST25-5050~000017_2010
  YAS25_5050_18                         YAST25-5050~000018_2010
  YAS25_5050_19                         YAST25-5050~000019_2010
  YAS25_5050_20                         YAST25-5050~000020_2010
  YAS25_5060                            YAST25-5060_2010
  YAS25_5062                            YAST25-5062_2010
  YAS25_5066_01                         YAST25-5066.01_2010
  YAS25_5066_02                         YAST25-5066.02_2010
  YAS25_5066_03                         YAST25-5066.03_2010
  YAS25_5066_04                         YAST25-5066.04_2010
  YAS25_5066_05                         YAST25-5066.05_2010
  YAS25_5066_06                         YAST25-5066.06_2010
  YAS25_5066_07                         YAST25-5066.07_2010
  YAS25_5066_08                         YAST25-5066.08_2010
  YAS25_5066_09                         YAST25-5066.09_2010
  YAS25_5066_10                         YAST25-5066.10_2010
  YAS25_5066_11                         YAST25-5066.11_2010
  YAS25_5066_12                         YAST25-5066.12_2010
  YAS25_5066_13                         YAST25-5066.13_2010
  YAS25_5066_14                         YAST25-5066.14_2010
  YAS25_5066_15                         YAST25-5066.15_2010
  YAS25_5066_16                         YAST25-5066.16_2010
  YAS25_5066_17                         YAST25-5066.17_2010
  YAS25_5066_18                         YAST25-5066.18_2010
  YAS25_5066_19                         YAST25-5066.19_2010
  YAS25_5066_20                         YAST25-5066.20_2010
  YAS25_5074_02                         YAST25-5074.02_2010
  YAS25_5080_02                         YAST25-5080.02_2010
  YAS25_5082_02                         YAST25-5082.02_2010
  YAS25_5130                            YAST25-5130_2010
  YAS25_5210A                           YAST25-5210A_2010
  YAS25_5210A1                          YAST25-5210A1_2010
  YAS25_5210A2                          YAST25-5210A2_2010
  YAS25_5210A4                          YAST25-5210A4_2010
  YAS25_5210B1                          YAST25-5210B1_2010
  YAS25_5210C1                          YAST25-5210C1_2010
  YAS25_5210C2                          YAST25-5210C2_2010
  YAS25_5210C4                          YAST25-5210C4_2010
  YAS25_5210D1                          YAST25-5210D1_2010
  YAS25_5210D1A                         YAST25-5210D1A_2010
  YAS25_5210D2                          YAST25-5210D2_2010
  YAS25_5210D4                          YAST25-5210D4_2010
  YAS25_5250                            YAST25-5250_2010
  YAS25_5260                            YAST25-5260_2010
  YAS25_5280                            YAST25-5280_2010
  YAS25_5282                            YAST25-5282_2010
  YAS25_5284l                           YAST25-5284_000001_2010
  YAS25_5284u                           YAST25-5284_000002_2010
  YAS25_5286                            YAST25-5286_2010
  YAS25_5310                            YAST25-5310_2010
  YAS25_5320                            YAST25-5320_2010
  YAS25_5326                            YAST25-5326_2010
  YAS25_5410                            YAST25-5410_2010
  YAS25_5411                            YAST25-5411_2010
  YAS25_5420                            YAST25-5420_2010
  YAS25_5421                            YAST25-5421_2010
  YAS25_5422M                           YAST25-5422~M_2010
  YAS25_5422Y                           YAST25-5422~Y_2010
  YAS25_5423                            YAST25-5423_2010
  YAS30_105                             YAST30-105_2010
  YAS30_200A                            YAST30-200A_2010
  YAS30_210A                            YAST30-210A_2010
  YAS30_300A                            YAST30-300A_2010
  YAS30_500A                            YAST30-500A_2010
  YAS30_510A                            YAST30-510A_2010
  YAS30_520A                            YAST30-520A_2010
  YAS_1                                 YAST-1_2010
  YAS_DLIMORTGAGE                       YAST-DLIMORTGAGE_2010
  YAS_DLIOWN2                           YAST-DLIOWN2_2010
  YAS_2                                 YAST-2_2010
  YAS_DLIOWNED                          YAST-DLIOWNED_2010
  YAS_8                                 YAST-8_2010
  YAS_9                                 YAST-9_2010
  YAS_10M                               YAST-10~M_2010
  YAS_10Y                               YAST-10~Y_2010
  YAS_11                                YAST-11_2010
  YAS_12A                               YAST-12A_2010
  YAS_12C                               YAST-12C_2010
  YAS_13                                YAST-13_2010
  YAS_CH1                               YAST-CH1_2010
  YAS_CH2                               YAST-CH2_2010
  YAS_CH_CHECK                          YAST-CH_CHECK_2010
  YAS_CH3                               YAST-CH3_2010
  YAS_CH3AM                             YAST-CH3A~M_2010
  YAS_CH3AY                             YAST-CH3A~Y_2010
  YAS_CH4                               YAST-CH4_2010
  YAS_CH5A                              YAST-CH5A_2010
  YAS_CH5Bl                             YAST-CH5B_000001_2010
  YAS_CH5Bu                             YAST-CH5B_000002_2010
  YAS_CH5C                              YAST-CH5C_2010
  YAS_CH6                               YAST-CH6_2010
  YAS_CH7                               YAST-CH7_2010
  YAS_CH7A                              YAST-CH7A_2010
  YAS_CH7Bl                             YAST-CH7B_000001_2010
  YAS_CH7Bu                             YAST-CH7B_000002_2010
  YAS_CH7C                              YAST-CH7C_2010
  YAS_CH8                               YAST-CH8_2010
  YAS_CH8_1                             YAST-CH8_1_2010
  YAS_CH8A                              YAST-CH8A_2010
  YAS_CH8Bl                             YAST-CH8B_000001_2010
  YAS_CH8Bu                             YAST-CH8B_000002_2010
  YAS_CH8C                              YAST-CH8C_2010
  YAS30_AGE30ELIG1                      YAST30-AGE30ELIG1_2010
  YAS30_CH9                             YAST30-CH9_2010
  YAS30_CH10                            YAST30-CH10_2010
  YAS30_CH10A                           YAST30-CH10A_2010
  YAS30_CH10C                           YAST30-CH10C_2010
  YAS_HOUSEVALUE                        YAST-HOUSEVALUE_2010
  YAS30_CHHVA                           YAST30-CHHVA_2010
  YAS30_CHHVBl                          YAST30-CHHVB_000001_2010
  YAS30_CHHVBu                          YAST30-CHHVB_000002_2010
  YAS30_CHHVC                           YAST30-CHHVC_2010
  pubid                                 pubid_2010
  PUBID                                 PUBID_2010
  e24800_111                            YSCH-24800.01.01.01_2010
  e24800_112                            YSCH-24800.01.01.02_2010
  e24800_113                            YSCH-24800.01.01.03_2010
  e24800_114                            YSCH-24800.01.01.04_2010
  e24800_115                            YSCH-24800.01.01.05_2010
  e24800_211                            YSCH-24800.02.01.01_2010
  e24800_212                            YSCH-24800.02.01.02_2010
  e24900_111                            YSCH-24900.01.01.01_2010
  e24900_113                            YSCH-24900.01.01.03_2010
  e24900_114                            YSCH-24900.01.01.04_2010
  e25700_11                             YSCH-25700.01.01_2010
  e25700_12                             YSCH-25700.01.02_2010
  e25700_13                             YSCH-25700.01.03_2010
  e25700_14                             YSCH-25700.01.04_2010
  e25700_21                             YSCH-25700.02.01_2010
  e25700_22                             YSCH-25700.02.02_2010
  e25700_23                             YSCH-25700.02.03_2010
  e25700_31                             YSCH-25700.03.01_2010
  e25700_41                             YSCH-25700.04.01_2010
  e25800_11                             YSCH-25800.01.01_2010
  e25800_12                             YSCH-25800.01.02_2010
  e25800_21                             YSCH-25800.02.01_2010

SAS Code for Variable Creation

/*******************************start of the assest section (hhworthy)******************************************/

/*  first create the components of hhworth25: real estate, loans, cars, etc.  each sub-section computes one item */
/*  of the total asset of the respondent and his/her spouse or partner.  flag variables are created to indicate whether  */
/*  r/family received that asset item (flag_item in (1,2,-3) and if so, was the amount computed directly from the amount */
/*  reported by respondent (flag_item=1) or was it computed from estimates given by respondent (flag_item=2), or was */
/*  it unable to be computed (flag_item=-3).                                                                             */
/***************************************************************************************************************************/

/* initialize the variable to housing_type= don't own, house_value = 0  */
housing_type=6 ;  
house_value=0 ;   

/****************** assets section one:  residence *************************************************/         

if YAS_DLIMORTGAGE=1 or YAS_DLIOWN2=1 or YAS_CH1 in (1 2 3 4) then
do;
    flag_house=1;
    flagck_house=1;
    if YAS_HOUSEVALUE=1 & YAS30_CHHVA>=0 then house_value=YAS30_CHHVA;
    else if YAS_HOUSEVALUE=2 & YAS30_CHHVBl>=0 & YAS30_CHHVBu>=0 then
    do;
        if YAS30_CHHVBu>=YAS30_CHHVBl then house_value = (YAS30_CHHVBu + YAS30_CHHVBl)/2;
        else house_value=-3;
    end;              
    if YAS_HOUSEVALUE not in (1,2) or YAS30_CHHVA in (-1, -2) then
    do;
        if 1<=YAS30_CHHVC<=7 then flag_house=2;
        if YAS30_CHHVC=1 then house_value=12500;
        else if YAS30_CHHVC=2 then house_value=37500;
        else if YAS30_CHHVC=3 then house_value=75000;
        else if YAS30_CHHVC=4 then house_value=175000;
        else if YAS30_CHHVC=5 then house_value=375000;
        else if YAS30_CHHVC=6 then house_value=750000;
        else if YAS30_CHHVC=7 then house_value=1000001;
    end;
end;

if YAS_CH1 in (-1 -2 -3) or YAS30_CHHVBu in (-1 -2 -3) or YAS30_CHHVBl in (-1 -2 -3) or YAS30_CHHVC in (-1 -2 -3) then house_value=-3;

if YAS_CH1 in (-1 -2 -3) then housing_type=-3; *not knowing own or not own;
if YAS_DLIMORTGAGE=1 or YAS_DLIOWN2=1 or YAS_CH1 in (1 2 3 4) then do;
  if hhi4400=1 then housing_type=1;
  else if hhi4400=12 then housing_type=2;
  else if hhi4400=8 then housing_type=3;
  else do;
  housing_type=-3; *house type unknown;
  flag_h_type=1;
  end;
end;

if yas25_new1 ne 1 then do ; *XA May 2012;
    housing_type=-4;
    house_value=-4;  
end;    
                    
/*****************************assets section 2:  owning business-pvbuss*********************************************/
            
 array pvbuss      (*)      pvbuss_01        - pvbuss_03;           /* pv of business  */
 array yas25_4030a (*)      yas25_4030a_01   - yas25_4030a_03;       /* make, lose or even  */
 array yas25_4032  (*)      yas25_4032_01    - yas25_4032_03;        /* amount make  */
 array yas25_4032a (*)      yas25_4032a_01   - yas25_4032a_03;       /* amount lose  */
 array yas25_4033al(*)      yas25_4033al_01  - yas25_4033al_03;      /* amount make lower bound */
 array yas25_4033au(*)      yas25_4033au_01  - yas25_4033au_03;      /* amount make upper bound */  
 array yas25_4034al(*)      yas25_4034al_01  - yas25_4034al_03;      /* amount lose lower bound */    
 array yas25_4034au(*)      yas25_4034au_01  - yas25_4034au_03;      /* amount lose upper bound */
 array yas25_4036  (*)      yas25_4036_01    - yas25_4036_03;        /* amount make, estimate */
 array yas25_4036a (*)      yas25_4036a_01   - yas25_4036a_03;       /* amount lose, estimate */
 
 
do i=1 to dim(pvbuss);
    pvbuss(i)= -4;
    if yas25_4010 in (1,2) then
    do;
        flag_pvbuss =1;
        if yas25_4030a(i)=1 then
        do;
            if yas25_4032a(i)>=0 then pvbuss(i)=yas25_4032a(i);
            else if yas25_4032a(i) in (-1, -2) then
            do;
                if yas25_4034au(i)>=yas25_4034al(i) and yas25_4034au(i)>=0 and yas25_4034al(i)>=0 then pvbuss(i)=(yas25_4034al(i) + yas25_4034au(i))/2;
                else pvbuss(i)=-3;
            end;
            if yas25_4034au(i) in (-1, -2) then
            do;
                if 1 <= yas25_4036a(i)<=7 then flag_pvbuss=2;
                if yas25_4036a(i)=1 then pvbuss(i)=12500;
                else if yas25_4036a(i)=2 then pvbuss(i)=37500;
                else if yas25_4036a(i)=3 then pvbuss(i)=75000;
                else if yas25_4036a(i)=4 then pvbuss(i)=175000;
                else if yas25_4036a(i)=5 then pvbuss(i)=375000;
                else if yas25_4036a(i)=6 then pvbuss(i)=750000;
                else if yas25_4036a(i)=7 then pvbuss(i)=1000001;
            end;
            if pvbuss(i)>0 then pvbuss(i)=-1*pvbuss(i);
        end;
        else if yas25_4030a(i)=2 then
        do;
            if yas25_4032(i)>=0 then pvbuss(i)=yas25_4032(i);
            else if yas25_4032(i) in (-1, -2) then
            do;
                if yas25_4033au(i)>=yas25_4033al(i) and yas25_4033au(i)>=0 and yas25_4033al(i)>=0 then    pvbuss(i)=(yas25_4033al(i) + yas25_4033au(i))/2;
                else pvbuss(i)=-3;
            end;
            if yas25_4033au(i) in (-1, -2) then
            do;
                if 1<=yas25_4036(i)<=7 then flag_pvbuss=2;
                if yas25_4036(i)=1 then pvbuss(i)=12500;
                else if yas25_4036(i)=2 then pvbuss(i)=37500;
                else if yas25_4036(i)=3 then pvbuss(i)=75000;
                else if yas25_4036(i)=4 then pvbuss(i)=175000;
                else if yas25_4036(i)=5 then pvbuss(i)=375000;
                else if yas25_4036(i)=6 then pvbuss(i)=750000;
                else if yas25_4036(i)=7 then pvbuss(i)=1000001;
            end;
        end;
        else if yas25_4030a(i)=3 then pvbuss(i)=0;
    end;

    if yas25_4010=-1 or yas25_4030a(i)=-1 or yas25_4036a(i)=-1 or yas25_4036(i)= -1 then pvbuss(i)=-1;
    if yas25_4010=-2 or yas25_4030a(i)=-2 or yas25_4036a(i)=-2 or yas25_4036(i)= -2 then pvbuss(i)=-2;  
    if yas25_4010=-3 or yas25_4030a(i)=-3 or yas25_4036a(i)=-3 or yas25_4036(i)= -3 then pvbuss(i)=-3;                                                               
end;
   
                                               
      /**************************assets section 3:  ownership of other real-estate : othreal**********************************/
othreal=-4;

if yas25_4140 in (1,2) then
do;
    flag_othreal=1;
    if yas25_4160=1 & yas25_4162>=0 then othreal=yas25_4162;
    else if yas25_4160=2 & yas25_4164u>=0 & yas25_4164l>=0 then
    do;
        if yas25_4164u>=yas25_4164l then othreal=(yas25_4164l+yas25_4164u)/2;
        else othreal=-3;
    end;
    if yas25_4160 not in (1,2) or yas25_4162 in (-1, -2) then
    do;
        if 1<=yas25_4166<=7 then flag_othreal=2;
        if yas25_4166=1 then othreal=12500;
        else if yas25_4166=2 then othreal=37500;
        else if yas25_4166=3 then othreal=75000;
        else if yas25_4166=4 then othreal=175000;
        else if yas25_4166=5 then othreal=375000;
        else if yas25_4166=6 then othreal=750000;
        else if yas25_4166=7 then othreal=1000001;
    end;
end;

if yas25_4140=-1 or yas25_4164l=-1 or yas25_4164u=-1 or yas25_4166=-1  then othreal =-1;
if yas25_4140=-2 or yas25_4164l=-2 or yas25_4164u=-2 or yas25_4166=-2  then othreal =-2;
if yas25_4140=-3 or yas25_4164l=-3 or yas25_4164u=-3 or yas25_4166=-3 or yas25_4162=-3  then othreal =-3;
          
/*****************assets section 4:  retirement plans or pensions--retdsav***********************************************/
retdsav=-4;

if yas25_4270 in (1,2,3) or yas25_4000s6=1 or  yas25_4000s5 in (-2,-1) then
do;
    flag_retdsav=1;
    if yas25_4290=1 & yas25_4292>=0 then retdsav=yas25_4292;
    else if yas25_4290=2 and yas25_4294u>=0 and yas25_4294l>=0 then
    do;
        if yas25_4294u>=yas25_4294l then retdsav = (yas25_4294l + yas25_4294u)/2;
        else retdsav =-3;
    end;
    if yas25_4290 not in (1,2) or yas25_4292 in (-1, -2) then
    do;
        if 1<=yas25_4296<=8 then flag_retdsav=2;
        if yas25_4296=1 then retdsav=2500;
        else if yas25_4296=2 then retdsav= 7500;
        else if yas25_4296=3 then retdsav=17500;
        else if yas25_4296=4 then retdsav=37500;
        else if yas25_4296=5 then retdsav=75000;
        else if yas25_4296=6 then retdsav=175000;
        else if yas25_4296=7 then retdsav=375000;
        else if yas25_4296=8 then retdsav=500001;
    end;
end;

if yas25_4270=-1 or yas25_4000s6=-1 or yas25_4294l=-1 or yas25_4294u=-1 or yas25_4296=-1 then retdsav=-1;
if yas25_4270=-2 or yas25_4000s6=-2 or yas25_4294l=-2 or yas25_4294u=-2 or yas25_4296=-2 then retdsav=-2;
if yas25_4270=-3 or yas25_4000s6=-3 or yas25_4294l=-3 or yas25_4294u=-3 or yas25_4296=-3 then retdsav=-3;
                                                                                                        
/**********************assets section 5:  bank savings--banksav*************************************************************/
                                                                      
banksav=-4;

if yas25_4400 in (1,2,3) or yas25_4000s4=1 then
do;
    flag_banksav=1;
    if yas25_4420=1 & yas25_4422>=0 then banksav=yas25_4422;
    else if yas25_4420=2 & yas25_4424u>=0 & yas25_4424l>=0 then
    do;
        if yas25_4424u>=yas25_4424l then banksav = (yas25_4424u + yas25_4424l)/2;
        else banksav=-3;
    end;
    if yas25_4420 not in (1,2) or yas25_4422 in (-1, -2) then
    do;
        if 1<=yas25_4426<=9 then flag_banksav=2;
        if yas25_4426=1 then banksav=500;
        else if yas25_4426=2 then banksav=1750;
        else if yas25_4426=3 then banksav=3750;
        else if yas25_4426=4 then banksav=7500;
        else if yas25_4426=5 then banksav=17500;
        else if yas25_4426=6 then banksav=37500;
        else if yas25_4426=7 then banksav=75000;
        else if yas25_4426=8 then banksav=175000;
        else if yas25_4426=9 then banksav=250001;
    end;
end;

if yas25_4400=-1 or yas25_4000s4=-1 or yas25_4424l=-1 or yas25_4424u=-1 or yas25_4426=-1 then banksav=-1;
if yas25_4400=-2 or yas25_4000s4=-2 or yas25_4424l=-2 or yas25_4424u=-2 or yas25_4426=-2 then banksav=-2;
if yas25_4400=-3 or yas25_4000s4=-3 or yas25_4424l=-3 or yas25_4424u=-3 or yas25_4426=-3 or yas25_4422=-3  then banksav=-3;
                                                                                                                      
/************************************assets section 6:  other bank savings-bonds****************************************/

bonds=-4;

if yas25_4530 in (1,2,3) or yas25_4000s5=1 or yas25_4000s4 in (-2,-1) then
do;
    flag_bonds=1;
    if yas25_4550=1 & yas25_4552>=0 then bonds=yas25_4552;
    else if yas25_4550=2 & yas25_4554u>=0 & yas25_4554l>=0 then
    do;
        if yas25_4554u>=yas25_4554l then bonds = (yas25_4554u + yas25_4554l)/2;
        else bonds=-3;
    end;
    if yas25_4550 not in (1,2) or yas25_4552 in (-1, -2) then
    do;
        if 1<=yas25_4556<=9 then flag_bonds=2;
        if yas25_4556=1 then bonds=500;
        else if yas25_4556=2 then bonds=1750;
        else if yas25_4556=3 then bonds=3750;
        else if yas25_4556=4 then bonds=7500;
        else if yas25_4556=5 then bonds=17500;
        else if yas25_4556=6 then bonds=37500;
        else if yas25_4556=7 then bonds=75000;
        else if yas25_4556=8 then bonds=175000;
        else if yas25_4556=9 then bonds=250001;
    end;
end;

if yas25_4530=-1 or yas25_4000s5=-1 or yas25_4554L=-1 or yas25_4554U=-1 or yas25_4556=-1 then bonds=-1;
if yas25_4530=-2 or yas25_4000s5=-2 or yas25_4554L=-2 or yas25_4554U=-2 or yas25_4556=-2 then bonds=-2;
if yas25_4530=-3 or yas25_4000s5=-3 or yas25_4554L=-3 or yas25_4554U=-3 or yas25_4556=-3 or yas25_4552=-3 then bonds=-3;               
 
 /********assets section 7:  owning stocks--stocks****************************************************/
 
stocks=-4;

if yas25_4660 in (1,2,3) then
do;
    flag_stocks=1;
    if yas25_4680=1 & yas25_4682>=0 then stocks=yas25_4682;
    else if yas25_4680=2 & yas25_4684l>=0 & yas25_4684u>=0 then
    do;
        if yas25_4684u>=yas25_4684l then stocks=(yas25_4684l+yas25_4684u)/2;
        else stocks=-3;
    end;
    if yas25_4680 not in (1,2) or yas25_4682 in (-1,-2) then
    do;
        if 1<=yas25_4686<=9 then flag_stocks=2;
        if yas25_4686=1 then stocks=500;
        else if yas25_4686=2 then stocks=1750;
        else if yas25_4686=3 then stocks=3750;
        else if yas25_4686=4 then stocks=7500;
        else if yas25_4686=5 then stocks=17500;
        else if yas25_4686=6 then stocks=37500;
        else if yas25_4686=7 then stocks=75000;
        else if yas25_4686=8 then stocks=175000;
        else if yas25_4686=9 then stocks=250001;
    end;
end;

if yas25_4660=-1 or yas25_4684l=-1 or yas25_4684u=-1 or yas25_4686=-1 then stocks=-1;
if yas25_4660=-2 or yas25_4684l=-2 or yas25_4684u=-2 or yas25_4686=-2 then stocks=-2;
if yas25_4660=-3 or yas25_4684l=-3 or yas25_4684u=-3 or yas25_4686=-3 or yas25_4682=-3 then stocks=-3;
                                                                                          
/**************assets section 8:  life insurance policies--life*****************************************/
life=-4;

if yas25_4770 in (1,2,3) then
do;
    flag_life=1;
    if yas25_4770a=1 & yas25_4770a1>=0 then life=yas25_4770a1;
    else if yas25_4770a=2 & yas25_4770bl>=0 & yas25_4770bu>=0 then
    do;
        if yas25_4770bu>=yas25_4770bl then life= (yas25_4770bu + yas25_4770bl)/2;
        else life =-3;
    end;
    if yas25_4770a not in (1,2) or yas25_4770a1 in (-1,-2) then
    do;
        if 1<=yas25_4770a2<=8 then flag_life=2;
        if yas25_4770a2=1 then life =2500;
        else if yas25_4770a2=2 then life=7500;
        else if yas25_4770a2=3 then life=17500;
        else if yas25_4770a2=4 then life=37500;
        else if yas25_4770a2=5 then life=75000;
        else if yas25_4770a2=6 then life=175000;
        else if yas25_4770a2=7 then life=375000;
        else if yas25_4770a2=8 then life=500001;
    end;
end;

if yas25_4770=-1 or yas25_4770bl=-1 or yas25_4770bu=-1 or yas25_4770a2=-1 then life=-1;
if yas25_4770=-2 or yas25_4770bl=-2 or yas25_4770bu=-2 or yas25_4770a2=-2 then life=-2;
if yas25_4770=-3 or yas25_4770bl=-3 or yas25_4770bu=-3 or yas25_4770a2=-3 or yas25_4770a1=-3 then life=-3;
    

    /************assets section 9:  vehicle ownership-pvcars********************************/

pvcars1=-4;

if yas25_4790 in (1,2,3) then
do;
    flag_pvcars1=1;
    if yas25_4810=1 & yas25_4812>=0 then pvcars1=yas25_4812;
    else if yas25_4810=2 & yas25_4814l>=0 & yas25_4814u>=0 then
    do;
        if yas25_4814u>=yas25_4814l then pvcars1=(yas25_4814l+yas25_4814u)/2;
        else pvcars1=-3;
    end;
    if yas25_4810 not in (1,2) or yas25_4812 in (-1,-2) then
    do;
        if 1<=yas25_4816<=7 then flag_pvcars1=2;
        if yas25_4816=1 then pvcars1=2500;
        else if yas25_4816=2 then pvcars1=7500;
        else if yas25_4816=3 then pvcars1=17500;
        else if yas25_4816=4 then pvcars1=37500;
        else if yas25_4816=5 then pvcars1=75000;
        else if yas25_4816=6 then pvcars1=175000;
        else if yas25_4816=7 then pvcars1=250001;
    end;
end;
if yas25_4790=-1 or yas25_4814l=-1 or yas25_4814u=-1 or yas25_4816=-1 then pvcars1=-1;
if yas25_4790=-2 or yas25_4814l=-2 or yas25_4814u=-2 or yas25_4816=-2 then pvcars1=-2;
if yas25_4790=-3 or yas25_4814l=-3 or yas25_4814u=-3 or yas25_4816=-3 or yas25_4812=-3 then pvcars1=-3;

                   
    /************assets section 9.2:  secondary source of info on vehicle ownership, pvcars2 ********************************/

pvcars2=-4;
if yas25_4000s8 =1 then
do;
    flag_pvcars2=1;
    if yas25_4000s9 =1 and yas25_4000s9a>=0 then pvcars2= yas25_4000s9a;
    else if yas25_4000s9 = 2 and yas25_4000s9bl>=0 and yas25_4000s9bu>=0 then
    do;
        if yas25_4000s9bu>= yas25_4000s9bl then pvcars2=(yas25_4000s9bu+yas25_4000s9bl)/2;
        else pvcars2=-3;
    end;
    if yas25_4000s9 not in (1,2) or yas25_4000s9a in (-1,-2) then
    do;
        if 1<= yas25_4000s9c <=8 then flag_pvcars2=2;
        if yas25_4000s9c=1 then pvcars2     =   500;
        else if yas25_4000s9c=2 then pvcars2=  1750;
        else if yas25_4000s9c=3 then pvcars2=  3750;
        else if yas25_4000s9c=4 then pvcars2=  7500;
        else if yas25_4000s9c=5 then pvcars2= 17500;
        else if yas25_4000s9c=6 then pvcars2= 37500;
        else if yas25_4000s9c=7 then pvcars2= 75000;
        else if yas25_4000s9c=8 then pvcars2= 100001;
    end;
end;

if yas25_4000s8=-1 or yas25_4000s9bl=-1 or yas25_4000s9bu=-1 or yas25_4000s9c=-1 then pvcars2=-1;
if yas25_4000s8=-2 or yas25_4000s9bl=-2 or yas25_4000s9bu=-2 or yas25_4000s9c=-2 then pvcars2=-2;
if yas25_4000s8=-3 or yas25_4000s9bl=-3 or yas25_4000s9bu=-3 or yas25_4000s9c=-3 then pvcars2=-3;
                                                          
  /*********************assets section 10:  furniture value--pvfurn***************************************************/
                       
pvfurn=-4;

if  yas25_4870>-4 then flag_pvfurn=1;
if yas25_4870=1 then pvfurn=2500;
else if yas25_4870=2 then pvfurn=7500;
else if yas25_4870=3 then pvfurn=17500;
else if yas25_4870=4 then pvfurn=37500;
else if yas25_4870=5 then pvfurn=75000;
else if yas25_4870=6 then pvfurn=175000;
else if yas25_4870=7 then pvfurn=250001;
else if yas25_4870=8 then pvfurn=0;
else if yas25_4870=-1 then pvfurn=-1;
else if yas25_4870=-2 then pvfurn=-2;
else if yas25_4870=-3 then pvfurn=-3;

/***********************assets section 11:  other assets-othsav***************************************/

othsav=-4;

if yas25_4880 in (1,2,3) then
do;
    flag_othsav=1;
    if yas25_4900=1 & yas25_4902>=0  then othsav=yas25_4902;
    else if yas25_4900=2 & yas25_4904l>=0 & yas25_4904u>=0 then
    do;
        if yas25_4904u>=yas25_4904l then othsav=(yas25_4904u+yas25_4904l)/2;
        else othsav=-3;
    end;
    if yas25_4900 not in (1,2) or yas25_4902 in (-1,-2) then
    do;
        if 1<=yas25_4906<=7 then flag_othsav=2;
        if yas25_4906=1 then othsav=2500;
        else if yas25_4906=2 then othsav=7500;
        else if yas25_4906=3 then othsav=17500;
        else if yas25_4906=4 then othsav=37500;
        else if yas25_4906=5 then othsav=75000;
        else if yas25_4906=6 then othsav=175000;
        else if yas25_4906=7 then othsav=250001;
    end;
end;

if yas25_4880=-1 or yas25_4904l=-1 or yas25_4904u=-1 or yas25_4906=-1 then othsav=-1;
if yas25_4880=-2 or yas25_4904l=-2 or yas25_4904u=-2 or yas25_4906=-2 then othsav=-2;
if yas25_4880=-3 or yas25_4904l=-3 or yas25_4904u=-3 or yas25_4906=-3 or yas25_4902=-3 then othsav=-3;
                               
/***************assets section 12: outstanding loans-loans****************************************/

loans=-4;

if yas25_4300 in (1,2,3) then
do;
    flag_loans=1;
    if yas25_4300a=1 & yas25_4300a1>=0 then loans=yas25_4300a1;
    else if yas25_4300a=2 & yas25_4300bl>=0 & yas25_4300bu>=0 then
    do;
        if yas25_4300bu>=yas25_4300bl then loans=(yas25_4300bu+yas25_4300bl)/2;
        else loans=-3;
    end;
    if yas25_4300a not in (1,2) or yas25_4300a1 in (-1,-2) then
    do;
        if 1<=yas25_4300a2<=7 then flag_loans=2;
        if yas25_4300a2=1 then loans=2500;
        else if yas25_4300a2=2 then loans=7500;
        else if yas25_4300a2=3 then loans=17500;
        else if yas25_4300a2=4 then loans=37500;
        else if yas25_4300a2=5 then loans=75000;
        else if yas25_4300a2=6 then loans=175000;
        else if yas25_4300a2=7 then loans=250001;
    end;
end;

if yas25_4300=-1 or yas25_4300a2=-1 or yas25_4300bl=-1 or yas25_4300bu=-1 then loans=-1;
if yas25_4300=-2 or yas25_4300a2=-2 or yas25_4300bu=-2 or yas25_4300bu=-2 then loans=-2;
if yas25_4300=-3 or yas25_4300a2=-3 or yas25_4300bu=-3 or yas25_4300bu=-3 or yas25_4300a1=-3 then loans=-3;
                             
                     /*************************************************************;
                                 begin liabilities section
                      ************************************************************/

/********************liabilites section 1:  mortgage or land contract-mortgag************/

mortgag=-4;

if YAS_DLIMORTGAGE=1 or YAS_DLIOWN2=1 or YAS_CH1 in (1 2 3 4) then do;

    if YAS_DLIMORTGAGE=1 or YAS_CH6=1 then
    do;
        flag_mortgag=1;
        if YAS_CH7=1 & YAS_CH7A>=0 then mortgag=YAS_CH7A;
        else if YAS_CH7=2 & YAS_CH7Bl>=0 & YAS_CH7bu>=0 then
        do;
            if YAS_CH7bu>=YAS_CH7bl then mortgag = (YAS_CH7bl+YAS_CH7bu)/2;
            else mortgag=-3;
        end;
        if YAS_CH7 not in (1,2) or YAS_CH7A in (-1,-2) then
        do;
            if 1<=YAS_CH7C<=7 then flag_mortgag=2;
            if YAS_CH7C=1 then mortgag=12500;
            else if YAS_CH7C=2 then mortgag=37500;
            else if YAS_CH7C=3 then mortgag=75000;
            else if YAS_CH7C=4 then mortgag=175000;
            else if YAS_CH7C=5 then mortgag=375000;
            else if YAS_CH7C=6 then mortgag=750000;
            else if YAS_CH7C=7 then mortgag=1000001;
        end;
    end;    
end;

if yas_ch1 in (-1 -2 -3) or yas_ch6 in (-1 -2 -3) or YAS_CH7bl in (-1 -2 -3) or YAS_CH7bu in (-1 -2 -3) or YAS_CH7c in (-1 -2 -3) then mortgag=-3;    
     
 /********************liabilities section 2:  family mortgage debt-resdebt***********************/
 
resdebt=-4;

if YAS_DLIMORTGAGE=1 or YAS_DLIOWN2=1 or YAS_CH1 in (1 2 3 4) then resdebt=-3;
if yas_ch1 in (-1 -2 -3) then resdebt=-3;
                                        
  /***********************liabilities section 3:  second mortgage-othmort****************/
         
othmort=-4;

if YAS_DLIMORTGAGE=1 or YAS_DLIOWN2=1 or YAS_CH1 in (1 2 3 4) then do;
    if YAS_CH8=1 then
    do;
        flag_othmort=1;
        if YAS_CH8_1=1 & YAS_CH8A>=0 then othmort=YAS_CH8A;
        else if YAS_CH8_1=2 & YAS_CH8bu>=0 & YAS_CH8bl>=0 then
        do;
            if YAS_CH8bu>=YAS_CH8bl then othmort=(YAS_CH8bu + YAS_CH8bl)/2;
            else othmort=-3;
        end;             
        if YAS_CH8_1 not in (1,2) or YAS_CH8A in (-1,-2) then
        do;
            if 1<=YAS_CH8c<=7 then flag_othmort=2;
            if YAS_CH8c=1 then othmort=12500;
            else if YAS_CH8c=2 then othmort=37500;
            else if YAS_CH8c=3 then othmort=75000;
            else if YAS_CH8c=4 then othmort=175000;
            else if YAS_CH8c=5 then othmort=375000;
            else if YAS_CH8c=6 then othmort=750000;
            else if YAS_CH8c=7 then othmort=1000001;
        end;        
    end;
end;
if yas_ch1 in (-1 -2 -3) or YAS_CH8 in (-1 -2 -3) or YAS_CH8bl in (-1 -2 -3) or YAS_CH8bu in (-1 -2 -3) or YAS_CH8c in (-1 -2 -3) then othmort=-3;

if yas25_new1 ne 1 then do ;
    mortgag=-4;
    resdebt=-4;
    othmort=-4;
end;    
                             
/*************liabilities section 4:  car debt-cardebt1*********************************/

cardebt1=-4;

if yas25_4840 > -4 then
do;
    flag_cardebt1=1;
    if yas25_4840=1 & yas25_4842>=0 then cardebt1=yas25_4842;
    if yas25_4840=2 and yas25_4844l >=0 and yas25_4844u >=0 then
    do;
        if yas25_4844u>= yas25_4844l then cardebt1=(yas25_4844u+ yas25_4844l)/2;
        else cardebt1=-3;
    end;
    if yas25_4840 not in (1,2) or yas25_4842 in (-1, -2) then
    do;
        if 1 <=yas25_4846<=7 then flag_cardebt1=2;
        if yas25_4846=1 then cardebt1=2500;
        else if yas25_4846=2 then cardebt1=7500;
        else if yas25_4846=3 then cardebt1=17500;
        else if yas25_4846=4 then cardebt1=37500;
        else if yas25_4846=5 then cardebt1=75000;
        else if yas25_4846=6 then cardebt1=175000;
        else if yas25_4846=7 then cardebt1=250001;
    end;
end;

    if yas25_4790=-1 or  yas25_4844l=-1 or yas25_4844u=-1 or yas25_4846=-1 then cardebt1=-1;
    if yas25_4790=-2 or  yas25_4844l=-2 or yas25_4844u=-2 or yas25_4846=-2 then cardebt1=-2;
    if yas25_4790=-3 or  yas25_4844l=-3 or yas25_4844u=-3 or yas25_4846=-3 or yas25_4842=-3 then cardebt1=-3;

                 
 /***************************************************************************;
     liabilities section 4.2: secondary info source for car debt --cardebt2
  **************************************************************************/
cardebt2=-4;
if yas25_4000s8 =1 then
do;
    flag_cardebt2=1;
    if yas25_4000s10 =1 and yas25_4000s10a>=0 then cardebt2= yas25_4000s10a;
    else if yas25_4000s10 = 2 and yas25_4000s10bl>=0 and yas25_4000s10bu>=0 then
    do;
        if yas25_4000s10bu>= yas25_4000s10bl then cardebt2=(yas25_4000s10bu+yas25_4000s10bl)/2;
        else cardebt2=-3;
    end;
    if yas25_4000s10 not in (1,2) or yas25_4000s10a in (-1,-2) then
    do;
        if 1<= yas25_4000s10c <=8 then flag_cardebt2=2;
        if yas25_4000s10c=1 then      cardebt2=   500;
        else if yas25_4000s10c=2 then cardebt2=  1750;
        else if yas25_4000s10c=3 then cardebt2=  3750;
        else if yas25_4000s10c=4 then cardebt2=  7500;
        else if yas25_4000s10c=5 then cardebt2= 17500;
        else if yas25_4000s10c=6 then cardebt2= 37500;
        else if yas25_4000s10c=7 then cardebt2= 75000;
        else if yas25_4000s10c=8 then cardebt2= 100001;
    end;
end;

if yas25_4000s8=-1 or yas25_4000s10bl=-1 or yas25_4000s10bu=-1 or yas25_4000s10c=-1 then cardebt2=-1;
if yas25_4000s8=-2 or yas25_4000s10bl=-2 or yas25_4000s10bu=-2 or yas25_4000s10c=-2 then cardebt2=-2;
if yas25_4000s8=-3 or yas25_4000s10bl=-3 or yas25_4000s10bu=-3 or yas25_4000s10c=-3 then cardebt2=-3;
                                   
       /*********************liabilities section 5: personal education loan-famedudebt****************/
       
famedudebt=-4;

if yas25_5011=1 then
do;
    flag_famedudebt=1;
    if yas25_5011a=1 & yas25_5012>=0 then famedudebt=yas25_5012;
    else if yas25_5011a=2 &  yas25_5013l>=0 & yas25_5013u>=0  then
    do;
        if yas25_5013u>=yas25_5013l then famedudebt=(yas25_5013l+yas25_5013u)/2;  
        else famedudebt=-3;
    end;
    if yas25_5011a not in (1,2) or yas25_5012 in (-1,-2) then
    do;
        if 1<=yas25_5014<=8 then flag_famedudebt=2;
        if yas25_5014=1 then famedudebt=500;
        else if yas25_5014=2 then famedudebt=1750;
        else if yas25_5014=3 then famedudebt=3750;
        else if yas25_5014=4 then famedudebt=7500;
        else if yas25_5014=5 then famedudebt=17500;
        else if yas25_5014=6 then famedudebt=37500;
        else if yas25_5014=7 then famedudebt=75000;
        else if yas25_5014=8 then famedudebt=100001;
    end;
end;

if yas25_5011=-1 or yas25_5013u=-1 or yas25_5013l=-1 or yas25_5014=-1 then famedudebt=-1;
if yas25_5011=-2 or yas25_5013u=-2 or yas25_5013l=-2 or yas25_5014=-2 then famedudebt=-2;
if yas25_5011=-3 or yas25_5013u=-3 or yas25_5013l=-3 or yas25_5014=-3 or yas25_5012=-3 then famedudebt=-3;

**XA added in June 2012;
if YAS25_NEW1=1 & famedudebt=-4 & famedudebt_c ne 0 then do;
   flag_famedudebt_c=1;
   famedudebt=famedudebt_c;
end;
                                                                                                             
   /****************liabilities section 6:  government education loan-govdebt***************/
   
govdebt=-4;

if yas25_5015=1 then
do;
    flag_govdebt=1;
    if yas25_5015a=1 & yas25_5016>=0 then govdebt=yas25_5016;
    else if yas25_5015a=2 & yas25_5017u>=0 & yas25_5017l>=0 then
    do;
        if yas25_5017u>=yas25_5017l then govdebt=(yas25_5017u + yas25_5017l)/2;
        else govdebt=-3;
    end;
    if yas25_5015a not in (1,2) or yas25_5016 in (-1,-2) then
    do;
        if 1<=yas25_5018<=8 then flag_govdebt=2;
        if yas25_5018=1 then govdebt=500;
        else if yas25_5018=2 then govdebt =1750;
        else if yas25_5018=3 then govdebt=3750;
        else if yas25_5018=4 then govdebt=7500;
        else if yas25_5018=5 then govdebt=17500;
        else if yas25_5018=6 then govdebt=37500;
        else if yas25_5018=7 then govdebt=75000;
        else if yas25_5018=8 then govdebt=100001;
    end;
end;

if yas25_5015=-1 or yas25_5017u=-1 or yas25_5017l=-1 or yas25_5018=-1 then govdebt=-1;
if yas25_5015=-2 or yas25_5017u=-2 or yas25_5017l=-2 or yas25_5018=-2 then govdebt=-2;
if yas25_5015=-3 or yas25_5017u=-3 or yas25_5017l=-3 or yas25_5018=-3 or yas25_5016=-3 then govdebt=-3;

**XA added in June 2012;
if YAS25_NEW1=1 & govdebt=-4 & govdebt_c ne 0 then do;
   flag_govdebt_c=1;
   govdebt=govdebt_c;
end;
                                                                                                                                                    
      /**********************liabilities section 7:  other debt to family or relatives--famdebt***********/
      
array famdebt (20) famdebt01-famdebt20;
array yas25_5170  (20) yas25_5170_01 - yas25_5170_20;
array yas25_5172  (20) yas25_5172_01 - yas25_5172_20;
array yas25_5174l (20) yas25_5174l_01- yas25_5174l_20;
array yas25_5174u (20) yas25_5174u_01- yas25_5174u_20;
array yas25_5176  (20) yas25_5176_01 - yas25_5176_20;
                                             
do i=1 to 20;
    famdebt(i)=-4;
    if yas25_5130=1 then
    do;
        flag_famdebt=1;
        if yas25_5170(i)=1 & yas25_5172(i)>=0 then famdebt(i)=yas25_5172(i);
        else if yas25_5170(i)=2 & yas25_5174L(i)>=0 & yas25_5174U(i)>=0 then
        do;
            if yas25_5174U(i)>=yas25_5174L(i) then famdebt(i) = (yas25_5174U(i)+yas25_5174L(i))/2;
            else famdebt(i)=-3;
        end;
        if yas25_5170(i) not in (1,2) or yas25_5172(i) in (-1, -2) then
        do;
            if 1<=yas25_5176(i)<=7 then Flag_famdebt=2;
            if yas25_5176(i)=1 then famdebt(i)=500;
            else if yas25_5176(i)=2 then famdebt(i)=1750;
            else if yas25_5176(i)=3 then famdebt(i)=3750;
            else if yas25_5176(i)=4 then famdebt(i)=7500;
            else if yas25_5176(i)=5 then famdebt(i)=17500;
            else if yas25_5176(i)=6 then famdebt(i)=37500;
            else if yas25_5176(i)=7 then famdebt(i)=50001;
        end;
    end;
    if yas25_5130=-1 or yas25_5176(i)=-1 or yas25_5174L(i)=-1 or yas25_5174U(i)=-1 then famdebt(i)=-1;
    if yas25_5130=-2 or yas25_5176(i)=-2 or yas25_5174L(i)=-2 or yas25_5174U(i)=-2 then famdebt(i)=-2;        
    if yas25_5130=-3 or yas25_5176(i)=-3 or yas25_5174L(i)=-3 or yas25_5174U(i)=-3 or yas25_5172(i)=-3 then famdebt(i)=-3;
end;                                                                      
     
                
 /*****************liabilities section 7.2: second branch of 'other debt to family or relatives'--famdebt2***********/

array famdebt2 (20) famdebt201-famdebt220;
array yas25_5080  (20) yas25_5080_01 - yas25_5080_20;
array yas25_5082  (20) yas25_5082_01 - yas25_5082_20;
array yas25_5084l (20) yas25_5084l_01- yas25_5084l_20;
array yas25_5084u (20) yas25_5084u_01- yas25_5084u_20;
array yas25_5086  (20) yas25_5086_01 - yas25_5086_20;
                                             
do i=1 to 20;
    famdebt2(i)=-4;
    if yas25_5040=1 then
    do;
        Flag_famdebt2=1;
        if yas25_5080(i)=1 & yas25_5082(i)>=0 then famdebt2(i)=yas25_5082(i);
        else if yas25_5080(i)=2 & yas25_5084L(i)>=0 & yas25_5084U(i)>=0 then
        do;
            if yas25_5084U(i)>=yas25_5084L(i) then famdebt2(i) = (yas25_5084U(i)+yas25_5084L(i))/2;
            else famdebt2(i)=-3;
        end;
        if yas25_5080(i) not in (1,2) or yas25_5082(i) in (-1, -2) then
        do;
            if 1<=yas25_5086(i)<=7 then Flag_famdebt2=2;
            if yas25_5086(i)=1 then famdebt2(i)=500;
            else if yas25_5086(i)=2 then famdebt2(i)=1750;
            else if yas25_5086(i)=3 then famdebt2(i)=3750;
            else if yas25_5086(i)=4 then famdebt2(i)=7500;
            else if yas25_5086(i)=5 then famdebt2(i)=17500;
            else if yas25_5086(i)=6 then famdebt2(i)=37500;
            else if yas25_5086(i)=7 then famdebt2(i)=50001;
        end;
    end;
    if yas25_5040=-1 or yas25_5086(i)=-1 or yas25_5084L(i)=-1 or yas25_5084U(i)=-1 then famdebt2(i)=-1;
    if yas25_5040=-2 or yas25_5086(i)=-2 or yas25_5084L(i)=-2 or yas25_5084U(i)=-2 then famdebt2(i)=-2;        
    if yas25_5040=-3 or yas25_5086(i)=-3 or yas25_5084L(i)=-3 or yas25_5084U(i)=-3 or yas25_5082(i)=-3 then famdebt2(i)=-3;
end;                                                                      
                 

  /*************************liabilities section 8:  other debt--othdebt**************/
 
othdebt1=-4;
othdebt2=-4;
othdebt3=-4;

/*othdebt1--credit card debt or debt from bank accoutns*/
if yas25_5210a=1 then
do;
    flag_othdebt1=1;
    if yas25_5210a1=1 & yas25_5210a2>=0 then othdebt1=yas25_5210a2;
    else if yas25_5210a1=2 & yas25_5210a3u>=0 & yas25_5210a3l>=0 then
    do;
        if yas25_5210a3u>=yas25_5210a3l then othdebt1= (yas25_5210a3u + yas25_5210a3l)/2;
        else othdebt1=-3;
    end;
    if yas25_5210a1 not in (1,2) or yas25_5210a2 in (-1,-2) then
    do;
        if 1<=yas25_5210a4<=8 then flag_othdebt1=2;
        if yas25_5210a4=1 then othdebt1=500;
        else if yas25_5210a4=2 then othdebt1=1750;
        else if yas25_5210a4=3 then othdebt1=3750;
        else if yas25_5210a4=4 then othdebt1=7500;
        else if yas25_5210a4=5 then othdebt1=17500;
        else if yas25_5210a4=6 then othdebt1=37500;
        else if yas25_5210a4=7 then othdebt1=75000;
        else if yas25_5210a4=8 then othdebt1=100001;
    end;
end;
if yas25_5210a =-1 or yas25_5210a3u=-1 or yas25_5210a3l=-1 or yas25_5210a4=-1 then othdebt1=-1;
if yas25_5210a =-2 or yas25_5210a3u=-2 or yas25_5210a3l=-2 or yas25_5210a4=-2 then othdebt1=-2;
if yas25_5210a =-3 or yas25_5210a3u=-3 or yas25_5210a3l=-3 or yas25_5210a4=-3 or yas25_5210a2=-3 then othdebt1=-3;

/*othdebt2--any other account type of debt*/
if yas25_5210b1=1 then
do;
    flag_othdebt2=1;
    if yas25_5210c1=1 & yas25_5210c2>=0 then othdebt2=yas25_5210c2;
    if yas25_5210c1 not in (1,2) or yas25_5210c2 in (-1, -2) then
    do;
        if 1<=yas25_5210c4<=7 then flag_othdebt2=2;
        if yas25_5210c4=1 then othdebt2=500;
        else if yas25_5210c4=2 then othdebt2=1750;
        else if yas25_5210c4=3 then othdebt2=3750;
        else if yas25_5210c4=4 then othdebt2=7500;
        else if yas25_5210c4=5 then othdebt2=17500;
        else if yas25_5210c4=6 then othdebt2=37500;
        else if yas25_5210c4=7 then othdebt2=50001;
    end;
end;
if yas25_5210b1=-1 or yas25_5210c3u=-1 or yas25_5210c3l=-1 or yas25_5210c4=-1 then othdebt2=-1;
if yas25_5210b1=-2 or yas25_5210c3u=-2 or yas25_5210c3l=-2 or yas25_5210c4=-2 then othdebt2=-1;
if yas25_5210b1=-3 or yas25_5210c3u=-3 or yas25_5210c3l=-3 or yas25_5210c4=-3 or yas25_5210c2=-3 then othdebt2=-3;

/*othdebt3-owes money to a business*/
if yas25_5210d1=1 then
do;
    flag_othdebt3=1;
    if yas25_5210d1a=1 & yas25_5210d2>=0 then othdebt3=yas25_5210d2;
    else if yas25_5210d1a=2 & yas25_5210d3l>=0 & yas25_5210d3u>=0 then
    do;
        if yas25_5210d3u>=yas25_5210d3l then othdebt3 = (yas25_5210d3l+yas25_5210d3u)/2;
        else othdebt3=-3;
    end;
    if yas25_5210d1a not in (1,2) or yas25_5210d2 in (-1,-2) then
    do;
        if 1<=yas25_5210d4<=7 then flag_othdebt3=2;
        if yas25_5210d4=1 then othdebt3=500;
        else if yas25_5210d4=2 then othdebt3=1750;
        else if yas25_5210d4=3 then othdebt3=3750;
        else if yas25_5210d4=4 then othdebt3=7500;
        else if yas25_5210d4=5 then othdebt3=17500;
        else if yas25_5210d4=6 then othdebt3=37500;
        else if yas25_5210d4=7 then othdebt3=50001;
    end;
end;
if yas25_5210d1=-1 or yas25_5210d3l=-1 or yas25_5210d3u=-1 or yas25_5210d4=-1 then othdebt3=-1;
if yas25_5210d1=-2 or yas25_5210d3l=-2 or yas25_5210d3u=-2 or yas25_5210d4=-2 then othdebt3=-2;
if yas25_5210d1=-3 or yas25_5210d3l=-3 or yas25_5210d3u=-3 or yas25_5210d4=-3 or yas25_5210d2=-3 then othdebt3=-3;
    

               /************************************************************************************
                               end of data cleaning for liabilities and assets
                                         begin calculations:
              **********************************************************************************/

array varsasst (*) house_value pvbuss_01 pvbuss_02 pvbuss_03 life othreal
                   retdsav banksav bonds stocks pvcars1 pvcars2 pvfurn  othsav loans;  

array varsliab (*) mortgag resdebt othmort cardebt1 cardebt2 famedudebt govdebt othdebt1 othdebt3 othdebt2
                   famdebt01-famdebt20 famdebt201-famdebt220;                      

array flgsasst (*) flag_house      
                   flag_pvbuss flag_life flag_othreal flag_retdsav flag_banksav flag_bonds  
                   flag_stocks  flag_pvcars1 flag_pvcars2 flag_pvfurn  flag_othsav flag_loans;

array flgsliab (*) flag_mortgag flag_resdebt flag_othmort flag_cardebt1 flag_cardebt2  flag_famedudebt flag_govdebt flag_othdebt1 flag_othdebt2 flag_othdebt3  flag_famdebt flag_famdebt2;
            
array ahousedebt (*) mortgag resdebt othmort;

array afinance (*) retdsav banksav bonds stocks othsav life loans;

array anonfinance (*) othreal pvcars1 pvcars2 pvfurn pvbuss_01 pvbuss_02 pvbuss_03;

array adebt (*) cardebt1 cardebt2 famedudebt govdebt othdebt1 othdebt2 othdebt3 famdebt01-famdebt20 famdebt201-famdebt220;

array flgshsdt(*) flag_mortgag flag_resdebt flag_othmort;

array flgsfin(*) flag_retdsav flag_banksav flag_bonds flag_stocks flag_othsav flag_life flag_loans;

array flgsnonfin(*) flag_othreal flag_pvcars1 flag_pvcars2 flag_pvfurn flag_pvbuss;

array flgsdebt(*) flag_cardebt1 flag_cardebt2 flag_famedudebt flag_govdebt flag_othdebt1 flag_othdebt2 flag_othdebt3
                  flag_famdebt flag_famdebt2;

hhworthy=-4;
assets=-4;
liabilities=-4;
housedebt=-4;
finance=-4;
nonfinance=-4;
debt=-4;

if yas25_new1=1 then
do;

    hhworthy=0; assets=0; housedebt=0; liabilities=0; finance=0;nonfinance=0;debt=0;
    do i=1 to dim(varsasst);
        if varsasst(i) not in (-1,-2,-3,-4,-5) then assets=assets+varsasst(i);
        if varsasst(i) in (-1,-2,-3) then flagsasst=-3;
    end;
    do i=1 to dim(varsliab);
        if varsliab(i)  not in (-1,-2,-3,-4,-5) then liabilities=liabilities+varsliab(i);
        if varsliab(i) in (-1,-2,-3) then flagsliab=-3;
    end;

    hhworthy=assets-liabilities;
    
    do i=1 to dim(ahousedebt);
        if ahousedebt(i)  not in (-1,-2,-3,-4,-5) then housedebt=housedebt+ahousedebt(i);
        if ahousedebt(i) in (-1,-2,-3) then flagshsdt=-3;
    end;
    do i=1 to dim(afinance);
        if afinance(i)  not in (-1,-2,-3,-4,-5) then finance=finance+afinance(i);
        if afinance(i) in (-1,-2,-3) then flagsfin=-3;
    end;
    do i=1 to dim(anonfinance);
        if anonfinance(i)  not in (-1,-2,-3,-4,-5) then nonfinance=nonfinance+anonfinance(i);
        if anonfinance(i) in (-1,-2,-3) then flagsnonfin=-3;
    end;
    do i=1 to dim(adebt);
        if adebt(i)  not in (-1,-2,-3,-4,-5) then debt=debt+adebt(i);
        if adebt(i) in (-1,-2,-3) then flagsdebt=-3;    
    end;   

end;

if yas25_new1 in (-4, -5) then
do;
    hhworthy=-4;
    vskphhy=1;
end;

do i=1 to dim(varsasst);
    if varsasst(i)=-1 then
    do;
        hhworthy=-1;
        assets=-1;
        invskphhy=1;
    end;
end;

do i=1 to dim(varsliab);
    if varsliab(i)=-1 then
    do;
        hhworthy=-1;
        liabilities=-1;
        invskphhy=1;
    end;
end;

do i=1 to dim(varsasst);
    if varsasst(i)=-2 then
    do;
        hhworthy=-2;
        assets=-2;
        invskphhy=2;
    end;
end;

do i=1 to dim(varsliab);
    if varsliab(i)=-2 then
    do;
        hhworthy=-2;
        liabilities=-2;
        invskphhy=2;
    end;
end;

do i=1 to dim(varsasst);
    if varsasst(i)=-3 then
    do;
        hhworthy=-3;
        assets=-3;
        invskphhy=3;
    end;
end;

do i=1 to dim(varsliab);
    if varsliab(i)=-3 then
    do;
        hhworthy=-3;
        liabilities=-3;
        invskphhy=3;
    end;
end;

do i=1 to dim(ahousedebt);
    if ahousedebt(i)=-1 then housedebt=-1;
    else if ahousedebt(i)=-2 then housedebt=-2;
    else if ahousedebt(i)=-3 then housedebt=-3;
end;

do i=1 to dim(afinance);
    if afinance(i)=-1 then finance=-1;
    else if afinance(i)=-2 then finance=-2;
    else if afinance(i)=-3 then finance=-3;
end;

do i=1 to dim(anonfinance);
    if anonfinance(i)=-1 then nonfinance=-1;
    else if anonfinance(i)=-2 then nonfinance=-2;
    else if anonfinance(i)=-3 then nonfinance=-3;
end;

do i=1 to dim(adebt);
    if adebt(i)=-1 then debt=-1;
    else if adebt(i)=-2 then debt=-2;
    else if adebt(i)=-3 then debt=-3;
end;

hhworthy=round(hhworthy,1);
assets=round(assets,1);
liabilities=round(liabilities,1);
housedebt=round(housedebt,1);
house_value=round(house_value,1);
finance=round(finance,1);
nonfinance=round(nonfinance,1);
debt=round(debt,1);

/************* change all the -1s, -2s to -3s. ***************/

array finalv(*) hhworthy assets liabilities housedebt house_value finance nonfinance debt;
do i=1 to dim(finalv);
    if finalv(i) in (-1,-2) then finalv(i)=-3;
end;
run;

/* Collapse r14 asset 25 CV variables with r13 CVC

Name of r14 CVC to be created Name of Prev Rd CVC in the 'gator
Name of the current rd variable
hhworthY_cvc CVC_HH_NET_WORTH_25 hhworthY
house_value_cvc CVC_HOUSE_VALUE_25 house_value
housedebt_cvc CVC_HOUSE_DEBT_25 housedebt
housing_type_cvc CVC_HOUSE_TYPE_25 housing_type
finance_cvc CVC_ASSETS_FINANCIAL_25 finance
nonfinance_cvc CVC_ASSETS_NONFINANCIAL_25 nonfinance
debt_cvc CVC_ASSETS_DEBTS_25 debt
assetrd_cvc CVC_ASSETS_RND_25  

*/                                                                                                            

data two; set asset14.ast25R13_cvc;
 
data three; merge one two; by pubid;

    array cvprevrd(7)
    CVC_HH_NET_WORTH_25     CVC_HOUSE_VALUE_25         CVC_HOUSE_DEBT_25     CVC_HOUSE_TYPE_25
    CVC_ASSETS_FINANCIAL_25 CVC_ASSETS_NONFINANCIAL_25 CVC_ASSETS_DEBTS_25;      
    do i=1 to dim(cvprevrd);                                                                                           
        if cvprevrd(i) ~=-4  then cvpreval=1;
    end;

    array curr(7)
    hhworthY           house_value        housedebt          housing_type       finance
    nonfinance         debt          ;
    do i=1 to dim(curr);                                                                                           
        if curr(i) not in (-4,-5,.) then currval=1;
    end;

    assetrd_cvc=-4 ;
    array cvc(7)
    hhworthY_cvc       house_value_cvc    housedebt_cvc    housing_type_cvc       
    finance_cvc         nonfinance_cvc     debt_cvc    ;
    /* Initiate the value to -4 */
    do i = 1 to dim(cvc);
        cvc(i)=-4;
    end;

    if cvpreval =1 & CVC_ASSETS_RND_25 not in (9,10,11,12,13) then flag1=1;
    if cvpreval =1 & currval=1 then flag2=1;
    if currval=1 & CVC_ASSETS_RND_25 in (9,10,11,12,13) then flag3=1;
    
    if cvpreval =1 & CVC_ASSETS_RND_25 in (9,10,11,12,13) & currval~=1 then do i = 1 to 7 ;
        assetrd_cvc= CVC_ASSETS_RND_25;
        cvc(i)=cvprevrd(i);
    end;    
    if cvpreval ~=1 & CVC_ASSETS_RND_25 not in (9,10,11,12,13) & currval=1 then do  i = 1 to 7 ;
        assetrd_cvc=14;
        cvc(i)=curr(i);
    end;
    
    
    /* Top coding. (There is no bottom coding.) */

    if hhworthY_cvc ge 600000 then hhworthY_cvc=600000;
    if house_value_cvc ge 425000 then house_value_cvc=425000;
    if housedebt_cvc ge 325000 then housedebt_cvc=325000;
    if finance_cvc ge 300000 then finance_cvc=300000;
    if nonfinance_cvc ge 600000 then nonfinance_cvc=600000;
    if debt_cvc ge 370000 then debt_cvc=370000;
endsas;