omid 发表于 2011-3-23 04:09 
我的问题解决了,发现时exp(fi)i=RAC OGDC other OGAC, 数值过大,导致错误,可以对数据进行预处理,如将ESAL缩小100000,相应的所得到的系数也缩小100000倍,不知道这样子处理是否合适?
There are a couple of problems here. You already find one.
Other one is the values for variable pvment which are coded in mixed cases. you need to convert them when do a comparison. See in the program below.
Other tip when you have a problem like this you can plug in the program in a data step to see what's going on.
HTH
data A;
a1=.1; b1=.1; c1=.1; d1=.1;a2=.1; b2=.1; c2=.1;
d2=.1;a3=.1; b3=.1; c3=.1; d3=.1;a4=.1; b4=.1; c4=.1; d4=.1;
input pvment$ thickness ESAL rain @@;
if lowcase(pvment) eq 'dgac' then f1=a1+b1*thickness+c1*ESAL+d1*rain;
else if lowcase(pvment) eq 'ogac' then f2=a2+b2*thickness+c2*ESAL+d2*rain;
else if lowcase(pvment) eq 'other' then f3=a3+b3*thickness+c3*ESAL+d3*rain;
else if lowcase(pvment) eq 'dgac' then f4=a4+b4*thickness+c4*ESAL+d4*rain;
f=exp(f1)/(exp(f1)+exp(f2)+exp(f3)+exp(f4));
datalines;
DGAC 48.96170255 544810 144.53
DGAC 52.62549946 236000 261.07
DGAC 54.35712505 310000 212.7
DGAC 54.41309566 284780 492.96
DGAC 36.66229293 3481320 157.99
DGAC 55.07167785 136250 531.11
DGAC 54.14445697 122000 513.33
OGAC 41.52548462 236000 261.07
OGAC 44.31461605 236000 261.07
OGAC 42.19031228 236000 261.07
OGAC 45.38567824 236000 261.07
OGAC 27.66625307 1662940 415.4
OGAC 33.64522296 210865 535.49
OGAC 26.56858947 89000 1187.11
OGAC 30.89045698 89000 1187.11
other 52.42478719 236000 261.07
other 50.30363374 236000 261.07
other 49.21335293 236000 261.07
other 50.01384679 236000 261.07
other 48.2134075 81070 21.3
other 44.08889863 81070 21.3
other 47.08160511 89000 2105.24
other 52.72141224 310000 212.7
other 57.51522172 310000 212.7
RAC 30.5341555 908520 833.66
RAC 23.26654254 243445 1425.6
RAC 31.62391067 91000 1183.35
RAC 27.16423427 286885 1679.37
RAC 22.78564813 243445 1425.6
RAC 33.05433851 91000 1183.35
RAC 24.05508273 286885 1679.37
;