Stata无法正确读取我的Excel表格

时间:2016-06-13 12:36:36

标签: excel stata

我必须与Stata合作。我在Excel中获得了所有必要的数据,但是当我将它们导入Stata时,会显示一些数据(与sum命令一样),有些数据将是no observationsnot found。我得到了这些输出

. summarize

    Variable |       Obs        Mean    Std. Dev.       Min        Max
total_assets |      2576    66822.33    236144.5      630.8    2573126
   employees |      2570    67.61437    160.5821       .175       2200
changeofwo~e |         0
employeedo~g |         0
   netincome |      2575    1683.551    4054.371     -99289      26895
     revenue |      2575    22475.59    40565.01  -4234.472     483521
         ROA |      2576    .0607231    .0734222  -.8526002   .5033718
 changeinROA |         0
           L |         0
           M |         0

. describe

Contains data
  obs:         2,577                          
 vars:            13                          
 size:       224,199                          
-----------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label

firm_ID         int    %10.0g                 firm_ID
gvkey           long   %10.0g                 gvkey
fiscal_year     int    %10.0g                 fiscal_year
total_assets    double %10.0g                 total_assets
employees       double %10.0g                 employees
changeofworkf~e str18  %18s                   change of workforce
employeedowns~g str1   %9s                    employee downsizing
netincome       double %10.0g                 netincome
revenue         double %10.0g                 revenue
ROA             double %6.4f                  ROA
changeinROA     str18  %18s                   change in ROA
L               byte   %10.0g                 
M               byte   %10.0g                 
-
Sorted by:  
     Note:  dataset has changed since last saved



. sum ROA

    Variable |       Obs        Mean    Std. Dev.       Min        Max
         ROA |      2576    .0607231    .0734222  -.8526002   .5033718

. sum changeofworkforce

    Variable |       Obs        Mean    Std. Dev.       Min        Max
changeofwo~e |         0

changeinROAemployeedownsizing也是如此。

进一步编辑:

. tab downsizing

 downsizing |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      2,168       84.19       84.19
          1 |        407       15.81      100.00
------------+-----------------------------------
      Total |      2,575      100.00

1 个答案:

答案 0 :(得分:1)

你的一些变量,即

changeofwo~e 
employeedo~g 
 changeinROA 

被读作string个变量。如果您认为它们应该是数字,您可以尝试destring(请参阅其选项帮助)。无论如何,像这样的命令

tab changeinROA if missing(real(changeinROA)) 

将显示哪些值阻止Stata将其读取为数字(如果您认为应该是这样)。

employeedownsizing可能是变量编码的Y / N,或者某些是yes或no。

LM只是缺少值并且不包含任何数据。