-------------
      name:  <unnamed>
       log:  /Users/baum/Documents/IMFInstitute/usmacro1.smcl
  log type:  smcl
 opened on:  24 Jan 2011, 14:39:08

. clear all

. insheet using ifsQ.download.php
(5 vars, 6198 obs)

. do ifsQdata

. * This Stata 6.0 program will process a IFS (quarterly) data extract produced by the data
. * access system, saved to file 'ifsQdata.download.php3' and loaded with 'insheet',
. * reformatting the data as 'wide', with each variable in a separate column.
. * This program does not save the resulting dataset.
. * C F Baum 0110 rev 0703 for tsset
. *
. * Before running this program, you must use 'insheet using...' to
. * read the "ifsQdata.download.php3" file into Stata. If you are using
. * a desktop (Mac or Windows) version of Stata, this is most easily done
. * by using the File->Filename... command to point to the file on your disk.
. *
. * Provide concordance for series; order in this list corresponds
. * to 'var1', 'var2' etc.
. tab ncode

      ncode |      Freq.     Percent        Cum.
------------+-----------------------------------
         51 |        207        3.34        3.34
         52 |        207        3.34        6.68
         58 |        207        3.34       10.02
         73 |        207        3.34       13.36
        155 |        207        3.34       16.70
        204 |        202        3.26       19.96
        205 |         36        0.58       20.54
        220 |        202        3.26       23.80
        316 |        207        3.34       27.14
        318 |        207        3.34       30.48
        334 |        207        3.34       33.82
        335 |        158        2.55       36.37
        337 |        144        2.32       38.69
        342 |        191        3.08       41.77
        345 |        207        3.34       45.11
        347 |        207        3.34       48.45
        348 |        207        3.34       51.79
        349 |        207        3.34       55.13
        350 |        158        2.55       57.68
        351 |        207        3.34       61.02
        359 |        207        3.34       64.36
        361 |        139        2.24       66.60
        363 |        207        3.34       69.94
        369 |        207        3.34       73.28
        480 |        207        3.34       76.62
        481 |        207        3.34       79.96
        482 |        207        3.34       83.30
        483 |        207        3.34       86.64
        484 |        207        3.34       89.98
        486 |        207        3.34       93.32
        489 |        207        3.34       96.66
        492 |        207        3.34      100.00
------------+-----------------------------------
      Total |      6,198      100.00

. * Rename the data to ensure that name length limits are observed
. rename dataval var

. * Reshape the data into panel format
. reshape wide var,i(ccode year qtr) j(ncode)
(note: j = 51 52 58 73 155 204 205 220 316 318 334 335 337 342 345 347 348 349 350 351 359 361 363 369 480 481 482 483 484 486 489 492)

Data                               long   ->   wide
-----------------------------------------------------------------------------
Number of obs.                     6198   ->     207
Number of variables                   5   ->      35
j variable (32 values)            ncode   ->   (dropped)
xij variables:
                                    var   ->   var51 var52 ... var492
-----------------------------------------------------------------------------

. * Specify the i and t identifiers
. iis ccode

. gen date=yq(year,qtr)

. format date %tq

. tis date

. * describe the data as reformatted
. tsset ccode date
       panel variable:  ccode (strongly balanced)
        time variable:   date, 1959q1 to 2010q3
                delta:  1 quarter

. summ

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
       ccode |       207         111           0        111        111
        year |       207    1984.377    14.97548       1959       2010
         qtr |       207    2.492754    1.118553          1          4
       var51 |       207    54.60411    31.99002    14.8234    112.282
       var52 |       207    4.016544    2.913436   -1.62336    14.4503
-------------+--------------------------------------------------------
       var58 |       207    22.53738    21.60395       2.92    123.973
       var73 |       207    3.578331    2.375856    .192355    11.0825
      var155 |       207    339.0834    392.2569     40.615    2074.88
      var204 |       202    4231.313    4027.925    294.556    15649.5
      var205 |        36    12417.63    2234.114    9164.36    15588.1
-------------+--------------------------------------------------------
      var220 |       202    683.9681    450.8478    143.213    1487.02
      var316 |       207    686.3667    473.6018      139.6     1765.7
      var318 |       207     2827.04    2356.066      289.2     8709.1
      var334 |       207    5.737956     3.38206        .12      17.78
      var335 |       158    6.142827    3.408482        .16    16.7733
-------------+--------------------------------------------------------
      var337 |       144    5.633148    3.242065       .054    15.7767
      var342 |       191    6.557255    3.502772    .256333    18.5007
      var345 |       207    7.706555    3.194581       3.25    20.3233
      var347 |       207    6.680628     2.58984    2.73667    14.8467
      var348 |       207    6.205202    2.846842    .833333      15.79
-------------+--------------------------------------------------------
      var349 |       207    36.23329    38.05912     5.6294    128.018
      var350 |       158    46.51016    46.00487     2.9169    210.055
      var351 |       207    37.81332    40.04274    4.25073    130.258
      var359 |       207    54.09373    31.58975    12.4239    112.318
      var361 |       139    116.7296    19.92613    83.1943    179.976
-------------+--------------------------------------------------------
      var363 |       207    61.49922    24.17083    23.6933    105.448
      var369 |       207    5.961643    1.578505        3.2    11.1667
      var480 |       207    5.29e+11    5.20e+11   2.18e+10   1.93e+12
      var481 |       207    8.42e+11    7.01e+11   7.82e+10   2.50e+12
      var482 |       207    9.92e+11    8.21e+11   1.03e+11   2.74e+12
-------------+--------------------------------------------------------
      var483 |       207    1.72e+10    3.65e+10  -1.80e+11   1.27e+11
      var484 |       207    3.56e+12    3.14e+12   3.10e+11   1.04e+13
      var486 |       207    6.79e+11    7.29e+11   2.14e+10   2.69e+12
      var489 |       207    5.26e+12    4.45e+12   4.96e+11   1.48e+13
      var492 |       207    58.37399    30.45941    18.2821    111.093
-------------+--------------------------------------------------------
        date |       207          99    59.89992         -4        202

. * end of do-file; use 'save' to save the data if you wish
.
.
.
end of do-file

. drop var205

. label var var51 "CPI"

. label var var52 "CPI % CHANGE"

. label var var58 "PETROLEUM:AVERAGE CRUDE PRICE"

. label var var73 "GDP DEFLATOR % CHANGE"

. label var var155 "MONETARY BASE, SEASONALLY ADJUSTED"

. label var var204 "DOMESTIC CREDIT"

. label var var220 "MONEY, SEASONALLY ADJUSTED"

. label var var316 "M1 SEASONALLY ADJUSTED"

. label var var318 "M2 SEASONALLY ADJUSTED"

. label var var334 "FEDERAL FUNDS RATE"

. label var var335 "COMMERCIAL PAPER- 3 MONTH"

. label var var337 "T-BILL RATE-3 MNTH CONS. MAT."

. label var var342 "3-MONTH US DEP. LONDON OFFER"

. label var var345 "BANK PRIME LOAN RATE"

. label var var347 "GOVT BOND YIELD: 10 YEAR"

. label var var348 "GOVT BOND YIELD: 3 YEAR"

. label var var349 "SHARE PRICES"

. label var var350 "NASDAQ COMPOSITE"

. label var var351 "S&P INDUSTRIALS"

. label var var359 "WAGES: HOURLY EARNINGS, MFG"

. label var var361 "REER BASED ON RULC"

. label var var363 "INDUSTRIAL PRODUCTION SA"

. label var var369 "UNEMPLOYMENT RATE"

. label var var480 "EXPORTS OF GOODS AND SERVICES SA"

. label var var481 "GOVERNMENT CONSUMPTION EXPEND. SA"

. label var var482 "GROSS FIXED CAPITAL FORMATION SA"

. label var var483 "CHANGES IN INVENTORIES SA"

. label var var484 "HOUSEH.CONS.EXPEND.,INCL.NPISHS SA"

. label var var486 "IMPORTS OF GOODS AND SERVICES SA"

. label var var489 "GROSS DOMESTIC PRODUCT SA"

. label var var492 "GDP DEFLATOR (2005=100)"

. tsset date
        time variable:   date, 1959q1 to 2010q3
                delta:  1 quarter

. // correct units issues with 48x
. foreach v of varlist var48* {
  2.         replace `v' = `v'/1.0e9
  3. }
(207 real changes made)
(207 real changes made)
(207 real changes made)
(207 real changes made)
(207 real changes made)
(207 real changes made)
(207 real changes made)

. desc

Contains data
  obs:           207
 vars:            35
 size:        54,855 (99.9% of memory free)
-------------
              storage  display     value
variable name   type   format      label      variable label
-------------


ccode             int      %8.0g


year              int      %8.0g


qtr               byte     %8.0g


var51             double   %10.0g                       CPI


var52             double   %10.0g                       CPI % CHANGE


var58             double   %10.0g                       PETROLEUM:AVERAGE CRUDE PRICE


var73             double   %10.0g                       GDP DEFLATOR % CHANGE


var155            double   %10.0g                       MONETARY BASE, SEASONALLY ADJUSTED


var204            double   %10.0g                       DOMESTIC CREDIT


var220            double   %10.0g                       MONEY, SEASONALLY ADJUSTED


var316            double   %10.0g                       M1 SEASONALLY ADJUSTED


var318            double   %10.0g                       M2 SEASONALLY ADJUSTED


var334            double   %10.0g                       FEDERAL FUNDS RATE


var335            double   %10.0g                       COMMERCIAL PAPER- 3 MONTH


var337            double   %10.0g                       T-BILL RATE-3 MNTH CONS. MAT.


var342            double   %10.0g                       3-MONTH US DEP. LONDON OFFER


var345            double   %10.0g                       BANK PRIME LOAN RATE


var347            double   %10.0g                       GOVT BOND YIELD: 10 YEAR


var348            double   %10.0g                       GOVT BOND YIELD: 3 YEAR


var349            double   %10.0g                       SHARE PRICES


var350            double   %10.0g                       NASDAQ COMPOSITE


var351            double   %10.0g                       S&P INDUSTRIALS


var359            double   %10.0g                       WAGES: HOURLY EARNINGS, MFG


var361            double   %10.0g                       REER BASED ON RULC


var363            double   %10.0g                       INDUSTRIAL PRODUCTION SA


var369            double   %10.0g                       UNEMPLOYMENT RATE


var480            double   %10.0g                       EXPORTS OF GOODS AND SERVICES SA


var481            double   %10.0g                       GOVERNMENT CONSUMPTION EXPEND. SA


var482            double   %10.0g                       GROSS FIXED CAPITAL FORMATION SA


var483            double   %10.0g                       CHANGES IN INVENTORIES SA


var484            double   %10.0g                       HOUSEH.CONS.EXPEND.,INCL.NPISHS SA


var486            double   %10.0g                       IMPORTS OF GOODS AND SERVICES SA


var489            double   %10.0g                       GROSS DOMESTIC PRODUCT SA


var492            double   %10.0g                       GDP DEFLATOR (2005=100)


date              float    %tq


-------------
Sorted by:  date
     Note:  dataset has changed since last saved

. summ

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
       ccode |       207         111           0        111        111
        year |       207    1984.377    14.97548       1959       2010
         qtr |       207    2.492754    1.118553          1          4
       var51 |       207    54.60411    31.99002    14.8234    112.282
       var52 |       207    4.016544    2.913436   -1.62336    14.4503
-------------+--------------------------------------------------------
       var58 |       207    22.53738    21.60395       2.92    123.973
       var73 |       207    3.578331    2.375856    .192355    11.0825
      var155 |       207    339.0834    392.2569     40.615    2074.88
      var204 |       202    4231.313    4027.925    294.556    15649.5
      var220 |       202    683.9681    450.8478    143.213    1487.02
-------------+--------------------------------------------------------
      var316 |       207    686.3667    473.6018      139.6     1765.7
      var318 |       207     2827.04    2356.066      289.2     8709.1
      var334 |       207    5.737956     3.38206        .12      17.78
      var335 |       158    6.142827    3.408482        .16    16.7733
      var337 |       144    5.633148    3.242065       .054    15.7767
-------------+--------------------------------------------------------
      var342 |       191    6.557255    3.502772    .256333    18.5007
      var345 |       207    7.706555    3.194581       3.25    20.3233
      var347 |       207    6.680628     2.58984    2.73667    14.8467
      var348 |       207    6.205202    2.846842    .833333      15.79
      var349 |       207    36.23329    38.05912     5.6294    128.018
-------------+--------------------------------------------------------
      var350 |       158    46.51016    46.00487     2.9169    210.055
      var351 |       207    37.81332    40.04274    4.25073    130.258
      var359 |       207    54.09373    31.58975    12.4239    112.318
      var361 |       139    116.7296    19.92613    83.1943    179.976
      var363 |       207    61.49922    24.17083    23.6933    105.448
-------------+--------------------------------------------------------
      var369 |       207    5.961643    1.578505        3.2    11.1667
      var480 |       207    528.5652    519.6567       21.8     1927.3
      var481 |       207    841.8981    700.6253       78.2     2503.7
      var482 |       207    991.6319    820.5616      102.8     2737.1
      var483 |       207    17.21449    36.51636     -179.5      126.6
-------------+--------------------------------------------------------
      var484 |       207     3555.82    3138.476      310.1    10383.6
      var486 |       207    679.4237    729.1259       21.4     2690.4
      var489 |       207    5255.701    4449.525      495.5    14750.2
      var492 |       207    58.37399    30.45941    18.2821    111.093
        date |       207          99    59.89992         -4        202

.
. log close
      name:  <unnamed>
       log:  /Users/baum/Documents/IMFInstitute/usmacro1.smcl
  log type:  smcl
 closed on:  24 Jan 2011, 14:39:08
-------------