全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8012 10
2008-06-16
<p>复制过程没有问题,但是之后发现,默认的numeric datatype都是int,也就是说,超过984的数字都被报告为missing了。即使用命令改变datatype后,依然是missing。</p><p>请问有人遇到过类似情况吗?如何让默认存储的datatype变为double或float?</p>

[此贴子已经被作者于2008-6-16 0:31:23编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2008-6-16 01:32:00
先用StatTrasfer把excel转换为.dta文件,之后用data editor编辑就可以了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-16 09:23:00

可能是Excel的格式或者字体问题,改成默认的格式和字体试试

另外最好采用二楼的方法,省事而且高效

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-17 08:18:00
这个问题比较奇怪,int的范围应该是-32767到32740。而且从excel拷贝的时候stata应该会自动判断数据类型的。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-17 16:01:00

推荐 datatransfer 小巧,简单,实用。

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-17 17:09:00

Example 3. Reading a Microsoft Excel file through command lines

An Excel file can be loaded into Stata using odbc directly. Here is an example. Let's say we have an Excel file test.xls located in folder d:\data. It has two sheets in it, s1 and s2. We want to read the first sheet into Stata. We can use command odbc load for this task as shown below. Notice that we have to specify in full the type of the data file and the location of the data file in dsn option and we use table("s1$") for reading in the first sheet. Both the quotation marks and the dollar sign are necessary here for the table option and both dsn and table options are needed to load the entire data. Also notice that we have to clear up the memory first.

clear odbc load, dsn("Excel Files;DBQ=d:\data\test.xls") table("s1$")  desc
Contains data obs: 5 vars: 2 size: 100 (99.9% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- a double %10.0g b double %10.0g ------------------------------------------------------------------------------- Sorted by: Note: dataset has changed since last saved
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群