Announcement

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

  • How to create a professional table to word for thesis or for journal presentation

    Hi family,
    I hope we are doing well?

    I have a data that I want to present the descriptive statistics like frequency in Just one single table contains 2 or more variables.
    Below is the command I tried using but it still presented the table as individual variable. this is the command I used.

    asdoc tab1 b2 b4 c7 c8, append save(newsham)

    I need your help to be able to produce just one table with 4 cariables.

    Thank you.
    Sham.
    I attached the data example.
    clear
    input byte(Gender telfon schl)
    2 2 2
    1 2 2
    1 2 2
    1 2 2
    1 2 1
    1 2 2
    2 2 1
    1 2 2
    1 2 2
    1 2 2
    1 2 2
    2 2 2
    1 2 2
    2 2 2
    1 2 2
    1 2 2
    1 2 1
    1 1 1
    2 2 2
    end
    label values Gender B2
    label def B2 1 "Male", modify
    label def B2 2 "Female", modify
    label values telfon C7
    label def C7 1 "Yes", modify
    label def C7 2 "No", modify
    label values schl C8
    label def C8 1 "Yes", modify
    label def C8 2 "No", modify
    [/CODE]

  • #2
    Assuming you are using version 18 (you are supposed to say what version of Stata you are using if it is not the current one)
    Code:
    dtable i.(Gender telfon schl)
    The -dtable- command also includes many options that you can use to customize the look of the table.

    It also has options for exporting to a variety of text-processing software packages.

    Comment


    • #3
      Hi Clyde,
      I am using Stata16 please
      Thank you

      Comment


      • #4
        Going back to version 16, there were numerous official Stata commands for tabulating data, but none that would produce the kind of output you are looking for. There are a number of user-written commands that did this. The one I used to use back then was Mark Chatfield's table1_mc, available from SSC. I no longer remember the syntax for this command, but it is explained in the help file.

        Comment


        • #5
          Alight thank you sir.
          I have gone through.
          I tried the command it works but in saving the table to word using the command generates an error that i find it difficult to understand. I read over the help but still not finding solution.
          example


          asdoc table1_mc, by( Gender ) vars( schl cat \ telfon cat) onecol nospace, save(shamdeen)
          Gives an error ("invalid 'by')

          However, if I run only the stata output command like below; it gives me the desire results.


          table1_mc, by( Gender ) vars( schl cat \ telfon cat) onecol nospace

          I do appreciate your guide.

          Thank you once again.
          Still trying to organize my self and get the version 18 though.

          Comment

          Working...
          X