Announcement

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

  • Export dataset to LaTeX

    Dear Stata Users,

    I have a dataset below. I want to export the data to the latex as the following table:

    Where Total is 1) sum of (total_freq) 2) sum of (percentage) 3) equal to percent_similarity

    I can export such a table to latex manually, but I was wondering if it is possible to automate this. Thank you.
    transport total_freq percentage need_aid percent_similarity
    Plane A 4 0,01 0,00 0,08
    Plane C 7 0,02 0,00 0,08
    Plane D 10 0,02 0,10 0,08
    Car A 12 0,03 0,25 0,08
    Car B 23 0,05 0,09 0,08
    Car C 10 0,02 0,00 0,08
    Car D 20 0,05 0,10 0,08
    Total 86 0,20 0,08

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str40 transport float(total_freq percentage need_aid percent_similarity)
    "Plane A"  4  .00913242         0 .07762557
    "Plane C"  7 .015981736         0 .07762557
    "Plane D" 10  .02283105        .1 .07762557
    "Car A"   12  .02739726       .25 .07762557
    "Car B"   23  .05251142 .08695652 .07762557
    "Car C"   10  .02283105         0 .07762557
    "Car D"   20   .0456621        .1 .07762557
    end
Working...
X