Announcement

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

  • How to show t-statistics for the mean of a variable in table

    Hello everyone,

    I am trying to replicate the following table using the dataset below.
    Click image for larger version

Name:	20180604140422.png
Views:	1
Size:	37.3 KB
ID:	1447497


    I have tried the code like:
    Code:
    tabstat Never_VW Loser_VW Winner_VW Both_VW NML_VW NMW_VW NMB_VW, save stat(mean) c(s)
    tabstatmat a1
    mat a1 = a1'
    mat rowname a1 = Never Loser Winner Both Never-Loser Never-Winner Never-Both
    mat colname a1 = Value_Weighted
    matlist a1, border(rows) rowtitle(Portfolio) cspec(o2& %12s | %8.6f o2&) rspec(--&&&-&&-)
    but there are still two problems
    1.
    tabstat don't calculate the t-values in the brackets above, is there an other command that I can use?
    2. can I show the % in the tables of stata?


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(ym Winner_VW Loser_VW Both_VW Never_VW NML_VW NMW_VW NMB_VW)
    253    .0032616532828336725    .002389621792850824   .0015050601765499705   .0018644786145891232 -.0005251431782617006  -.0013971746682445493   .0003594184380391527
    254     .003958915765318046   .0015732719974287767  -.0028967428000629394   .0019564124185621045  .0003831404211333278  -.0020025033467559418    .004853155218625044
    255     -.00671922192592629   .0060943589285706885    .002996364300369317   .0020984309130394445  -.003995928015531244    .008817652838965734  -.0008979333873298727
    256       .0285289689654058   .0050834973146507145   .0022775941615936594  -.0014341452763376816  -.006517642590988396   -.029963114241743482   -.003711739437931341
    257    -.004242892906162563   .0023254007430512607    .008883513051181104   .0005877549981542827 -.0017376457448969782    .004830647904316846   -.008295758053026821
    258   -.0008220280247965085  -.0007112600550457329  .00012770735872079576  -.0003048672979535539 .00040639275709217893   .0005171607268429546  -.0004325746566743497
    259    .0003494851090127425   .0031020547554498385  -.0015074248619626597   .0009927545003056344  -.002109300255144204   .0006432693912928919   .0025001793622682943
    260    -.007812340046407035   -.004781532460770807   -.005209643367205629  -.0036189209418835072  .0011626115188872995    .004193419104523528   .0015907224253221214
    261   -.0009339858254694344   .0006993245346462767    .005992283168435061    .005691532520569393   .004992207985923117    .006625518346038827 -.00030075064786566803
    262    .0026023779688080367    .004342625777956131   .0014141398697401504    .002321092003897798  -.002021533774058333 -.00028128596491023856   .0009069521341576478
    263   -.0028516335504367397  -.0030600662051411065    .006268849008175489  -.0006034073820147702   .002456658823126336   .0022482261684219694   -.006872256390190259
    264     .005514868458466902    .002222147377927327    .005526331980643806    .003613356967739969  .0013912095898126423  -.0019015114907269324  -.0019129750129038372
    265   -.0015854238262745517   -.004906440892402989  -.0032858019571574246  -.0037507606291421634  .0011556802632608255  -.0021653368028676117  -.0004649586719847388
    266    .0014552834806738075  -.0020366773460222315 -.00040080366366646654 -.00018767692515677536  .0018490004208654561  -.0016429604058305828  .00021312673850969118
    267   -.0022396984744847276   -.002904425979766052 -.00048330712357498736  -.0006004729512552177  .0023039530285108344   .0016392255232295099 -.00011716582768023036
    268    .0004343383569767965  .00006975216778855072   -.002725837648933506    .000957604595553193  .0008878524277646424   .0005232662385763966    .003683442244486699
    269    .0005896760313238349   .0009707593823494275 -.00030409677746835105  -.0006489550548868234 -.0016197144372362509  -.0012386310862106584 -.00034485827741847233
    270     .002251971627346193  -.0019947033287995705  -.0036341428984848516   .0004151642509514737   .002409867579751044  -.0018368073763947192   .0040493071494363255
    271   .00018542747479190043  -.0028816201479821973   .0010325454324593768  -.0007153627303402315  .0021662574176419657  -.0009007902051321319  -.0017479081627996083
    272 -.000041944432898601626 .000058966565578975944  -.0057404419702462425    .003220191429312578   .003161224863733602   .0032621358622111794    .008960633399558821
    end
    format %tm ym
    Thanks for your help and time, I will be very grateful if you can give some tips!

    Best,
    Yao Jin

  • #2
    You could rescale and then do means for the basic percentages and differences in percentages. You can use test for the t values..

    Comment


    • #3
      Thanks for your tips Phil, I know I can rescale and t statistic could be obtained by ttest, I actually want to know if I can combine them in the table using some commands.

      Comment

      Working...
      X