------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\blair.flicker\Dropbox\MS Replication Project\Main Paper Submission\Accepted First Look\Individual_Papers_Data+Analysis\HoZhang2008_DataAnalysis\output.txt
  log type:  text
 opened on:  28 Apr 2023, 11:11:21

. insheet using "dataAll_UTD_update_Fall2022.csv", comma
(18 vars, 2,882 obs)

. 
. ****************
. ** Start Code **
. ** UT Dallas ***
. ****************
. 
. destring f p q pricea, replace 
f already numeric; no replace
p: contains nonnumeric characters; no replace
q already numeric; no replace
pricea already numeric; no replace

. 
. gen acceptCode = 1

. replace acceptCode = 0 if accept =="Reject"
(764 real changes made)

. gen totProfit = rprofit+sprofit

. gen efficiency = totProfit/16

. gen RetailPrice = p
(212 missing values generated)

. gen retailPrice = 10-q
(38 missing values generated)

. egen SubjectID = group(tpt cohort participant)

. 
. *************************
. label define tpt 0 "Quantity Discount" 1 "Two-part Tariff"

. label values tpt tpt

. 
. *********************************************************************************
. ** Taking Data only for Player A (it is the same if we just take for Player B) **
. *********************************************************************************
. preserve

. replace effic = 100*effic
(2,102 real changes made)

. ttest efficiency if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     715    63.18182    1.583626    42.34533     60.0727    66.29094
Two-part |     726    63.61054    1.519718    40.94787    60.62696    66.59411
---------+--------------------------------------------------------------------
combined |   1,441    63.39781    1.096751    41.63321    61.24641    65.54921
---------+--------------------------------------------------------------------
    diff |            -.428719    2.194298               -4.733085    3.875647
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =  -0.1954
Ho: diff = 0                                     degrees of freedom =     1439

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4226         Pr(|T| > |t|) = 0.8451          Pr(T > t) = 0.5774

. ttest w if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     715    4.376224    .0630867    1.686906    4.252366    4.500081
Two-part |     726    4.663912    .0534547    1.440304    4.558967    4.768856
---------+--------------------------------------------------------------------
combined |   1,441    4.521166    .0414527    1.573567    4.439852     4.60248
---------+--------------------------------------------------------------------
    diff |           -.2876881    .0825892               -.4496963   -.1256799
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =  -3.4834
Ho: diff = 0                                     degrees of freedom =     1439

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0003         Pr(|T| > |t|) = 0.0005          Pr(T > t) = 0.9997

. ttest f if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     712    5.676966    .2513326     6.70639    5.183523    6.170409
Two-part |     726    4.170799    .0901623    2.429367    3.993789    4.347809
---------+--------------------------------------------------------------------
combined |   1,438    4.916551    .1339415    5.079191    4.653809    5.179293
---------+--------------------------------------------------------------------
    diff |            1.506167    .2650251                .9862896    2.026045
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =   5.6831
Ho: diff = 0                                     degrees of freedom =     1436

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

. prtest acceptCode if myname == "Player A", by(tpt)

Two-sample test of proportions          Quantity Dis: Number of obs =      715
                                        Two-part Tar: Number of obs =      726
------------------------------------------------------------------------------
       Group |       Mean   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Quantity Dis |   .7132867   .0169123                      .6801392    .7464342
Two-part Tar |   .7561983   .0159356                      .7249652    .7874315
-------------+----------------------------------------------------------------
        diff |  -.0429116   .0232372                     -.0884558    .0026325
             |  under Ho:   .0232555    -1.85   0.065
------------------------------------------------------------------------------
        diff = prop(Quantity Dis) - prop(Two-part Tar)            z =  -1.8452
    Ho: diff = 0

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(Z < z) = 0.0325         Pr(|Z| > |z|) = 0.0650          Pr(Z > z) = 0.9675

. 
. ** Conditional Efficiency **
. ttest efficiency if acceptCode == 1 & myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     510    88.57843    .7157854    16.16471    87.17217    89.98469
Two-part |     549    84.11885    .9447539    22.13629    82.26307    85.97463
---------+--------------------------------------------------------------------
combined |   1,059    86.26653    .6025496    19.60834     85.0842    87.44885
---------+--------------------------------------------------------------------
    diff |            4.459579    1.198665                2.107546    6.811612
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =   3.7205
Ho: diff = 0                                     degrees of freedom =     1057

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9999         Pr(|T| > |t|) = 0.0002          Pr(T > t) = 0.0001

. ttest retailPrice  if myname == "Player A" & acceptCode == 1, by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     510    6.866667     .045985    1.038487    6.776323     6.95701
Two-part |     549    7.167577    .0463592     1.08623    7.076514    7.258641
---------+--------------------------------------------------------------------
combined |   1,059    7.022663    .0329908    1.073594    6.957928    7.087398
---------+--------------------------------------------------------------------
    diff |           -.3009107    .0654059               -.4292509   -.1725706
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =  -4.6007
Ho: diff = 0                                     degrees of freedom =     1057

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. *ttest sShare if myname == "Player A" & acceptCode == 1, by(tpt)
. restore

. 
. 
. ****************
. ** Start Code **
. *** Michigan ***
. ****************
. 
. clear

. 
. *************
. ** Generic **
. *************
. 
. *log using "output.txt", text replace
. *insheet using "~path/dataAll_UM.csv", comma"
. 
. **************************
. ****** For Running *******
. ** Delete After Running **
. **************************
. 
. insheet using "dataAll_UM.csv", comma
(18 vars, 1,320 obs)

. 
. 
. drop cohort

. egen cohort = group(Date)

. 
. destring f p q pricea, replace 
f already numeric; no replace
p already numeric; no replace
q already numeric; no replace
pricea already numeric; no replace

. 
. gen acceptCode = 1

. replace acceptCode = 0 if accept =="Reject"
(230 real changes made)

. gen totProfit = rprofit+sprofit

. gen efficiency = totProfit/16

. gen RetailPrice = p
(100 missing values generated)

. gen retailPrice = 10-q
(44 missing values generated)

. egen SubjectID = group(tpt cohort participant)

. 
. *************************
. label define tpt 0 "Quantity Discount" 1 "Two-part Tariff"

. label values tpt tpt

. 
. *********************************************************************************
. ** Taking Data only for Player A (it is the same if we just take for Player B) **
. *********************************************************************************
. preserve

. replace effic = 100*effic
(1,040 real changes made)

. ttest efficiency if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     319    75.35266    1.905072    34.02568    71.60453     79.1008
Two-part |     310    70.72581     2.19687    38.67989    66.40309    75.04852
---------+--------------------------------------------------------------------
combined |     629    73.07234    1.452897    36.43847    70.21921    75.92546
---------+--------------------------------------------------------------------
    diff |            4.626858    2.902532               -1.073003    10.32672
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =   1.5941
Ho: diff = 0                                     degrees of freedom =      627

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9443         Pr(|T| > |t|) = 0.1114          Pr(T > t) = 0.0557

. ttest w if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     319    4.043887    .0708622    1.265639    3.904469    4.183305
Two-part |     310    4.274194    .0785938    1.383787    4.119547     4.42884
---------+--------------------------------------------------------------------
combined |     629    4.157393    .0529959    1.329131    4.053322    4.261463
---------+--------------------------------------------------------------------
    diff |           -.2303064    .1056877               -.4378512   -.0227616
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =  -2.1791
Ho: diff = 0                                     degrees of freedom =      627

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0148         Pr(|T| > |t|) = 0.0297          Pr(T > t) = 0.9852

. ttest f if myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     319    5.423197    .1529102    2.731063    5.122354    5.724041
Two-part |     310    4.467742    .1538447    2.708716    4.165026    4.770458
---------+--------------------------------------------------------------------
combined |     629    4.952305    .1100336     2.75963    4.736227    5.168384
---------+--------------------------------------------------------------------
    diff |            .9554556     .216935                .5294484    1.381463
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =   4.4043
Ho: diff = 0                                     degrees of freedom =      627

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

. prtest acceptCode if myname == "Player A", by(tpt)

Two-sample test of proportions          Quantity Dis: Number of obs =      319
                                        Two-part Tar: Number of obs =      310
------------------------------------------------------------------------------
       Group |       Mean   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Quantity Dis |   .8432602   .0203552                      .8033648    .8831556
Two-part Tar |   .8096774   .0222957                      .7659787    .8533761
-------------+----------------------------------------------------------------
        diff |   .0335828   .0301899                     -.0255883    .0927539
             |  under Ho:   .0301865     1.11   0.266
------------------------------------------------------------------------------
        diff = prop(Quantity Dis) - prop(Two-part Tar)            z =   1.1125
    Ho: diff = 0

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(Z < z) = 0.8670         Pr(|Z| > |z|) = 0.2659          Pr(Z > z) = 0.1330

. 
. ** Conditional Efficiency **
. ttest efficiency if acceptCode == 1 & myname == "Player A", by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     269    89.35874     .660937    10.84017    88.05745    90.66003
Two-part |     251     87.3506    1.248469    19.77947    84.89174    89.80946
---------+--------------------------------------------------------------------
combined |     520    88.38942    .6935703    15.81584    87.02687    89.75197
---------+--------------------------------------------------------------------
    diff |            2.008138    1.386507               -.7157296    4.732007
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =   1.4483
Ho: diff = 0                                     degrees of freedom =      518

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9259         Pr(|T| > |t|) = 0.1481          Pr(T > t) = 0.0741

. ttest retailPrice  if myname == "Player A" & acceptCode == 1, by(tpt)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
Quantity |     269    6.951673    .0545306    .8943683     6.84431    7.059036
Two-part |     251    6.956175    .0666223    1.055496    6.824963    7.087388
---------+--------------------------------------------------------------------
combined |     520    6.953846    .0427357    .9745236     6.86989    7.037802
---------+--------------------------------------------------------------------
    diff |           -.0045024    .0856049               -.1726779     .163673
------------------------------------------------------------------------------
    diff = mean(Quantity) - mean(Two-part)                        t =  -0.0526
Ho: diff = 0                                     degrees of freedom =      518

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4790         Pr(|T| > |t|) = 0.9581          Pr(T > t) = 0.5210

. restore

. 
end of do-file

. exit, clear
