Announcement

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

  • Table of countries in panel data

    Dear users,

    For my thesis, I am looking to export a table from Stata consisting of all the countries in my panel data which have data for all my five variables. When I do list if var1!=. & var2!=. etc. I get the list of countries, however, there are duplicates in the countries and I cannot turn it into a table that I can export to Word.

    What is the way to do this?

    Thank you in advance.

  • #2
    Maybe something like this?

    Code:
    ssc install fre, replace
    fre countryvar if !missing(VAR1, VAR2, VAR3) using allcountries, replace
    Then open the file in Excel / Calc and export to word.
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      Felix Bittmann 's solution hinges on installing a community-contributed command and using Excel as well as Word.

      This should be easier than that.

      Here is some other technique.

      Code:
      . sysuse auto
      (1978 Automobile Data)
      
      . egen tag = tag(make) if !missing(foreign, rep78)
      
      . list make if tag, noobs sep(0)
      
        +-------------------+
        | make              |
        |-------------------|
        | AMC Concord       |
        | AMC Pacer         |
        | Buick Century     |
        | Buick Electra     |
        | Buick LeSabre     |
        | Buick Regal       |
        | Buick Riviera     |
        | Buick Skylark     |
        | Cad. Deville      |
        | Cad. Eldorado     |
        | Cad. Seville      |
        | Chev. Chevette    |
        | Chev. Impala      |
        | Chev. Malibu      |
        | Chev. Monte Carlo |
        | Chev. Monza       |
        | Chev. Nova        |
        | Dodge Colt        |
        | Dodge Diplomat    |
        | Dodge Magnum      |
        | Dodge St. Regis   |
        | Ford Fiesta       |
        | Ford Mustang      |
        | Linc. Continental |
        | Linc. Mark V      |
        | Linc. Versailles  |
        | Merc. Bobcat      |
        | Merc. Cougar      |
        | Merc. Marquis     |
        | Merc. Monarch     |
        | Merc. XR-7        |
        | Merc. Zephyr      |
        | Olds 98           |
        | Olds Cutl Supr    |
        | Olds Cutlass      |
        | Olds Delta 88     |
        | Olds Omega        |
        | Olds Starfire     |
        | Olds Toronado     |
        | Plym. Arrow       |
        | Plym. Champ       |
        | Plym. Horizon     |
        | Plym. Volare      |
        | Pont. Catalina    |
        | Pont. Firebird    |
        | Pont. Grand Prix  |
        | Pont. Le Mans     |
        | Pont. Sunbird     |
        | Audi 5000         |
        | Audi Fox          |
        | BMW 320i          |
        | Datsun 200        |
        | Datsun 210        |
        | Datsun 510        |
        | Datsun 810        |
        | Fiat Strada       |
        | Honda Accord      |
        | Honda Civic       |
        | Mazda GLC         |
        | Renault Le Car    |
        | Subaru            |
        | Toyota Celica     |
        | Toyota Corolla    |
        | Toyota Corona     |
        | VW Dasher         |
        | VW Diesel         |
        | VW Rabbit         |
        | VW Scirocco       |
        | Volvo 260         |
        +-------------------+
      
      . list make if tag, noobs sep(0) noheader
        +-------------------+
        | AMC Concord       |
        | AMC Pacer         |
        | Buick Century     |
        | Buick Electra     |
        | Buick LeSabre     |
        | Buick Regal       |
        | Buick Riviera     |
        | Buick Skylark     |
        | Cad. Deville      |
        | Cad. Eldorado     |
        | Cad. Seville      |
        | Chev. Chevette    |
        | Chev. Impala      |
        | Chev. Malibu      |
        | Chev. Monte Carlo |
        | Chev. Monza       |
        | Chev. Nova        |
        | Dodge Colt        |
        | Dodge Diplomat    |
        | Dodge Magnum      |
        | Dodge St. Regis   |
        | Ford Fiesta       |
        | Ford Mustang      |
        | Linc. Continental |
        | Linc. Mark V      |
        | Linc. Versailles  |
        | Merc. Bobcat      |
        | Merc. Cougar      |
        | Merc. Marquis     |
        | Merc. Monarch     |
        | Merc. XR-7        |
        | Merc. Zephyr      |
        | Olds 98           |
        | Olds Cutl Supr    |
        | Olds Cutlass      |
        | Olds Delta 88     |
        | Olds Omega        |
        | Olds Starfire     |
        | Olds Toronado     |
        | Plym. Arrow       |
        | Plym. Champ       |
        | Plym. Horizon     |
        | Plym. Volare      |
        | Pont. Catalina    |
        | Pont. Firebird    |
        | Pont. Grand Prix  |
        | Pont. Le Mans     |
        | Pont. Sunbird     |
        | Audi 5000         |
        | Audi Fox          |
        | BMW 320i          |
        | Datsun 200        |
        | Datsun 210        |
        | Datsun 510        |
        | Datsun 810        |
        | Fiat Strada       |
        | Honda Accord      |
        | Honda Civic       |
        | Mazda GLC         |
        | Renault Le Car    |
        | Subaru            |
        | Toyota Celica     |
        | Toyota Corolla    |
        | Toyota Corona     |
        | VW Dasher         |
        | VW Diesel         |
        | VW Rabbit         |
        | VW Scirocco       |
        | Volvo 260         |
        +-------------------+
      
      .
      Please use a real full name as requested!

      Comment


      • #4
        Originally posted by Nick Cox View Post
        Felix Bittmann 's solution hinges on installing a community-contributed command and using Excel as well as Word.

        This should be easier than that.

        Here is some other technique.

        Code:
        . sysuse auto
        (1978 Automobile Data)
        
        . egen tag = tag(make) if !missing(foreign, rep78)
        
        . list make if tag, noobs sep(0)
        
        +-------------------+
        | make |
        |-------------------|
        | AMC Concord |
        | AMC Pacer |
        | Buick Century |
        | Buick Electra |
        | Buick LeSabre |
        | Buick Regal |
        | Buick Riviera |
        | Buick Skylark |
        | Cad. Deville |
        | Cad. Eldorado |
        | Cad. Seville |
        | Chev. Chevette |
        | Chev. Impala |
        | Chev. Malibu |
        | Chev. Monte Carlo |
        | Chev. Monza |
        | Chev. Nova |
        | Dodge Colt |
        | Dodge Diplomat |
        | Dodge Magnum |
        | Dodge St. Regis |
        | Ford Fiesta |
        | Ford Mustang |
        | Linc. Continental |
        | Linc. Mark V |
        | Linc. Versailles |
        | Merc. Bobcat |
        | Merc. Cougar |
        | Merc. Marquis |
        | Merc. Monarch |
        | Merc. XR-7 |
        | Merc. Zephyr |
        | Olds 98 |
        | Olds Cutl Supr |
        | Olds Cutlass |
        | Olds Delta 88 |
        | Olds Omega |
        | Olds Starfire |
        | Olds Toronado |
        | Plym. Arrow |
        | Plym. Champ |
        | Plym. Horizon |
        | Plym. Volare |
        | Pont. Catalina |
        | Pont. Firebird |
        | Pont. Grand Prix |
        | Pont. Le Mans |
        | Pont. Sunbird |
        | Audi 5000 |
        | Audi Fox |
        | BMW 320i |
        | Datsun 200 |
        | Datsun 210 |
        | Datsun 510 |
        | Datsun 810 |
        | Fiat Strada |
        | Honda Accord |
        | Honda Civic |
        | Mazda GLC |
        | Renault Le Car |
        | Subaru |
        | Toyota Celica |
        | Toyota Corolla |
        | Toyota Corona |
        | VW Dasher |
        | VW Diesel |
        | VW Rabbit |
        | VW Scirocco |
        | Volvo 260 |
        +-------------------+
        
        . list make if tag, noobs sep(0) noheader
        +-------------------+
        | AMC Concord |
        | AMC Pacer |
        | Buick Century |
        | Buick Electra |
        | Buick LeSabre |
        | Buick Regal |
        | Buick Riviera |
        | Buick Skylark |
        | Cad. Deville |
        | Cad. Eldorado |
        | Cad. Seville |
        | Chev. Chevette |
        | Chev. Impala |
        | Chev. Malibu |
        | Chev. Monte Carlo |
        | Chev. Monza |
        | Chev. Nova |
        | Dodge Colt |
        | Dodge Diplomat |
        | Dodge Magnum |
        | Dodge St. Regis |
        | Ford Fiesta |
        | Ford Mustang |
        | Linc. Continental |
        | Linc. Mark V |
        | Linc. Versailles |
        | Merc. Bobcat |
        | Merc. Cougar |
        | Merc. Marquis |
        | Merc. Monarch |
        | Merc. XR-7 |
        | Merc. Zephyr |
        | Olds 98 |
        | Olds Cutl Supr |
        | Olds Cutlass |
        | Olds Delta 88 |
        | Olds Omega |
        | Olds Starfire |
        | Olds Toronado |
        | Plym. Arrow |
        | Plym. Champ |
        | Plym. Horizon |
        | Plym. Volare |
        | Pont. Catalina |
        | Pont. Firebird |
        | Pont. Grand Prix |
        | Pont. Le Mans |
        | Pont. Sunbird |
        | Audi 5000 |
        | Audi Fox |
        | BMW 320i |
        | Datsun 200 |
        | Datsun 210 |
        | Datsun 510 |
        | Datsun 810 |
        | Fiat Strada |
        | Honda Accord |
        | Honda Civic |
        | Mazda GLC |
        | Renault Le Car |
        | Subaru |
        | Toyota Celica |
        | Toyota Corolla |
        | Toyota Corona |
        | VW Dasher |
        | VW Diesel |
        | VW Rabbit |
        | VW Scirocco |
        | Volvo 260 |
        +-------------------+
        
        .
        Please use a real full name as requested!
        Exactly what I was looking for, thank you! Is there a possibility to widen the table with some command (such that it fits the width of a word document) or should one do this manually?

        Comment

        Working...
        X