-------------
      name:  <unnamed>
       log:  /Users/robertyaffee/Documents/data/research/chwk/phase4/datasearch/medservvars.smcl
  log type:  smcl
 opened on:  21 Mar 2013, 18:26:17

.
.
. cd /Users/robertyaffee/Documents/data/research/chwk/phase4/datasearch
/Users/robertyaffee/Documents/data/research/chwk/phase4/datasearch

.
.
.
.
. // these mhin and mhout variables are more than 95% missing which does not
. // appear to be correct on the face of it because these were
. // important to testing the hypothesis regarding medical service
. // utilization
.
.
. * contemporary wide file
.
. use chwide1feb2013, clear
(Chornobyl sequelae for both sexes   women=362  men = 340 wide format)

. di c(current_date)
21 Mar 2013

. di c(pwd)
/Users/robertyaffee/Documents/data/research/chwk/phase4/datasearch

. di c(filename)
chwide1feb2013.dta

.
. forvalues i = 1/3 {
  2. des mhinw`i'
  3. tab mhinw`i', missing
  4. des mhoutw`i'
  5. tab mhoutw`i', missing
  6. }

              storage  display     value
variable name   type   format      label      variable label
-------------


mhinw1            byte     %8.0g                    *   number of days per year as a patient in a clinic for a mental health  in 1976-19


  number of |
   days per |
  year as a |
 patient in |
   a clinic |
      for a |
     mental |
 health  in |
    1976-19 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        576       82.05       82.05
         21 |          1        0.14       82.19
         30 |          1        0.14       82.34
          . |        124       17.66      100.00
------------+-----------------------------------
      Total |        702      100.00

              storage  display     value
variable name   type   format      label      variable label
-------------


mhoutw1           byte     %8.0g                        number of medical visits  for a mental health condition per year 1976-1986


  number of |
    medical |
visits  for |
   a mental |
     health |
  condition |
   per year |
 1976-1986  |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        567       80.77       80.77
          1 |          6        0.85       81.62
          2 |          1        0.14       81.77
          4 |          1        0.14       81.91
         12 |          1        0.14       82.05
          . |        126       17.95      100.00
------------+-----------------------------------
      Total |        702      100.00

              storage  display     value
variable name   type   format      label      variable label
-------------


mhinw2            int      %8.0g                    *   number of days per year as a patient in a clinic for a mental health  in 1987-19


  number of |
   days per |
  year as a |
 patient in |
   a clinic |
      for a |
     mental |
 health  in |
    1987-19 |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        571       81.34       81.34
          2 |          2        0.28       81.62
         10 |          1        0.14       81.77
         20 |          1        0.14       81.91
         21 |          1        0.14       82.05
         40 |          1        0.14       82.19
        200 |          1        0.14       82.34
          . |        124       17.66      100.00
------------+-----------------------------------
      Total |        702      100.00

              storage  display     value
variable name   type   format      label      variable label
-------------


mhoutw2           byte     %8.0g                        number of medical visits  for a mental health condition  per year 1987-1996


  number of |
    medical |
visits  for |
   a mental |
     health |
  condition |
   per year |
 1987-1996  |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        567       80.77       80.77
          1 |          5        0.71       81.48
          2 |          4        0.57       82.05
          3 |          1        0.14       82.19
          5 |          1        0.14       82.34
         12 |          1        0.14       82.48
          . |        123       17.52      100.00
------------+-----------------------------------
      Total |        702      100.00

              storage  display     value
variable name   type   format      label      variable label
-------------


mhinw3            byte     %8.0g                    *   number of days per year as a patient in a clinic for a mental health  in 1997-no


  number of |
   days per |
  year as a |
 patient in |
   a clinic |
      for a |
     mental |
 health  in |
    1997-no |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        568       80.91       80.91
          3 |          1        0.14       81.05
          7 |          1        0.14       81.20
         14 |          2        0.28       81.48
         21 |          1        0.14       81.62
         24 |          1        0.14       81.77
         28 |          2        0.28       82.05
         30 |          1        0.14       82.19
          . |        125       17.81      100.00
------------+-----------------------------------
      Total |        702      100.00

              storage  display     value
variable name   type   format      label      variable label
-------------


mhoutw3           byte     %8.0g                        number of medical visits for a mental health condition per year 1997-now


  number of |
    medical |
 visits for |
   a mental |
     health |
  condition |
   per year |
  1997-now  |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        553       78.77       78.77
          1 |         13        1.85       80.63
          2 |          2        0.28       80.91
          3 |          4        0.57       81.48
          4 |          1        0.14       81.62
          5 |          1        0.14       81.77
         10 |          2        0.28       82.05
         12 |          1        0.14       82.19
          . |        125       17.81      100.00
------------+-----------------------------------
      Total |        702      100.00

.
.
. * extracting doctn 1980-2010 from the wide file we get
. use docvisitsphysdcmfrt30, clear
(Chornobyl sequelae for both sexes   women=362  men = 340 wide format)

. xtset id year
       panel variable:  id (strongly balanced)
        time variable:   year, 1980 to 2010
                delta:  1 unit

. sort year

.
.
.
. label var physdiscmft "Average level of physical discomfort"

. cap by year: egen MDvistavg = mean(docvisitsn)

. label var MDvistavg "Yearly average of doctors visits"

. gr bar MDvistavg, over(year)

. cap by year: egen Physdis = mean(physdiscmft)

. label var Physdis "Annual average of physical discomfort"

. xttab physdiscmft

                  Overall             Between            Within
physdis~t |    Freq.  Percent      Freq.  Percent        Percent
----------+-----------------------------------------------------
        0 |   16493     75.79       687     97.86          77.44
        1 |       4      0.02         2      0.28           6.45
        2 |      11      0.05         2      0.28          17.74
        3 |       9      0.04         3      0.43           9.68
        4 |       2      0.01         2      0.28           3.23
        5 |     295      1.36        29      4.13          32.81
        6 |       1      0.00         1      0.14           3.23
        7 |       3      0.01         3      0.43           3.23
        8 |       2      0.01         1      0.14           6.45
        9 |       2      0.01         2      0.28           3.23
       10 |    1245      5.72       184     26.21          21.83
       15 |      36      0.17         7      1.00          16.59
       20 |     959      4.41       203     28.92          15.24
       21 |       1      0.00         1      0.14           3.23
       23 |       1      0.00         1      0.14           3.23
       24 |       1      0.00         1      0.14           3.23
       25 |      25      0.11        12      1.71           6.72
       26 |       2      0.01         1      0.14           6.45
       27 |       1      0.00         1      0.14           3.23
       29 |       1      0.00         1      0.14           3.23
       30 |     800      3.68       201     28.63          12.84
       35 |       4      0.02         3      0.43           4.30
       40 |     422      1.94       136     19.37          10.01
       45 |       7      0.03         6      0.85           3.76
       46 |       1      0.00         1      0.14           3.23
       47 |       3      0.01         3      0.43           3.23
       48 |       2      0.01         2      0.28           3.23
       49 |       1      0.00         1      0.14           3.23
       50 |     635      2.92       203     28.92          10.09
       51 |       2      0.01         2      0.28           3.23
       52 |      10      0.05         1      0.14          32.26
       54 |       2      0.01         2      0.28           3.23
       55 |       1      0.00         1      0.14           3.23
       56 |       2      0.01         2      0.28           3.23
       59 |       1      0.00         1      0.14           3.23
       60 |     149      0.68        75     10.68           6.41
       70 |     111      0.51        59      8.40           6.07
       72 |       1      0.00         1      0.14           3.23
       75 |       1      0.00         1      0.14           3.23
       77 |       1      0.00         1      0.14           3.23
       79 |       1      0.00         1      0.14           3.23
       80 |     140      0.64        55      7.83           8.21
       81 |       2      0.01         2      0.28           3.23
       85 |       1      0.00         1      0.14           3.23
       86 |       1      0.00         1      0.14           3.23
       90 |      46      0.21        20      2.85           7.42
       95 |       3      0.01         1      0.14           9.68
      100 |     318      1.46        93     13.25          11.03
----------+-----------------------------------------------------
    Total |   21762    100.00      2020    287.75          34.75
                               (n = 702)

. gr bar Physdis, over(year)

. bysort year: tabstat physdiscmft , stat(mean sd n)

-------------
-> year = 1980

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  1.559829  8.442724       702
-------------+------------------------------

-------------
-> year = 1981

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  1.460114  8.229794       702
-------------+------------------------------

-------------
-> year = 1982

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |   1.42735   7.21128       702
-------------+------------------------------

-------------
-> year = 1983

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |   1.97151   9.18563       702
-------------+------------------------------

-------------
-> year = 1984

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  1.987179  8.977932       702
-------------+------------------------------

-------------
-> year = 1985

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  2.004274  8.425133       702
-------------+------------------------------

-------------
-> year = 1986

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  12.26781  26.98347       702
-------------+------------------------------

-------------
-> year = 1987

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  9.954416  23.57096       702
-------------+------------------------------

-------------
-> year = 1988

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.481481  21.15527       702
-------------+------------------------------

-------------
-> year = 1989

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |   8.04416  19.26783       702
-------------+------------------------------

-------------
-> year = 1990

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  7.931624  18.74092       702
-------------+------------------------------

-------------
-> year = 1991

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.081197  19.01101       702
-------------+------------------------------

-------------
-> year = 1992

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.460114  19.17851       702
-------------+------------------------------

-------------
-> year = 1993

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.517094   18.8435       702
-------------+------------------------------

-------------
-> year = 1994

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.545584  19.25384       702
-------------+------------------------------

-------------
-> year = 1995

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  7.307692  17.67335       702
-------------+------------------------------

-------------
-> year = 1996

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  7.803419  18.50099       702
-------------+------------------------------

-------------
-> year = 1997

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  6.797721  17.85044       702
-------------+------------------------------

-------------
-> year = 1998

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.331909  18.90096       702
-------------+------------------------------

-------------
-> year = 1999

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.230769   19.0942       702
-------------+------------------------------

-------------
-> year = 2000

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  9.782051  20.92292       702
-------------+------------------------------

-------------
-> year = 2001

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.602564  19.79056       702
-------------+------------------------------

-------------
-> year = 2002

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.964387  18.95426       702
-------------+------------------------------

-------------
-> year = 2003

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  8.753561  18.40402       702
-------------+------------------------------

-------------
-> year = 2004

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  9.353276  18.70106       702
-------------+------------------------------

-------------
-> year = 2005

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |   10.7208  21.11869       702
-------------+------------------------------

-------------
-> year = 2006

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  11.20085  21.15848       702
-------------+------------------------------

-------------
-> year = 2007

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  11.90598  20.98922       702
-------------+------------------------------

-------------
-> year = 2008

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  13.62251   22.5442       702
-------------+------------------------------

-------------
-> year = 2009

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |   14.0641   23.0413       702
-------------+------------------------------

-------------
-> year = 2010

variable   |      mean        sd         N
-------------+------------------------------
physdiscmft   |  11.31766  22.61815       702
-------------+------------------------------

. xtsum physdiscmft

Variable         |      Mean   Std. Dev.       Min        Max |    Observations
-----------------+--------------------------------------------+----------------
physdi~t overall |  7.982355    18.9722          0        100 |     N =   21762
         between |             11.11139          0   80.64516 |     n =     702
         within  |             15.38348  -72.66281   104.7565 |     T =      31

.
. tsline Physdis

. save docvisitsphysdcmfrt30, replace
file docvisitsphysdcmfrt30.dta saved

.
. * I infer that the docvisit and physdiscmt survival variables but merely have a lot of zeros
.
.
. log close
      name:  <unnamed>
       log:  /Users/robertyaffee/Documents/data/research/chwk/phase4/datasearch/medservvars.smcl
  log type:  smcl
 closed on:  21 Mar 2013, 18:26:22
-------------