全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
18525 29
2016-02-23
请教:spss23运行倾向得分匹配出错,如下:
GET
  FILE='C:\Users\Administrator\Desktop\无标题2.sav'.
DATASET NAME 数据集1 WINDOW=FRONT.
* Propensity Score Matching.
begin program.
import spss, random, spssaux, codecs
try:
   import FUZZY
except:
   print "This procedure requires the FUZZY extension command which is not installed."
parts = [int(i) for i in FUZZY.__version__.split(".")]
if  parts < [1,3,0]:
   raise EnvironmentError("This procedure requires version 1.3.0 or later of FUZZY")
ds = spss.ActiveDataset()
if ds =="*":
   ds = "D" + str(random.random())
   spss.Submit("DATASET NAME " + ds)
ds = codecs.encode(ds)  # must use code page rep here
matchgroup = "M" + str(random.random())  #temporary variable
tempdsname = "D" + str(random.random())
lrcmd = spssaux.u(r"""LOGISTIC REGRESSION VARIABLES gourp
     /METHOD=ENTER x1 x2 x3
     /SAVE=PRED(a).""")
try:
   spss.Submit(lrcmd)
except:
   raise ValueError("Logistic Regression step failed")
fuzzycmd = spssaux.u(r"""FUZZY BY=a SUPPLIERID=ID2 NEWDEMANDERIDVARS=b
GROUP=gourp EXACTPRIORITY=FALSE
MATCHGROUPVAR=%(matchgroup)s FUZZ=0.3 DS3=%(tempdsname)s
/OPTIONS SAMPLEWITHREPLACEMENT=FALSE MINIMIZEMEMORY=TRUE SHUFFLE=FALSE .
DELETE VARIABLES %(matchgroup)s.
DATASET ACTIVATE %(ds)s.
DELETE VARIABLES %(matchgroup)s.
DATASET COPY l.
DATASET ACTIVATE l.
SELECT IF gourp EQ 1.
DATASET ACTIVATE %(tempdsname)s.
DATASET ACTIVATE l.
ADD FILES /FILE=* /FILE=%(tempdsname)s.
EXECUTE.
DATASET CLOSE %(tempdsname)s.""" % locals())
spss.Submit(fuzzycmd)
end program.
This procedure requires the FUZZY extension command which is not installed.
Traceback (most recent call last):
  File "<string>", line 7, in <module>
NameError: name 'FUZZY' is not defined

怎么解决啊?
二维码

扫码加我 拉你入群

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

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

全部回复
2016-2-24 10:20:20
his procedure requires the FUZZY extension command which is not installed.
二维码

扫码加我 拉你入群

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

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

2016-2-24 11:16:40
kkwei 发表于 2016-2-24 10:20
his procedure requires the FUZZY extension command which is not installed.
谢谢,但显示已经安装上了啊。如图;

QQ截图20160224111217.png
二维码

扫码加我 拉你入群

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

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

2016-2-24 15:25:21
use fuzzy
二维码

扫码加我 拉你入群

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

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

2016-3-18 10:23:53
楼主解决这个问题了吗?我也遇到同样的问题,求指教
二维码

扫码加我 拉你入群

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

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

2016-7-25 08:49:17
请问fuzzy无法使用 这个要怎么解决 还能用SPSS做PSM分析吗?
二维码

扫码加我 拉你入群

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

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

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

分享

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