楼主: 小痴
8130 10

[其他] 求助:从Excel复制到data editor [推广有奖]

  • 1关注
  • 2粉丝

已卖:94份资源

本科生

65%

还不是VIP/贵宾

-

威望
0
论坛币
341 个
通用积分
2.8309
学术水平
7 点
热心指数
8 点
信用等级
2 点
经验
589 点
帖子
63
精华
0
在线时间
118 小时
注册时间
2005-4-6
最后登录
2024-2-26

楼主
小痴 发表于 2008-6-16 00:31:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
<p>复制过程没有问题,但是之后发现,默认的numeric datatype都是int,也就是说,超过984的数字都被报告为missing了。即使用命令改变datatype后,依然是missing。</p><p>请问有人遇到过类似情况吗?如何让默认存储的datatype变为double或float?</p>

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

二维码

扫码加我 拉你入群

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

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

关键词:editor EXCEL exce Edit Data double Excel 如何

回帖推荐

yueai 发表于9楼  查看完整内容

第一次复制粘贴后有很多的MISSING,你需要在STATA里面将所有的变量转化成字符型,命令是:TOSTRING 变量,REPLACE然后重新复制粘贴一次就可以了。很好用的!

wbzdwss 发表于8楼  查看完整内容

在excel中将单元格格式改为常规,然后保存为csv文件,然后用stata 打开:insheet using 存放目录\文件名.csv

wunshin0530 发表于7楼  查看完整内容

先將excel檔另存成文字檔(TAB字元分隔)在開啟STATA的FILE-import-ASCII data created by a spreadsheet 其中的第一欄BROWSE中檔案類型改成text檔即可打開將數據放入stata中

菜菜鸟 发表于6楼  查看完整内容

Example 3. Reading a Microsoft Excel file through command linesAn 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 ...

本帖被以下文库推荐

沙发
tyr1st 发表于 2008-6-16 01:32:00
先用StatTrasfer把excel转换为.dta文件,之后用data editor编辑就可以了

藤椅
eblog 发表于 2008-6-16 09:23:00

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

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

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

报纸
sokiyu 发表于 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

7
wunshin0530 发表于 2008-8-11 12:08:00
先將excel檔另存成文字檔(TAB字元分隔)在開啟STATA的FILE-import-ASCII data created by a spreadsheet 其中的第一欄BROWSE中檔案類型改成text檔即可打開將數據放入stata中

8
wbzdwss 发表于 2008-8-15 09:08:00

在excel中将单元格格式改为常规,然后保存为csv文件,然后用stata 打开:

insheet using 存放目录\文件名.csv

9
yueai 发表于 2008-9-16 17:57:00

第一次复制粘贴后有很多的MISSING,你需要在STATA里面将所有的变量转化成字符型,命令是:TOSTRING 变量,REPLACE

然后重新复制粘贴一次就可以了。很好用的!

10
frlxh_cn 发表于 2008-9-17 12:12:00

stat transfer

为何不用简单的呢

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-15 07:37