Stata DTA File Viewer and Converter

Open a Stata .dta dataset to see its observations, variable and value labels, formatted dates and quick summaries, filter it and save it as Excel, CSV, SPSS, Stata or JSON.

ทำงานในเบราว์เซอร์ของคุณ ไฟล์ไม่ออกจากอุปกรณ์ ดูวิธีตรวจสอบ

…

วิธีทำ

  1. 1
    Open

    Load a .dta file of any version.

  2. 2
    Labels

    Show labels, codes or both.

  3. 3
    Dates

    Show %t values as dates or numbers.

  4. 4
    Filter

    Keep the observations you need.

  5. 5
    Export

    Save Excel, CSV, SAV, DTA or JSON.

เกี่ยวกับเครื่องมือนี้

The Stata DTA File Viewer and Converter opens Stata datasets in your browser without a Stata installation. It handles both families of the format: the older binary layout used by format numbers 104 to 115, which covers the releases up to Stata 12, and the tagged layout that begins with a stata_dta marker and is used by formats 117, 118 and 119 in Stata 13 and later, including files with more than 32,767 variables. Long strings stored as strLs are read, and value label tables are matched to the variables that use them. The figures at the top give the file name and size, the format number with the Stata release it belongs to, the time stamp saved in the file, the byte order (LSF for little endian, MSF for big endian), and the counts of observations and variables, with the dataset label shown as a note when there is one. Variables whose display format starts with %t are treated as dates. Daily %td values become dates such as 2023-04-02, clock values in %tc or %tC become date and time, and monthly and quarterly values appear in Stata's own style, such as 2023m4 or 2023q2. The Data tab shows the observations, the Variables tab lists names, labels, types and formats such as %10.0g or %7s, the Summary tab gives valid and missing counts with minimum, maximum, mean, median and standard deviation for plain numbers, and the Value labels tab lists each code and text. For a date variable the summary shows the earliest, latest and median date rather than a mean. You can choose to see value labels, the underlying codes or both, keep only certain columns, filter observations with simple rules, and stop reading after 1,000, 10,000 or 100,000 observations. Downloads are CSV, an Excel workbook, a new Stata file in format 118, an SPSS .sav file and JSON.

Who this is for

Economists and public health researchers sharing replication files, students who received a .dta file but work in SPSS, Excel or R, and data managers who need to check labels in a file from an older Stata release.

How to use it

1. Open a .dta file from any Stata release, or press Load a sample. 2. Pick labels, codes or both for labelled variables. 3. Choose whether %t variables appear as dates or stored numbers. 4. Narrow the observations with filter rules and the column list. 5. Download Excel, CSV, Stata, SPSS or JSON.

What the sample shows

The sample, labelled Car sample data, holds 6 observations of 5 variables saved in format 118: make, price, mpg, foreign and sold. The foreign variable uses value labels 0 Domestic and 1 Foreign, and sold is a %td date. Prices run from 3,799 to 9,690 with a mean of 5,736.67, a median of 5,268.5 and a standard deviation of 2,161.26. Mileage averages 19.83 mpg. Four cars are Domestic and two are Foreign, and the sale dates run from 2023-01-01 to 2023-08-11 with a median of 2023-04-26.

Filtering observations

Type price > 5000 in the filter box and the Data tab keeps 3 of 6 observations, Model D, Model E and Model F, while the summary mean price rises to 7,257.67. Rules use the operators =, !=, >, <, >=, <=, contains, starts with, is empty and is not empty, one rule per line, and every rule must match. You can refer to a variable by name or by its label, and labelled codes can be compared with either the code or the label text, so foreign = Foreign and foreign = 1 select the same cars.

Choosing an export

The CSV, Excel and JSON files contain the text shown in the Data tab, including label text and formatted dates, so set the label and date options before downloading. The Stata download writes format 118 with variable labels, value labels for whole-number codes and %td or %tc formats for dates. The SPSS download keeps variable labels and value labels, but dates are written as the stored Stata numbers, so set a date format in SPSS afterwards or export CSV instead.

Limits

Stata missing values, the plain dot and the extended codes .a to .z, all appear blank and are not told apart. Weekly and half-yearly date formats are shown as stored numbers. Notes, characteristics and sort order saved in the file are not shown. The summaries are descriptive only, and this tool is not statistical advice or a substitute for checking results in Stata.

ตัวอย่างพร้อมวิธีทำ

Car sample, 6 observations: price > 5000 keeps Models D, E and F with a mean price of 7,257.67.

สรุปสั้น ๆ

คำถามที่พบบ่อย

Which Stata versions can it read?

It reads the binary formats 104 to 115 and the tagged formats 117, 118 and 119, which together cover files from early Stata releases up to Stata 18.

Are value labels kept when I export?

Yes for Stata and SPSS downloads, which attach the labels to the codes. CSV, Excel and JSON contain whatever the Data tab shows, labels or codes.

How are Stata dates shown?

Daily %td values become dates like 2023-05-20, %tc values become date and time, and monthly or quarterly values appear as 2023m5 or 2023q2.

Why are some cells blank?

Blank cells are Stata missing values. The plain dot and the extended codes .a to .z are all shown blank.

Can I open a Stata 18 file without Stata?

Yes. Stata 14 to 18 normally save format 118, and very wide datasets use 119; both are read in the browser.

Does the SPSS export keep my dates?

Yes. Stata %td and %tc values are turned into SPSS seconds since 14 October 1582 and given a DATE or DATETIME format, so SPSS shows them as dates.

ฟรีทั้งหมดไม่มีค่าใช้จ่าย ไม่ต้องสมัคร
ไฟล์เป็นส่วนตัวทุกอย่างทำงานในเบราว์เซอร์ของคุณ
ใช้ง่ายในภาษาของคุณมีหลายภาษา