-------------
      name:  <unnamed>
       log:  E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\X_Not_for_Rachel_X\Updated_data_and_calculations\GSS\GSS_analysis_revised_November_2017.smcl
  log type:  smcl
 opened on:   1 Dec 2017, 17:21:18

. do "E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\X_Not_for_Rachel_X\Updated_data_and_calculations\GSS\GSS_analysis_revised_November_2017.do"

. **Analysis of 1993 GSS Data on Sporting Event Attendance**
. **Sean Dinces, July 2017**
.
. set more off

.
. **recode attsprts as new binary with missing = .**
. gen attendance = .
(1606 missing values generated)

. replace attendance = 0 if(attsprts == 2)
(739 real changes made)

. replace attendance = 1 if(attsprts == 1)
(855 real changes made)

. replace attendance = . if(attsprts == .d)
(0 real changes made)

. replace attendance = . if(attsprts == .n)
(0 real changes made)

. **recode family income (income91) with missing =.**
. gen faminc = income91
(139 missing values generated)

. replace faminc = . if(income91 == .a)
(139 real changes made, 139 to missing)

. label values faminc LABY

.
.
. **generate top-code using Hout (2004). There are some ambiguities/inconsistencies in Hout's notation and tables, but by following his textual instructions in combination with provided notation I did produce something that replicates his graphical results.**
. **compute top-code using formula derived from Pareto curve**
. **step 1- compute V**
. display (ln(108+160)-ln(160))/((ln(75000)-ln(60000)))
2.3115755

. gen V = (ln(108+160)-ln(160))/((ln(75000)-ln(60000)))

. **V = 2.3115755**
. **step 2- compute Pareto-derived top-code**
. display 75000 * (V/(V-1))
132183.14

. **top-code = 132183.14**
. **step 3- correct for overestimation with Pareto-derived top-code. Hout provides new formula to "reduce the gap between the result for [formula in step 2] and the lower limit of the top category [$75K] by half."**
. **NOTE!!! EQUATION [2] IN HOUT IS INCORRECT--IT SHOULD BE DIVIDED BY 2**
. display 0.5 * 75000 * (1+(V/(V-1)))
103591.57

. **adjusted top-code = 103591.57**
.
. **recode family income (income91) as continuous variable using midpoint of bands (for sensitivity tests)**
. gen inccont = faminc
(139 missing values generated)

. recode inccont (1 = 500)(2 = 1999.5)(3 = 3499.5)(4 = 4499.5)(5 = 5499.5)(6 = 6499.5)(7 = 7499.5)(8 = 8999.5)(9 = 11249.5)(10 = 13749.5)(11 = 16249.5)(12 = 18749.5)(13 = 21249.5)(14 = 23749.5)(15 = 27499.5)(16 = 32499.5)(17 = 37499.5)(18 = 44999.5)(19 = 54999.5)(20 = 67499.5)(21 = 103591.57)
(inccont: 1467 changes made)

.
. **generate per-capita income variable**
. generate percinc = inccont/hompop
(139 missing values generated)

.
. **recode missing values for education**
. replace educ = . if(educ == .d)
(4 real changes made, 4 to missing)

.
. **recode age to exclude missing**
. recode age (.n = .)
(age: 5 changes made)

.
. **generate age bands**
. generate age1 = .
(1606 missing values generated)

. replace age1 = 1 if(age <= 24)
(137 real changes made)

. replace age1 = 0 if(age >= 25)
(1469 real changes made)

. generate age2 = .
(1606 missing values generated)

. replace age2 = 1 if(age >= 25 & age <= 44)
(725 real changes made)

. replace age2 = 0 if(age <= 24)
(137 real changes made)

. replace age2 = 0 if(age >= 45)
(744 real changes made)

. generate age3 = .
(1606 missing values generated)

. replace age3 = 1 if(age >= 45 & age <= 64)
(437 real changes made)

. replace age3 = 0 if(age <= 44)
(862 real changes made)

. replace age3 = 0 if(age >= 65)
(307 real changes made)

. generate age4 = .
(1606 missing values generated)

. replace age4 = 1 if(age >= 65)
(307 real changes made)

. replace age4 = 0 if(age <= 64)
(1299 real changes made)

.
. **generate limiting variables for sample**
. generate goodinc = 1 if(attendance != . &  faminc != . & inccont != .)
(142 missing values generated)

. generate goodeduc = 1 if(attendance != . & educ != . & age != .)
(20 missing values generated)

.
. **basic descriptives for income regression**
. **household-level variables(unweighted since GSS household-level variables are self-weighting)**
. tabstat inccont if goodinc == 1, statistics(n, mean, sd, min, max)

variable   |         N      mean        sd       min       max
-------------+--------------------------------------------------
inccont   |      1464  37425.49  29201.47       500  103591.6
-------------+--------------------------------------------------

. tabstat hompop if goodinc == 1, statistics(n, mean, sd, min, max)

variable   |         N      mean        sd       min       max
-------------+--------------------------------------------------
hompop   |      1464  2.598361  1.358962         1         9
-------------+--------------------------------------------------

. tabstat percinc if goodinc == 1, statistics(n, mean, sd, min, max)

variable   |         N      mean        sd       min       max
-------------+--------------------------------------------------
percinc   |      1464  16753.86  14526.84       125  103591.6
-------------+--------------------------------------------------

. **individual-level**
. tabstat attendance if goodinc == 1 [aweight=adults], statistics(n, mean, sd, min, max)

variable   |         N      mean        sd       min       max
-------------+--------------------------------------------------
attendance   |      1464  .5742216  .4946294         0         1
-------------+--------------------------------------------------

. **basic descriptives for education regression**
. **individual-level**
. tabstat attendance educ if goodeduc == 1 & age1 == 1 [aweight=adults], statistics(n, mean, sd, min, max)

   stats |  attend~e      educ
---------+--------------------
N   |       136       136
mean   |   .696793  12.94461
sd   |  .4613431  1.867902
min   |         0         8
max   |         1        17
---------+--------------------

. tabstat attendance educ if goodeduc == 1 & age2 == 1 [aweight=adults], statistics(n, mean, sd, min, max)

   stats |  attend~e      educ
---------+--------------------
N   |       720       720
mean   |  .6518519   13.8037
sd   |  .4767144  2.615312
min   |         0         5
max   |         1        20
---------+--------------------

. tabstat attendance educ if goodeduc == 1 & age3 == 1 [aweight=adults], statistics(n, mean, sd, min, max)

   stats |  attend~e      educ
---------+--------------------
N   |       432       432
mean   |  .5119332  13.04535
sd   |  .5004371  3.115345
min   |         0         0
max   |         1        20
---------+--------------------

. tabstat attendance educ if goodeduc == 1 & age4 == 1 [aweight=adults], statistics(n, mean, sd, min, max)

   stats |  attend~e      educ
---------+--------------------
N   |       298       298
mean   |  .3150106  11.44186
sd   |  .4653015  3.461559
min   |         0         0
max   |         1        20
---------+--------------------

.
. **logit regressions**
. logit attendance percinc if goodinc == 1 [pweight = adults]

Iteration 0:   log pseudolikelihood = -1883.9289
Iteration 1:   log pseudolikelihood = -1844.6138
Iteration 2:   log pseudolikelihood = -1844.5361
Iteration 3:   log pseudolikelihood = -1844.5361

Logistic regression                               Number of obs   =       1464
                                                  Wald chi2(1)    =      29.41
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -1844.5361                 Pseudo R2       =     0.0209

-------------+----------------------------------------------------------------
             |               Robust
   attendance |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     percinc |    .0000282    5.21e-06      5.42    0.000       .000018     .0000384
       _cons |   -.1340302    .0966699     -1.39    0.166     -.3234998     .0554393
-------------+----------------------------------------------------------------

. listcoef, help
(pweights not compatible with summarize; weights will be treated as aweights)

logit (N=1464): Factor Change in Odds

  Odds of: 1 vs 0

-------------+--------------------------------------------------------
  attendance |      b         z     P>|z|    e^b    e^bStdX      SDofX
-------------+--------------------------------------------------------
     percinc |   0.00003    5.423   0.000   1.0000   1.4526 13220.6311
-------------+--------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
     e^b = exp(b) = factor change in odds for unit increase in X
 e^bStdX = exp(b*SD of X) = change in odds for SD increase in X
   SDofX = standard deviation of X

. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
.            |   1464   -1883.929   -1844.536      2     3693.072     3703.65
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. prgen percinc, from(0) to(200000) generate(pinc) n(21)

logit: Predicted values as percinc varies from 0 to 200000.

      percinc
x=  16753.856

.
. logit attendance educ if goodeduc == 1 & age1 == 1 [pweight = adults]

Iteration 0:   log pseudolikelihood =  -210.4501
Iteration 1:   log pseudolikelihood = -200.08169
Iteration 2:   log pseudolikelihood =   -199.929
Iteration 3:   log pseudolikelihood = -199.92886
Iteration 4:   log pseudolikelihood = -199.92886

Logistic regression                               Number of obs   =        136
                                                  Wald chi2(1)    =       8.89
                                                  Prob > chi2     =     0.0029
Log pseudolikelihood = -199.92886                 Pseudo R2       =     0.0500

-------------+----------------------------------------------------------------
             |               Robust
   attendance |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        educ |    .3064784     .102783      2.98    0.003      .1050275     .5079294
       _cons |   -3.072485    1.309856     -2.35    0.019     -5.639756    -.5052135
-------------+----------------------------------------------------------------

. listcoef, help
(pweights not compatible with summarize; weights will be treated as aweights)

logit (N=136): Factor Change in Odds

  Odds of: 1 vs 0

-------------+--------------------------------------------------------
  attendance |      b         z     P>|z|    e^b    e^bStdX      SDofX
-------------+--------------------------------------------------------
        educ |   0.30648    2.982   0.003   1.3586   1.7726     1.8679
-------------+--------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
     e^b = exp(b) = factor change in odds for unit increase in X
 e^bStdX = exp(b*SD of X) = change in odds for SD increase in X
   SDofX = standard deviation of X

. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
.            |    136   -210.4501   -199.9289      2     403.8577     409.683
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. prgen educ, from(0) to(20) generate(peducage1) n(21)

logit: Predicted values as educ varies from 0 to 20.

         educ
x=  12.926471

.
. logit attendance educ if goodeduc == 1 & age2 == 1 [pweight = adults]

Iteration 0:   log pseudolikelihood = -872.49518
Iteration 1:   log pseudolikelihood = -838.10672
Iteration 2:   log pseudolikelihood = -837.82964
Iteration 3:   log pseudolikelihood = -837.82955
Iteration 4:   log pseudolikelihood = -837.82955

Logistic regression                               Number of obs   =        720
                                                  Wald chi2(1)    =      28.06
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -837.82955                 Pseudo R2       =     0.0397

-------------+----------------------------------------------------------------
             |               Robust
   attendance |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        educ |    .1906623     .035992      5.30    0.000      .1201192     .2612054
       _cons |   -1.967463    .4871719     -4.04    0.000     -2.922302    -1.012623
-------------+----------------------------------------------------------------

. listcoef, help
(pweights not compatible with summarize; weights will be treated as aweights)

logit (N=720): Factor Change in Odds

  Odds of: 1 vs 0

-------------+--------------------------------------------------------
  attendance |      b         z     P>|z|    e^b    e^bStdX      SDofX
-------------+--------------------------------------------------------
        educ |   0.19066    5.297   0.000   1.2101   1.6465     2.6153
-------------+--------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
     e^b = exp(b) = factor change in odds for unit increase in X
 e^bStdX = exp(b*SD of X) = change in odds for SD increase in X
   SDofX = standard deviation of X

. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
.            |    720   -872.4952   -837.8295      2     1679.659    1688.818
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. prgen educ, from(0) to(20) generate(peducage2) n(21)

logit: Predicted values as educ varies from 0 to 20.

         educ
x=  13.788889

.
. logit attendance educ if goodeduc == 1 & age3 == 1 [pweight = adults]

Iteration 0:   log pseudolikelihood = -580.61865
Iteration 1:   log pseudolikelihood = -541.46085
Iteration 2:   log pseudolikelihood = -541.45984
Iteration 3:   log pseudolikelihood = -541.45984

Logistic regression                               Number of obs   =        432
                                                  Wald chi2(1)    =      31.74
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -541.45984                 Pseudo R2       =     0.0674

-------------+----------------------------------------------------------------
             |               Robust
   attendance |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        educ |    .2156505    .0382757      5.63    0.000      .1406316     .2906695
       _cons |   -2.766272    .4968583     -5.57    0.000     -3.740097    -1.792448
-------------+----------------------------------------------------------------

. listcoef, help
(pweights not compatible with summarize; weights will be treated as aweights)

logit (N=432): Factor Change in Odds

  Odds of: 1 vs 0

-------------+--------------------------------------------------------
  attendance |      b         z     P>|z|    e^b    e^bStdX      SDofX
-------------+--------------------------------------------------------
        educ |   0.21565    5.634   0.000   1.2407   1.9578     3.1153
-------------+--------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
     e^b = exp(b) = factor change in odds for unit increase in X
 e^bStdX = exp(b*SD of X) = change in odds for SD increase in X
   SDofX = standard deviation of X

. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
.            |    432   -580.6187   -541.4598      2      1086.92    1095.057
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. prgen educ, from(0) to(20) generate(peducage3) n(21)

logit: Predicted values as educ varies from 0 to 20.

         educ
x=  13.002315

.
. logit attendance educ if goodeduc == 1 & age4 == 1 [pweight = adults]

Iteration 0:   log pseudolikelihood = -294.70322
Iteration 1:   log pseudolikelihood = -265.24229
Iteration 2:   log pseudolikelihood = -264.56382
Iteration 3:   log pseudolikelihood = -264.56275
Iteration 4:   log pseudolikelihood = -264.56275

Logistic regression                               Number of obs   =        298
                                                  Wald chi2(1)    =      27.46
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -264.56275                 Pseudo R2       =     0.1023

-------------+----------------------------------------------------------------
             |               Robust
   attendance |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        educ |    .2525036    .0481888      5.24    0.000      .1580553     .3469519
       _cons |   -3.793298     .613894     -6.18    0.000     -4.996508    -2.590088
-------------+----------------------------------------------------------------

. listcoef, help
(pweights not compatible with summarize; weights will be treated as aweights)

logit (N=298): Factor Change in Odds

  Odds of: 1 vs 0

-------------+--------------------------------------------------------
  attendance |      b         z     P>|z|    e^b    e^bStdX      SDofX
-------------+--------------------------------------------------------
        educ |   0.25250    5.240   0.000   1.2872   2.3966     3.4616
-------------+--------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
     e^b = exp(b) = factor change in odds for unit increase in X
 e^bStdX = exp(b*SD of X) = change in odds for SD increase in X
   SDofX = standard deviation of X

. estat ic

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
.            |    298   -294.7032   -264.5628      2     533.1255    540.5197
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. prgen educ, from(0) to(20) generate(peducage4) n(21)

logit: Predicted values as educ varies from 0 to 20.

         educ
x=  11.355705

.
end of do-file

. log close
      name:  <unnamed>
       log:  E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\X_Not_for_Rachel_X\Updated_data_and_calculations\GSS\GSS_analysis_revised_November_2017.smcl
  log type:  smcl
 closed on:   1 Dec 2017, 17:21:27
-------------