-
Login or Register
- Log in with
| make | foreign | _freq |
| AMC Concord | Domestic | 1 |
| AMC Pacer | Domestic | 1 |
| AMC Spirit | Domestic | 1 |
| Audi 5000 | Foreign | 1 |
| Audi Fox | Foreign | 1 |
| BMW 320i | Foreign | 1 |
| Buick Century | Domestic | 1 |
| Buick Electra | Domestic | 1 |
| Buick LeSabre | Domestic | 1 |
| Buick Opel | Domestic | 1 |
| Buick Regal | Domestic | 1 |
| Buick Riviera | Domestic | 1 |
| Buick Skylark | Domestic | 1 |
| Cad. Deville | Domestic | 1 |
| Cad. Eldorado | Domestic | 1 |
| Cad. Seville | Domestic | 1 |
| Chev. Chevette | Domestic | 1 |
| Chev. Impala | Domestic | 1 |
| Chev. Malibu | Domestic | 1 |
| Chev. Monte Carlo | Domestic | 1 |
| Chev. Monza | Domestic | 1 |
| Chev. Nova | Domestic | 1 |
| Datsun 200 | Foreign | 1 |
| Datsun 210 | Foreign | 1 |
| Datsun 510 | Foreign | 1 |
| Datsun 810 | Foreign | 1 |
| Dodge Colt | Domestic | 1 |
| Dodge Diplomat | Domestic | 1 |
| Dodge Magnum | Domestic | 1 |
| Dodge St. Regis | Domestic | 1 |
| Fiat Strada | Foreign | 1 |
| Ford Fiesta | Domestic | 1 |
| Ford Mustang | Domestic | 1 |
| Honda Accord | Foreign | 1 |
| Honda Civic | Foreign | 1 |
| Linc. Continental | Domestic | 1 |
| Linc. Mark V | Domestic | 1 |
| Linc. Versailles | Domestic | 1 |
| Mazda GLC | Foreign | 1 |
| Merc. Bobcat | Domestic | 1 |
| Merc. Cougar | Domestic | 1 |
| Merc. Marquis | Domestic | 1 |
| Merc. Monarch | Domestic | 1 |
| Merc. XR-7 | Domestic | 1 |
| Merc. Zephyr | Domestic | 1 |
| Olds 98 | Domestic | 1 |
| Olds Cutl Supr | Domestic | 1 |
| Olds Cutlass | Domestic | 1 |
| Olds Delta 88 | Domestic | 1 |
| Olds Omega | Domestic | 1 |
| Olds Starfire | Domestic | 1 |
| Olds Toronado | Domestic | 1 |
| Peugeot 604 | Foreign | 1 |
| Plym. Arrow | Domestic | 1 |
| Plym. Champ | Domestic | 1 |
| Plym. Horizon | Domestic | 1 |
| Plym. Sapporo | Domestic | 1 |
| Plym. Volare | Domestic | 1 |
| Pont. Catalina | Domestic | 1 |
| Pont. Firebird | Domestic | 1 |
| Pont. Grand Prix | Domestic | 1 |
| Pont. Le Mans | Domestic | 1 |
| Pont. Phoenix | Domestic | 1 |
| Pont. Sunbird | Domestic | 1 |
| Renault Le Car | Foreign | 1 |
| Subaru | Foreign | 1 |
| Toyota Celica | Foreign | 1 |
| Toyota Corolla | Foreign | 1 |
| Toyota Corona | Foreign | 1 |
| VW Dasher | Foreign | 1 |
| VW Diesel | Foreign | 1 |
| VW Rabbit | Foreign | 1 |
| VW Scirocco | Foreign | 1 |
| Volvo 260 | Foreign | 1 |
capture program drop tbl2putdocx
program tbl2putdocx
qui{
version 15
syntax anything(id="arglist")
preserve
capture decode `1', gen(dec`1')
if _rc {
gen dec`1' = `1'
}
tab dec`1'
putdocx table dec`1'_sector = (`r(r)',2)
levelsof dec`1', local(row_names)
local count = 1
qui foreach lev in `row_names' {
putdocx table dec`1'_sector(`count',1) = ("`lev'")
count if dec`1' == "`lev'"
local curcnt = `r(N)'
putdocx table dec`1'_sector(`count',2) = ("`curcnt'")
local count = `count' + 1
}
restore
}
end
clear all
sysuse auto
capture putdocx clear
putdocx begin
putdocx paragraph, style(Title)
putdocx text ("Here is a demonstration of -tbl2putdocx-")
putdocx paragraph
putdocx text ("Here is some text for demonstration purposes. Followed by a table:")
tbl2putdocx foreign
putdocx paragraph
putdocx text ("Here is some text for demonstration purposes. Followed by a table from a different data set:")
use http://www.stata-press.com/data/r15/nlswork.dta, clear
tbl2putdocx race
putdocx paragraph
putdocx text ("For good measure, one last example. Followed by three tables from a third different data set:")
sysuse bplong.dta, clear
tbl2putdocx when
tbl2putdocx sex
tbl2putdocx agegrp
putdocx save "StataListDemo.docx", replace
Comment