Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Or would this work? (sorry not near my laptop for trial and and error purposes):
    gen Advised = !missing(IssuerAdvisor, VendorAdvisor)

    Comment


    • #17
      I believe the mangled dataex output in #9 is due to the presence of in-cell line breaks in the Excel spreadsheet. Here's the same data with those line breaks replaced with a percent character:

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input int(PriceDate Proceeds) str43 IssuerAdvisor str26 VendorAdvisor byte Books str157 BooksName double perf1d
      19487   80 ""       ""  3 "Credit Suisse%SG Corporate & Investment Banking%Barclays"                                                                                                        -16
      20909   82 ""       ""  4 "Citi%Credit Suisse%Mediobanca%UniCredit"                                                                                                                        4.55
      19500  367 "Lazard" "" 12 "Goldman Sachs%Deutsche Bank%JPMorgan%Barclays%Credit Suisse%Morgan Stanley%BNP Paribas%UBS%Citi%HSBC%SG Corporate & Investment Banking%Lazard Capital Markets" -3.13
      19010  233 ""       ""  3 "Bank of America Merrill Lynch%Mirabaud & Cie%Renaissance Capital"                                                                                              -5.22
      18353   51 ""       ""  2 "Canaccord Genuity Corp%Renaissance Capital"                                                                                                                      .71
      20278   76 "Lazard" ""  2 "Intesa Sanpaolo SpA%Intermonte Holding SIM SpA"                                                                                                                32.22
      19332  659 ""       ""  4 "Barclays%JPMorgan%Morgan Stanley%IPOPEMA"                                                                                                                       6.84
      18571 1003 ""       ""  4 "Goldman Sachs%JPMorgan%Morgan Stanley%VTB Capital"                                                                                                             29.96
      19761  190 ""       ""  2 "Credit Suisse%Banco Espirito Santo"                                                                                                                            -2.19
      18382  208 ""       ""  1 "Sberbank CIB"                                                                                                                                                      1
      end
      format %tdnn/dd/CCYY PriceDate
      label var PriceDate "PriceDate" 
      label var Proceeds "Proceeds" 
      label var IssuerAdvisor "IssuerAdvisor" 
      label var VendorAdvisor "VendorAdvisor" 
      label var Books "#Books" 
      label var BooksName "BooksName" 
      label var perf1d "perf1d"
      The above example can loaded in Stata without problem. If you then type:
      Code:
      replace BooksName = subinstr(BooksName,"%",char(10),.)
      dataex
      you replicate the dataex output in #9. So Emmanuel could fix this issue with his data using something like:
      Code:
      replace BooksName = subinstr(BooksName,char(10)," ",.)
      When I run the code from #7 with the data from #9, I get:
      Code:
      . ttest perf1d, by(advised)
      
      Two-sample t test with equal variances
      ------------------------------------------------------------------------------
         Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
      ---------+--------------------------------------------------------------------
             0 |       8     2.45625    4.641376    13.12779   -8.518861    13.43136
             1 |       2      14.545      17.675    24.99622   -210.0372    239.1272
      ---------+--------------------------------------------------------------------
      combined |      10       4.874    4.790042    15.14744   -5.961827    15.70983
      ---------+--------------------------------------------------------------------
          diff |           -12.08875    11.96082               -39.67046    15.49296
      ------------------------------------------------------------------------------
          diff = mean(0) - mean(1)                                      t =  -1.0107
      Ho: diff = 0                                     degrees of freedom =        8
      
          Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
       Pr(T < t) = 0.1709         Pr(|T| > |t|) = 0.3418          Pr(T > t) = 0.8291
      So to target where the problem lies, Emmanuel should try:
      Code:
      tab advised
      confirm that there are more than 2 groups, and track down observations where advise is neither 0 or 1.

      Comment

      Working...
      X