Announcement

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

  • Tabout and Fre suddenly not working?

    For some reason when I export frequency tables to excel and/or word (as .csv or .rtf files), they aren't formatting into neat columns and rows properly. I'm re-running code that has worked before, so I'm quite puzzled. I've tried using -fre- and -tabout- and gotten the same results. Strangely -esttab- is still working fine. Does anybody have any ideas?

  • #2
    I am responding to your title.

    My best guess on this information is that you are using a different installation of Stata on which estout has been installed but not tabout or fre.

    My second best guess is that someone installed tabout or fre in a non-standard place and a change of directory has rendered them invisible to Stata.

    NB: these are all community-contributed commands, and by FAQ Advice #12, you are asked to say where they come from.

    In Stata you can type

    Code:
    which tabout 
    
    which fre
    and independently you can use your operating system to search for

    Code:
    tabout.ado 
    fre.ado
    on your set-up.

    The rest of your question I can't answer.

    For some reason when I export frequency tables to excel and/or word (as .csv or .rtf files), they aren't formatting into neat columns and rows properly.
    as you don't say anything about how you are doing that.

    Comment


    • #3
      Stata 14.2, 64 bit.

      pwd indicates that the directory is the desktop: C:\Users\nburroughs\Desktop
      estout, tabout, and fre are all installed in C:\ado\plus files (listed in folders by letter of the program). they were installed using ssc install command.

      Program is quite simple:
      import excel "C:\Users\nburroughs\Desktop\data.xlsx", sheet("Sheet1") firstrow clear
      fre Q1 Q2 Q3 Q4 Q5 Q6 using C:\Users\nburroughs\Desktop\output\test1.csv, replace

      Output for Q1 looks like this...
      Q1
      Freq. Percent Valid Cum.
      Valid 4 2 8.33 10.00 10.00
      5 18 75.00 90.00 100.00
      Total 20 83.33 100.00
      Missing . 4 16.67
      Total 24 100.00
      A week or so ago I ran it and it looked like this...(data is different because it's from a different question, but you get the idea)
      Q1a
      Freq. Percent Valid Cum.
      Valid 1 14 36.84 100 100
      Missing . 24 63.16
      Total 38 100

      Comment


      • #4
        Sorry, I misread your question as saying that you couldn't get fre or tabout to work at all. I was reading your title too literally.

        But that's not what you're saying. The complaint is about how output looks when exported.

        Unfortunately, what you're showing here leaves quite open exactly how output looks, e.g. I see no way of knowing what are spaces, tabs, etc. and what appears in the same column or in different columns. And are you talking about Excel or Word or both?

        You'll realise that we don't have a copy of your spreadsheet file. I think anyone who exports tables to Excel or Word in this way (not me) needs a reproducible example.

        This appears to be equivalent data for Q1

        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input float Q1
        4
        4
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        5
        .
        .
        .
        .
        end

        What I can see here is that you are using fre to produce a csv file. I can't follow what you are doing beyond that.

        I am just trying to nudge the thread forward. I don't do this kind of thing and may well have nothing further to add. Hope this helps, one way or another.

        Comment


        • #5
          Welcome to Statalist.

          I wonder if we are even correctly seeing what you are seeing. Usually when posting code and results you should use code tags, like Nick did. See Pt 12 of the FAQ, asking questions effectively.

          I assume you are on the same machine? Can you rerun with the exact same data you had last week?
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Apologies this is my first time using the forum so I'm still getting the hang of it.

            My purpose in using -fre- and/or -tabout- is to produce usable frequency tables in excel rather than the html text Stata produces by default. I thought I had solved the difficulty in producing multiple frequency tables with one command. However, whereas a couple of weeks ago the code I was running produced nicely formatted tables (with different data points in different columns), now the outputs are back to unformatted results.

            Yes I re-ran the same code with the same data on the same machine. It's very odd.

            Comment

            Working...
            X