Announcement

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

  • #46
    Chen Samulsion You are absolutely right. Getting Chinese characters in an RTF file is a pain in the neck. Usually, getting Chinese characters programmatically into an RTF file does not seem straightforward, one has to first convert the letters to Unicode and then render it properly in the RTF file. Doing all these seems a little off for me given the scope of asdoc.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    www.FinTechProfessor.com
    If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word

    Comment


    • #47
      Thank you professor Attaullah Shah. There are many user-written commands for exporting tables to text (word, excel, Latex) files in Stata, for example, estout, logout, outreg, outreg2, outtable, tabout, partchart, publish as far as I know. Some of them have obvious flaws, but also some have clear advantage. I hope someone can compare them with asdoc someday.

      Comment


      • #48
        --I registered this account a long time ago, and I can't change my user name to my real name without setting up a new account---


        Prof. Shah:

        This is a wonderful program! Thank you very much.


        I have been using it with imputed data and it works great with logistic regression.

        For example, this works perfectly with a binary DV....

        asdoc mi estimate, or: logistic DV IV IV IV, etc.


        However, I'm not getting it to work with the regression command with mi estimate and a continuous DV. This doesn't work for me:

        asdoc mi estimate: regress DV IV IV IV

        I get the error:

        variable estimate not found
        r(111);



        If I play around with it and try "asdoc regress DV IV IV IV" then it works. So, I think this might be a bug in asdoc with mi estimate: regress? Or am I supposed to be adding an option first? I have tried using asdoc mi estimate, coef: regress DV IV IV just to see but no luck.

        I have read through your website and searched statalist/google to see if others have reported this problem but haven't seen it mentioned...

        FYI, I am using Stata 14.2 and I have updated asdoc using:
        ssc install asdoc, replace
        Thanks in advance,
        Eileen Diaz McConnell

        Comment


        • #49
          Eileen Diaz McConnell thanks for reporting this. Can you please post a data example using dataex (from SSC) and the exact command that you used
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          www.FinTechProfessor.com
          If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word

          Comment


          • #50

            Hi again, Prof. Shah:

            I hope that this works!

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input byte REFUGEES_scale_W23 float ImmWorseScale_W10 byte Immdecrease_W10
            2  -.5 0
            0  .75 1
            0  .75 1
            0  .25 1
            2  -.5 0
            2  .25 1
            2    0 0
            2 -.25 1
            1    1 1
            3  -.5 0
            2 -.75 1
            1    1 1
            0    1 1
            1    1 1
            2 -.25 0
            1 -.75 0
            2 -.25 0
            2  .25 1
            1    1 0
            3    0 0
            3  .75 1
            3  -.5 0
            3  -.5 0
            2  .75 1
            2    1 1
            2 -.75 0
            2    1 1
            1    0 0
            2   .5 1
            1    1 1
            0    1 1
            2  -.5 0
            2  -.5 0
            3  -.5 0
            1 -.25 0
            1 -.25 0
            3  -.5 0
            3    . 0
            2 -.25 0
            0    1 1
            3  -.5 0
            2   .5 1
            0    1 1
            0 -.75 0
            0  -.5 0
            1   .5 0
            2  .25 1
            3  -.5 0
            1   .5 1
            3  -.5 1
            3 -.25 0
            1  .75 1
            2    0 0
            0  .75 1
            2    . 1
            3 -.25 0
            2  .75 1
            2    1 1
            2  .25 1
            3 -.25 0
            2    1 1
            1    0 1
            2  -.5 0
            1 -.75 0
            1    1 1
            2  .25 1
            3    0 0
            1    1 1
            3 -.25 0
            2  -.5 0
            1    0 1
            3   .5 1
            2    1 0
            2   .5 1
            3 -.25 0
            1  .75 1
            3  .25 0
            3    . .
            3 -.75 0
            1    1 0
            3    0 0
            1    1 1
            1    1 1
            3 -.25 0
            2 -.75 1
            2 -.25 0
            . -.25 0
            2 -.25 0
            3  -.5 0
            3 -.75 0
            2  -.5 0
            0    0 0
            2  .75 1
            3  -.5 1
            3  -.5 0
            1  .75 1
            2 -.25 0
            0    1 1
            3  -.5 0
            1    1 0
            end
            label values REFUGEES_scale_W23 REFUGEES_scale_W23
            label def REFUGEES_scale_W23 0 "Not at all important", modify
            label def REFUGEES_scale_W23 1 "Not too important", modify
            label def REFUGEES_scale_W23 2 "Somewhat important goal", modify
            label def REFUGEES_scale_W23 3 "Very important goal", modify
            label values Immdecrease_W10 Immdecrease_W10
            label def Immdecrease_W10 0 "No", modify
            label def Immdecrease_W10 1 "Decreased", modify

            And, then:

            asdoc mi estimate: regress REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10

            I get this output:

            . asdoc mi estimate: regress REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10
            (File Myfile.doc already exists, option append was assumed)
            variable estimate not found
            r(111);

            So, I get the error.

            When I do this instead (even though its logistic with a continuous), I don't get the error.

            asdoc mi estimate, or: logistic REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10

            Output:
            . asdoc mi estimate, or: logistic REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10
            (File Myfile.doc already exists, option append was assumed)


            Thanks for any suggestions!
            Eileen Diaz McConnell

            Comment


            • #51
              I am not familiar with mi commands, so I am getting the following erorrs using your data
              Code:
              no imputations
              
              no imputations
              r(2000);
              Therefore, please post the relevant commands that you used to set the mi data and imputations.

              Regards
              --------------------------------------------------
              Attaullah Shah, PhD.
              Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
              www.FinTechProfessor.com
              If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word

              Comment


              • #52
                There are a lot of them! I'll work on a short version to share and post again tomorrow. In the meantime, has anyone else using asdoc gotten this error with mi estimate: reg?

                Comment


                • #53
                  Hi again, Professor Shah.

                  So this is a hypothetical example that doesn't include all my vars in my models and one of them isn't coded correctly (F_SEX_FINAL). But when I try the asdoc command that I cannot get to work, it shows the same error that I'm trying to show you, so I'm hoping this is enough to give you the key points without taking up too much of your time.



                  Code:
                  * Example generated by -dataex-. To install: ssc install dataex
                  clear
                  input byte(ST3scale_W10 ST8Ascale_W10 ST8Cscale_W10 ST8Dscale_W10 ST7_W10R IMMVALA_W23R REFUGEES_scale_W23) float ImmWorseScale_W10 byte Immdecrease_W10 double F_SEX_FINAL
                  -1  0 -1  0 1 2 2  -.5 0 2
                   1  1  1  0 3 4 0  .75 1 1
                   0  1  1  1 3 4 0  .75 1 1
                   1  0  1 -1 3 4 0  .25 1 2
                  -1  0 -1  0 1 2 2  -.5 0 2
                  -1  1  1  0 3 2 2  .25 1 1
                  -1  1  1 -1 1 2 2    0 0 2
                  -1  1 -1  0 3 2 2 -.25 1 2
                   1  1  1  1 3 3 1    1 1 2
                  -1  0 -1  0 1 1 3  -.5 0 2
                  -1  0 -1 -1 3 2 2 -.75 1 2
                   1  1  1  1 3 3 1    1 1 1
                   1  1  1  1 3 4 0    1 1 1
                   1  1  1  1 3 3 1    1 1 2
                  -1 -1  0  1 1 2 2 -.25 0 1
                  -1  0 -1 -1 1 3 1 -.75 0 1
                  -1  0  0  0 1 2 2 -.25 0 1
                  -1  1  1  0 3 2 2  .25 1 2
                   1  1  1  1 2 3 1    1 0 2
                  -1  1  0  0 1 1 3    0 0 1
                   1  0  1  1 3 1 3  .75 1 2
                  -1  0 -1  0 1 1 3  -.5 0 1
                  -1 -1  1 -1 1 1 3  -.5 0 2
                   1  1  1  0 3 2 2  .75 1 2
                   1  1  1  1 3 2 2    1 1 1
                  -1  0 -1 -1 1 2 2 -.75 0 2
                   1  1  1  1 3 2 2    1 1 2
                  -1  0  0  1 1 3 1    0 0 1
                   1  0  1  0 3 2 2   .5 1 1
                   1  1  1  1 3 3 1    1 1 2
                   1  1  1  1 3 4 0    1 1 1
                  -1  0 -1  0 1 2 2  -.5 0 1
                  -1  0  0 -1 1 2 2  -.5 0 2
                  -1  0 -1  0 1 1 3  -.5 0 2
                   0  0 -1  0 1 3 1 -.25 0 1
                   0  0 -1  0 1 3 1 -.25 0 1
                  -1  0 -1  0 2 1 3  -.5 0 2
                   . -1 -1 -1 1 1 3    . 0 2
                  -1  0  0  0 2 2 2 -.25 0 2
                   1  1  1  1 3 4 0    1 1 1
                  -1  0 -1  0 1 1 3  -.5 0 1
                  -1  1  1  1 3 2 2   .5 1 1
                   1  1  1  1 3 4 0    1 1 2
                  -1 -1 -1  0 1 4 0 -.75 0 1
                  -1  0 -1  0 2 4 0  -.5 0 1
                   0  1  1  0 1 3 1   .5 0 1
                  -1  0  1  1 3 2 2  .25 1 2
                  -1  0 -1  0 2 1 3  -.5 0 1
                   1  1  1 -1 3 3 1   .5 1 1
                  -1  0 -1  0 3 1 3  -.5 1 1
                  -1  0  0  0 2 1 3 -.25 0 2
                   1  1  1  0 3 3 1  .75 1 2
                  -1  1  0  0 1 2 2    0 0 1
                   1  1  1  0 3 4 0  .75 1 2
                   .  1  1  1 3 2 2    . 1 2
                  -1  0  0  0 2 1 3 -.25 0 2
                   1  1  1  0 3 2 2  .75 1 2
                   1  1  1  1 3 2 2    1 1 2
                   1  1  0 -1 3 2 2  .25 1 2
                  -1  0  0  0 2 1 3 -.25 0 2
                   1  1  1  1 3 2 2    1 1 2
                  -1  1  1 -1 3 3 1    0 1 2
                  -1  0 -1  0 1 2 2  -.5 0 2
                  -1  0 -1 -1 1 3 1 -.75 0 2
                   1  1  1  1 3 3 1    1 1 2
                  -1  1  1  0 3 2 2  .25 1 2
                   0  0  0  0 1 1 3    0 0 2
                   1  1  1  1 3 3 1    1 1 2
                  -1  0  0  0 1 1 3 -.25 0 2
                  -1  0 -1  0 2 2 2  -.5 0 1
                   0  0  0  0 3 3 1    0 1 1
                   1  1 -1  1 3 1 3   .5 1 2
                   1  1  1  1 1 2 2    1 0 2
                   1  0  1  0 3 2 2   .5 1 2
                   0  0 -1  0 1 1 3 -.25 0 1
                   1  1  1  0 3 3 1  .75 1 1
                   0  1  0  0 1 1 3  .25 0 2
                  -1  .  .  . . 1 3    . . 2
                  -1  0 -1 -1 2 1 3 -.75 0 1
                   1  1  1  1 2 3 1    1 0 2
                  -1  1  0  0 1 1 3    0 0 2
                   1  1  1  1 3 3 1    1 1 2
                   1  1  1  1 3 3 1    1 1 2
                  -1  0  0  0 1 1 3 -.25 0 2
                  -1  0 -1 -1 3 2 2 -.75 1 2
                   0  0 -1  0 2 2 2 -.25 0 2
                  -1  0  0  0 1 . . -.25 0 2
                  -1  0 -1  1 1 2 2 -.25 0 1
                  -1  0 -1  0 2 1 3  -.5 0 2
                  -1  0 -1 -1 2 1 3 -.75 0 1
                  -1  1 -1 -1 2 2 2  -.5 0 1
                  -1  0  1  0 1 4 0    0 0 2
                   1  1  0  1 3 2 2  .75 1 1
                  -1  0 -1  0 3 1 3  -.5 1 1
                  -1  0 -1  0 1 1 3  -.5 0 2
                   1  1  1  0 3 3 1  .75 1 2
                  -1  0  0  0 1 2 2 -.25 0 2
                   1  1  1  1 3 4 0    1 1 1
                  -1  0 -1  0 2 1 3  -.5 0 1
                   1  1  1  1 1 3 1    1 0 2
                  end
                  label values ST3scale_W10 ST3scale_W10
                  label def ST3scale_W10 -1 "Make American society better in the long run", modify
                  label def ST3scale_W10 0 "Don't have much of an effect", modify
                  label def ST3scale_W10 1 "Make American society worse in the long run", modify
                  label values ST8Ascale_W10 ST8Ascale_W10
                  label def ST8Ascale_W10 -1 "Immigrants are making things better", modify
                  label def ST8Ascale_W10 0 "Don't have much of an effect", modify
                  label def ST8Ascale_W10 1 "Immigrants are making things worse", modify
                  label values ST8Cscale_W10 ST8Cscale_W10
                  label def ST8Cscale_W10 -1 "Immigrants are making things better", modify
                  label def ST8Cscale_W10 0 "Don't have much of an effect", modify
                  label def ST8Cscale_W10 1 "Immigrants are making things worse", modify
                  label values ST8Dscale_W10 ST8Dscale_W10
                  label def ST8Dscale_W10 -1 "Immigrants are making things better", modify
                  label def ST8Dscale_W10 0 "Don't have much of an effect", modify
                  label def ST8Dscale_W10 1 "Immigrants are making things worse", modify
                  label values ST7_W10R ST7_W10R
                  label def ST7_W10R 1 "Present level", modify
                  label def ST7_W10R 2 "Increased", modify
                  label def ST7_W10R 3 "Decreased", modify
                  label values IMMVALA_W23R IMMVALA_W23R
                  label def IMMVALA_W23R 1 "Very important goal", modify
                  label def IMMVALA_W23R 2 "Somewhat important goal", modify
                  label def IMMVALA_W23R 3 "Not too important goal", modify
                  label def IMMVALA_W23R 4 "Not at all important goal", modify
                  label values REFUGEES_scale_W23 REFUGEES_scale_W23
                  label def REFUGEES_scale_W23 0 "Not at all important", modify
                  label def REFUGEES_scale_W23 1 "Not too important", modify
                  label def REFUGEES_scale_W23 2 "Somewhat important goal", modify
                  label def REFUGEES_scale_W23 3 "Very important goal", modify
                  label values Immdecrease_W10 Immdecrease_W10
                  label def Immdecrease_W10 0 "No", modify
                  label def Immdecrease_W10 1 "Decreased", modify
                  label values F_SEX_FINAL F_SEX_FINAL
                  label def F_SEX_FINAL 1 "Male", modify
                  label def F_SEX_FINAL 2 "Female", modify
                  *Below is code to give you idea of how I did the multiple imputation for the above data.

                  mi extract 0, clear

                  mi set mlong

                  *This command identifies which variables in the imputation model don't have missing information, didn't include those that were subset of others.
                  *I don't actually use this variable in the below syntax asdoc examples-but wasn't sure what would happen if I don't register any variables without missing data in this hypothetical example.

                  mi register regular F_SEX_FINAL

                  *This command identifies which variables in the imputation model has missing information.
                  mi register imputed IMMVALA_W23R ST7_W10R ST3_W10R ST8A_W10R ST8C_W10R ST8D_W10R

                  mi impute chained (ologit) IMMVALA_W23R (ologit) ST7_W10R (ologit) ST3_W10R (ologit) ST8A_W10R (ologit) ST8C_W10R (ologit) ST8D_W10R (ologit)[pweight = WEIGHT_W10], add(25) rseed (53421) augment force

                  *After imputing the missing data, then I recode into what I need.

                  *Recoded these imputed immigration attitudes into a mean scale.
                  recode ST3_W10R (1 = -1 "Make American society better in the long run")(2 = 1 "Make American society worse in the long run")(3=0 "Don't have much of an effect"), gen(ST3scale_W10)

                  recode ST8A_W10R (1 = -1 "Immigrants are making things better") (2 = 1 "Immigrants are making things worse") (3=0 "Don't have much of an effect"), gen(ST8Ascale_W10)

                  recode ST8C_W10R (1 = -1 "Immigrants are making things better") (2 = 1 "Immigrants are making things worse") (3=0 "Don't have much of an effect"), gen(ST8Cscale_W10)

                  recode ST8D_W10R (1 = -1 "Immigrants are making things better") (2 = 1 "Immigrants are making things worse") (3=0 "Don't have much of an effect"), gen(ST8Dscale_W10)

                  *Mean scale for all 4 items: ImmWorseScale_W10 where higher values indicate more threat but also averaged across all 4.

                  *Value ranges from -1 (all responses are immigrants make things better for all 4) to 1 (all responses are immigrants make things worse).
                  gen ImmWorseScale_W10 = (ST3scale_W10 + ST8Ascale_W10 + ST8Cscale_W10 + ST8Dscale_W10)/ 4


                  *ST7R to Binary, immigration should be decreased; those who think remain at present level or be increased increased are combined.
                  recode ST7_W10R (1 = 0 "No")(2 = 0 "No")(3 = 1 "Decreased"), gen(Immdecrease_W10)


                  *Continuous variable with very important as high and not at all important as low, I've checked it out-doesn't matter if lowest value is 1 or 0; regression results are the same with this var.

                  recode IMMVALA_W23R (1 = 4 "Very important goal")(2 = 3 "Somewhat important goal")(3=2 "Not too important") (4=1 "Not at all important"), gen(REFUGEES_cont_W23)


                  *The next command works fine for me.

                  mi estimate: regress REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10

                  *This next command works fine for me, too. Note that I shouldn't use logistic for this analysis given how REFUGEES_scale_W23 is coded, but it shows me that this asdoc mi estimate syntax works.

                  asdoc mi estimate, or: logistic REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10

                  *However, the next command-which is what I really want to run---produces an error ("variable estimate not found").

                  asdoc mi estimate: regress REFUGEES_scale_W23 ImmWorseScale_W10 Immdecrease_W10


                  I hope that this runs for you, Professor Shah. If not, I will try again with another example.

                  Thanks for the time that you've dedicated to asdoc and to advising users.

                  Sincerely,
                  Eileen Díaz McConnell

                  Comment


                  • #54
                    Thanks for the detailed example. However, you have not included many variables in the example dataset, but down the road, you do use them in the codes. Therefore, many commands fail. See, for example, this line of code
                    Code:
                    . mi register imputed IMMVALA_W23R ST7_W10R ST3_W10R ST8A_W10R ST8C_W10R ST8D_W10R
                    variable ST3_W10R not found
                    r(111);
                    Similar is the case with some other variables. Given that, I shall use an example from the Stata manual for mi commands. Since you get an error message for the sub-command estimate, my example is based on this sub-command

                    Code:
                    webuse mheart1s20
                    mi estimate: logit attack smokes age bmi hsgrad female
                    
                    * IF we use asdoc with the second line, we shall get an error: 
                    
                    asdoc mi estimate: logit attack smokes age bmi hsgrad female, replace
                    
                    variable estimate not found
                    r(111);
                    This happens due to parsing error at asdoc's end, which I shall work on in the subsequent updates. For time being, there is a good news. we can replay the mi estimates without having to repeat the full command. So if we type:

                    Code:
                     asdoc mi estimate, replace
                    it does the trick and asdoc will export the mi estimates to a word file. So the solution is to first estimate the mi commands without using asdoc in the prefix, and then on the subsequent line, add asdoc to mi estimate, i.e.

                    Code:
                     mi estimate: logit attack smokes age bmi hsgrad female
                    asdoc mi estimate, replace
                    Regards
                    --------------------------------------------------
                    Attaullah Shah, PhD.
                    Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                    www.FinTechProfessor.com
                    If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word

                    Comment


                    • #55
                      Professor Shah:

                      Thanks so much for looking into this! I was on another project and just came back to check on this now. Yes, in the interest of providing a simple example, I didn't provide all that was needed. Sorry.

                      However, I appreciate your taking the time to discover how to do this with another example. It worked perfectly!

                      Also, running "asdoc mi estimate, append" also works so that I can just append rather than replace.

                      Asdoc is such a time saver. Thank you.
                      Eileen

                      Comment


                      • #56
                        EdieMMM Thanks for using your real name Eileen Díaz McConnell as signature.

                        Back in #48 you said "I registered this account a long time ago, and I can't change my user name to my real name without setting up a new account". It is true that you can't do that unilaterally, but we explain what to do in your situation in the FAQ Advice which all are asked to read before posting.

                        https://www.statalist.org/forums/help#realnames

                        You are asked to post on Statalist using your full real name, including given name(s) and a family name, such as "Ronald Fisher" or "Gertrude M. Cox". Giving full names is one of the ways in which we show respect for others and is a long tradition on Statalist. It is also much easier to get to know people when real names are used.

                        If you overlook this on first registration, it is easy to fix. Click on “Contact us” located at the bottom right-hand corner of every page.
                        -- and send a message to the list administrators

                        Comment


                        • #57
                          Dear Professor Shah,

                          Thank you so much for your sharing. Your program is useful.

                          I have problem with tabulate ttest ( Return=0) result in one table such as below (I input result manually one by one).

                          ttest R0==0 if Y==2009
                          ttest R1==0 if Y==2009
                          ttest R2==0 if Y==2009
                          ttest R3==0 if Y==2009

                          ttest R0==0 if Y==2010
                          ttest R1==0 if Y==2010
                          ttest R2==0 if Y==2010
                          ttest R3==0 if Y==2010

                          ttest R0==0 if Y==2011
                          ttest R1==0 if Y==2011
                          ttest R2==0 if Y==2011
                          ttest R3==0 if Y==2011

                          ttest R0==0 if Y==2012
                          ttest R1==0 if Y==2012
                          ttest R2==0 if Y==2012
                          ttest R3==0 if Y==2012

                          Year Simulation Return (R)
                          0 1 2 3
                          2009 3 0.60 0.64 0.46 0.71
                          (4.55) (3.72) (1.04) (3.26)
                          2010 24 0.71 0.90 0.21 0.47
                          (1.29) (1.64) (0.87) (2.67)
                          2011 12 0.76 1.15 1.32 1.43
                          (1.1) (1.77) (1.98) (1.84)
                          2012 37 0.14 -0.13 -0.28 -0.26
                          (0.74) (-0.63) (-1.04) (-0.99)
                          Could you give some advices how to make it automatically?

                          This is the dataset:
                          R0 R1 R2 R3 Y
                          0.004425 0.004425 -0.00405 0.003564 2009
                          0.008808 0.010064 0.007259 0.006972 2009
                          0.005156 0.005156 0.010822 0.011238 2009
                          3.86E-05 -0.00165 -0.00303 -0.0049 2010
                          0.009852 0.009852 -0.00301 -0.00524 2010
                          0.0015 0.0015 -0.00666 -0.01387 2010
                          -0.00061 -0.00045 -0.00055 0.000237 2010
                          0.000747 0.000111 9.55E-05 0.001138 2010
                          0.000771 -0.00015 -0.00031 0.003995 2010
                          -0.00045 -0.00103 -0.00058 -0.00058 2010
                          0.135216 0.135216 -0.00072 -0.00072 2010
                          0.00053 0.000837 0.001047 -0.00249 2010
                          0.001989 0.003614 0.001432 0.001534 2010
                          0 0 0.008254 0.004437 2010
                          -0.00266 -0.00559 -0.00494 -0.00229 2010
                          0.005174 0.005418 0.015735 0.006711 2010
                          0.004269 0.004468 0.004966 0.005369 2010
                          0.008148 0.00438 -0.0419 0.005287 2010
                          0.003946 0.007096 0.009817 0.015561 2010
                          -0.00291 -0.00168 0.013342 0.019813 2010
                          -0.00099 0.000613 0.003765 0.005096 2010
                          -0.00095 -0.0005 0.007085 0.005976 2010
                          0.003266 0.004288 0.007994 0.007191 2010
                          0.006183 0.013831 -0.00515 0.003334 2010
                          -0.00122 0.008168 0.008705 0.01362 2010
                          -0.00036 0.011534 0.011966 0.017126 2010
                          0.000918 0.0157 0.016885 0.021647 2010
                          -0.01485 -0.01605 -0.01102 -0.00409 2011
                          0.000353 0.002384 0.007114 0.017022 2011
                          1.17E-05 -0.00186 0.009004 0.019676 2011
                          -0.00164 0.000718 -5.2E-05 -0.00014 2011
                          -3.51E-06 0.007894 0.003445 0.002757 2011
                          -0.01009 0.016026 0.008748 -0.0063 2011
                          -0.01611 -0.01043 -0.01148 -0.02287 2011
                          0.003555 0.005695 0.011899 0.015045 2011
                          0.011543 0.011453 0.013921 0.013737 2011
                          0.022187 0.019799 0.020925 0.022505 2011
                          0.018536 0.022491 0.019312 0.02012 2011
                          0.059238 0.057683 0.063242 0.070793 2011
                          0.008285 -3.1E-05 0.008224 0.00866 2012
                          -0.00331 -0.0031 -0.00147 0.000799 2012
                          -0.00205 -0.00235 0.003518 0.004122 2012
                          0 0.003083 -0.0041 -0.00099 2012
                          -0.01974 -0.02148 -0.02653 -0.0282 2012
                          0.011725 0.002618 0.006607 0.004391 2012
                          -0.01294 -0.02402 -0.02916 -0.02916 2012
                          -0.00598 -0.01672 -0.03051 -0.03051 2012
                          -0.0296 -0.03694 -0.05805 -0.05805 2012
                          0.002149 -0.01434 -0.03187 -0.03187 2012
                          -0.01341 -0.02352 -0.02146 -0.01403 2012
                          0.011682 0.005818 -0.00138 0.004351 2012
                          0.011756 0.011676 0.009072 0.006166 2012
                          -0.00031 0.000313 -0.00034 -0.0019 2012
                          0.000194 -0.00158 -0.00173 -0.00393 2012
                          7.53E-05 -0.00208 -0.0017 -0.0035 2012
                          0.000211 0.002246 0.001557 -0.00141 2012
                          -0.00077 -0.00075 0.004118 0.000237 2012
                          0.004429 0.004351 0.001652 0.001553 2012
                          3.74E-05 -0.0042 -0.00712 0.000216 2012
                          -0.00048 -0.00667 -0.00961 -0.00332 2012
                          0.027808 0.029803 0.030471 0.026713 2012
                          0.001292 -0.00982 -0.01935 -0.02156 2012
                          0.034735 0.035506 0.036004 0.029923 2012
                          -4E-05 0.000618 0.00168 0.004501 2012
                          -0.00413 0.001406 0.003677 0.005576 2012
                          -0.00017 -0.00331 -0.00124 0.002687 2012
                          -0.00647 -0.00068 -0.00055 -0.00151 2012
                          0.025387 -0.00014 0.000211 -0.00081 2012
                          -0.00044 0.000535 -0.00017 0.001077 2012
                          0.000138 0.000409 0.000608 0.003371 2012
                          -0.01455 -0.00714 -0.00626 -0.00299 2012
                          0.002515 0.005503 0.005963 0.005356 2012
                          -0.00048 0.010277 0.013698 0.011827 2012
                          0.022686 0.010046 0.009247 0.004038 2012
                          0.011724 0.012328 0.006248 0.000934 2012
                          0.001843 0.004669 0.011857 0.016241 2012

                          Thank you.

                          Kind regards,
                          Wawan Sugiyarto

                          Comment


                          • #58
                            Wawan Sugiyarto Today, I had some time so wrote this blog post to show the use of asdoc with ttest. The post uses your data. The output shown there is the standard output generated by asdoc with ttest command. If you need a more customized table, you can explore the row() option of asdoc, further details can be found in the help file of asdoc and in this blog post.
                            Regards
                            --------------------------------------------------
                            Attaullah Shah, PhD.
                            Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                            www.FinTechProfessor.com
                            If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word

                            Comment


                            • #59
                              this is very useful command. i was in search of this command and after days this post solved my problem. this is highly appreciated Professor Ataullah Shah. i just tried it for descriptive statistics and worked. then i tried it for correlation but stata issued an error message.

                              (File Myfile.doc already exists, option append was assumed)
                              file Myfile.doc could not be opened for read/write
                              fopen(): 603 file could not be opened
                              append(): - function returned error
                              <istmt>: - function returned error
                              r(603);

                              Comment


                              • #60
                                issue resolved i just copied that table in another word doc and unsaved it from my.doc

                                Comment

                                Working...
                                X