楼主: zhyree
1678 4

[编程问题求助] 【新手求助】为什么输入list rate amountUSD if rate==6.7744没反应 [推广有奖]

  • 0关注
  • 0粉丝

高中生

65%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0.1650
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
88 点
帖子
10
精华
0
在线时间
49 小时
注册时间
2017-3-7
最后登录
2021-5-2

楼主
zhyree 发表于 2017-8-17 10:38:05 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
不知道发在这个主题有没有问题我发现我输入的任何指令,只要跟if rate==某个数值有关,都会没有反应
具体见图
10000.png 20000.png 30000.png

二维码

扫码加我 拉你入群

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

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

关键词:amount Rate 新手求助 list ATE

沙发
黃河泉 在职认证  发表于 2017-8-17 11:13:31
建議用 dataex (先 ssc install dataex 并见说明) 将原始 Stata 资料中具有”代表性”的一部分资料列出,以供有意回答者实验之用,并能提供具体操作指令。

藤椅
zhyree 发表于 2017-8-17 11:55:57
请问是提供这个吗? 1.dta (4.74 KB)

板凳
蓝色 发表于 2017-8-17 12:25:02
list   if rate=float(6.7744)




Programming function

    float(x)
       Domain:       -1e+38 to 1e+38
       Range:        -1e+38 to 1e+38
       Description:  returns the value of x rounded to float precision.

                     Although you may store your numeric variables as byte, int, long,
                     float, or double, Stata converts all numbers to double before
                     performing any calculations.  Consequently, difficulties can arise in
                     comparing numbers that have no finite binary representations.

                     For example, if the variable x is stored as a float and contains the
                     value 1.1 (a repeating "decimal" in binary), the expression x==1.1
                     will evaluate to false because the literal 1.1 is the double
                     representation of 1.1, which is different from the float
                     representation stored in x.  (They differ by 2.384 x 10^(-8).) The
                     expression x==float(1.1) will evaluate to true because the float()
                     function converts the literal 1.1 to its float representation before
                     it is compared with x. (See [U] 13.11 Precision and problems therein
                     for more information.)


报纸
zhyree 发表于 2017-8-17 13:43:46
蓝色 发表于 2017-8-17 12:25
list   if rate=float(6.7744)
明白了!谢谢大神!

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-4 13:41