|
auto1数据根本没有排序,auot数据是foreign排序的。
所以合并和sort无关,stata12.1 肯定是这样的
. use d:\temp\auto1
(1978 Automobile Data)
. des
Contains data from d:\temp\auto1.dta
obs: 74 1978 Automobile Data
vars: 2 12 Mar 2014 15:55
size: 1,480 (_dta has notes)
-----------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------------------
make str18 %-18s Make and Model
rep78 int %8.0g Repair Record 1978
-----------------------------------------------------------------------------------------------------------------------------
Sorted by:
. use d:\temp\auto
(1978 Automobile Data)
. des
Contains data from d:\temp\auto.dta
obs: 74 1978 Automobile Data
vars: 12 12 Mar 2014 15:55
size: 3,182 (_dta has notes)
-----------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------------------
make str18 %-18s Make and Model
price int %8.0gc Price
mpg int %8.0g Mileage (mpg)
rep78 int %8.0g Repair Record 1978
headroom float %6.1f Headroom (in.)
trunk int %8.0g Trunk space (cu. ft.)
weight int %8.0gc Weight (lbs.)
length int %8.0g Length (in.)
turn int %8.0g Turn Circle (ft.)
displacement int %8.0g Displacement (cu. in.)
gear_ratio float %6.2f Gear Ratio
foreign byte %8.0g origin Car type
-----------------------------------------------------------------------------------------------------------------------------
Sorted by: foreign
. drop rep78
. merge 1:1 make using D:\temp\auto1.dta
Result # of obs.
-----------------------------------------
not matched 0
matched 74 (_merge==3)
-----------------------------------------
. des
Contains data from d:\temp\auto.dta
obs: 74 1978 Automobile Data
vars: 13 12 Mar 2014 15:55
size: 3,256 (_dta has notes)
-----------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-----------------------------------------------------------------------------------------------------------------------------
make str18 %-18s Make and Model
price int %8.0gc Price
mpg int %8.0g Mileage (mpg)
headroom float %6.1f Headroom (in.)
trunk int %8.0g Trunk space (cu. ft.)
weight int %8.0gc Weight (lbs.)
length int %8.0g Length (in.)
turn int %8.0g Turn Circle (ft.)
displacement int %8.0g Displacement (cu. in.)
gear_ratio float %6.2f Gear Ratio
foreign byte %8.0g origin Car type
rep78 int %8.0g Repair Record 1978
_merge byte %23.0g _merge
-----------------------------------------------------------------------------------------------------------------------------
Sorted by: make
Note: dataset has changed since last saved
.
|