-------------
      name:  <unnamed>
       log:  E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\Not_for_Rachel\Updated_data_and_calculations\Figures\chi-dinces-fig02001\chi-dinces-fig02001.smcl
  log type:  smcl
 opened on:  28 Oct 2017, 19:39:42

. do "E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\Not_for_Rachel\Updated_data_and_calculations\Figures\chi-dinces-fig02001\chi-dinces-fig02001.do"

. **Analysis of data from ABC "Nightline" Survey on Impact of Jackie Robinson on Race Relations, Februrary 1997**
.
. set more off

.
. **generate new race variable**
. gen race = .
(670 missing values generated)

. replace race = 1 if(Q918 == 1)
(410 real changes made)

. replace race = 2 if(Q918 == 2)
(204 real changes made)

. replace race = 3 if(Q918 == 3)
(21 real changes made)

. replace race = 3 if(Q918 == 4)
(5 real changes made)

. replace race = 3 if(Q918 == 5)
(5 real changes made)

. replace race = 3 if(Q918 == 6)
(25 real changes made)

. label define racelab 1 "Non-Hispanic White" 2 "Non-Hispanic Black" 3 "Other race"

. label values race racelab

.
. **generate new tension variable to include only respondents who expressed an opinion**
. gen tension = .
(670 missing values generated)

. replace tension = 1 if(Q6 == 1)
(330 real changes made)

. replace tension = 2 if(Q6 == 2)
(52 real changes made)

. replace tension = 3 if(Q6 == 3)
(251 real changes made)

. replace tension = . if(Q6 == 8)
(0 real changes made)

. replace tension = . if(Q6 == 9)
(0 real changes made)

. label define tensionlab 1 "Helps" 2 "Hurts" 3 "Has no effect"

. label values tension tensionlab

.
. **chi-squared test**
. tab tension race, expected freq row col chi2

+--------------------+
| Key                |
+--------------------+
|     frequency      |
| expected frequency |
|   row percentage   |
| column percentage  |
+--------------------+

              |               race
      tension | Non-Hispa  Non-Hispa  Other rac |     Total
--------------+---------------------------------+----------
        Helps |       211         96         23 |       330
              |     202.3      100.6       27.1 |     330.0
              |     63.94      29.09       6.97 |    100.00
              |     54.38      49.74      44.23 |     52.13
--------------+---------------------------------+----------
        Hurts |        32         13          7 |        52
              |      31.9       15.9        4.3 |      52.0
              |     61.54      25.00      13.46 |    100.00
              |      8.25       6.74      13.46 |      8.21
--------------+---------------------------------+----------
Has no effect |       145         84         22 |       251
              |     153.9       76.5       20.6 |     251.0
              |     57.77      33.47       8.76 |    100.00
              |     37.37      43.52      42.31 |     39.65
--------------+---------------------------------+----------
        Total |       388        193         52 |       633
              |     388.0      193.0       52.0 |     633.0
              |     61.30      30.49       8.21 |    100.00
              |    100.00     100.00     100.00 |    100.00

          Pearson chi2(4) =   4.7990   Pr = 0.309

.
. **95% CIs for Proportions**
. proportion tension

Proportion estimation               Number of obs    =     633

      _prop_3: tension = Has no effect

-------------+------------------------------------------------
             | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
tension      |
       Helps |     .521327    .0198708       .4822555     .5601394
       Hurts |    .0821485    .0109226       .0630928     .1063064
     _prop_3 |    .3965245    .0194584       .3590131     .4352936
-------------+------------------------------------------------

. proportion tension if race == 1

Proportion estimation               Number of obs    =     388

      _prop_3: tension = Has no effect

-------------+------------------------------------------------
             | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
tension      |
       Helps |    .5438144    .0253187       .4937629     .5929965
       Hurts |    .0824742    .0139834       .0588278     .1144695
     _prop_3 |    .3737113    .0245923        .326752     .4231774
-------------+------------------------------------------------

. proportion tension if race == 2

Proportion estimation               Number of obs    =     193

      _prop_3: tension = Has no effect

-------------+------------------------------------------------
             | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
tension      |
       Helps |    .4974093    .0360839       .4267662     .5681561
       Hurts |    .0673575    .0180884        .039319     .1130378
     _prop_3 |    .4352332    .0357804       .3664119     .5066443
-------------+------------------------------------------------

. proportion tension if race == 3

Proportion estimation               Number of obs    =      52

      _prop_3: tension = Has no effect

-------------+------------------------------------------------
             | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
tension      |
       Helps |    .4423077    .0695464       .3104925     .5827845
       Hurts |    .1346154    .0477933       .0639007     .2617073
     _prop_3 |    .4230769    .0691805       .2933508     .5643548
-------------+------------------------------------------------

.
. **descriptive statistics: responses by race**
. tab1 tension

-> tabulation of tension

      tension |      Freq.     Percent        Cum.
--------------+-----------------------------------
        Helps |        330       52.13       52.13
        Hurts |         52        8.21       60.35
Has no effect |        251       39.65      100.00
--------------+-----------------------------------
        Total |        633      100.00

. bysort race: tab1 tension

-------------
-> race = Non-Hispanic White

-> tabulation of tension

      tension |      Freq.     Percent        Cum.
--------------+-----------------------------------
        Helps |        211       54.38       54.38
        Hurts |         32        8.25       62.63
Has no effect |        145       37.37      100.00
--------------+-----------------------------------
        Total |        388      100.00

-------------
-> race = Non-Hispanic Black

-> tabulation of tension

      tension |      Freq.     Percent        Cum.
--------------+-----------------------------------
        Helps |         96       49.74       49.74
        Hurts |         13        6.74       56.48
Has no effect |         84       43.52      100.00
--------------+-----------------------------------
        Total |        193      100.00

-------------
-> race = Other race

-> tabulation of tension

      tension |      Freq.     Percent        Cum.
--------------+-----------------------------------
        Helps |         23       44.23       44.23
        Hurts |          7       13.46       57.69
Has no effect |         22       42.31      100.00
--------------+-----------------------------------
        Total |         52      100.00

. histogram tension, discrete percent by(race, total)

.
. **Recalculation of Proportions using Sampling Weights**
. proportion tension [pw=WEIGHT]

Proportion estimation               Number of obs    =     633

      _prop_3: tension = Has no effect

-------------+------------------------------------------------
             | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
tension      |
       Helps |    .5263925      .02154       .4840056     .5684023
       Hurts |    .0850538    .0120696       .0641549     .1119463
     _prop_3 |    .3885537    .0210062       .3481858     .4305107
-------------+------------------------------------------------

. proportion tension [pw=WEIGHT], over(race)

Proportion estimation               Number of obs    =     633

        Helps: tension = Helps
        Hurts: tension = Hurts
      _prop_3: tension = Has no effect

    _subpop_1: race = Non-Hispanic White
    _subpop_2: race = Non-Hispanic Black
    _subpop_3: race = Other race

-------------+------------------------------------------------
         Over | Proportion    Std. Err.      [95% Con f. Interval]
-------------+------------------------------------------------
Helps        |
   _subpop_1 |    .5437067    .0253395        .493676     .5928707
   _subpop_2 |    .4996262    .0362912       .4288465     .5704209
   _subpop_3 |    .4212177    .0695086       .2936631     .5602326
-------------+------------------------------------------------
Hurts        |
   _subpop_1 |    .0812108    .0137978        .057914     .1127575
   _subpop_2 |    .0646729    .0174941        .037707     .1087441
   _subpop_3 |    .1388558    .0487879       .0674808     .2643259
-------------+------------------------------------------------
_prop_3      |
   _subpop_1 |    .3750825    .0246476       .3280612     .4245848
   _subpop_2 |    .4357009    .0359943       .3667665     .5072138
   _subpop_3 |    .4399265    .0700586       .3100631     .5785693
-------------+------------------------------------------------

.
end of do-file

. log close
      name:  <unnamed>
       log:  E:\Dropbox\DINCES_SYNC\DINCES_DOCS\ACADEMIC\Long_Beach_CC\Publication\Bulls_Markets_electronic_submission\Not_for_Rachel\Updated_data_and_calculations\Figures\chi-dinces-fig02001\chi-dinces-fig02001.smcl
  log type:  smcl
 closed on:  28 Oct 2017, 19:42:36
-------------