define guttman (var=!charend('/') /cut=!default(1)!charend('/')). preserve. set length=none printback = off mxloops = 90000. matrix. get d /file=* /var=!var/sysmis=omit/missing=omit/names=nx. compute d=d ge !cut. compute d2=rsum(d). compute d3=csum(d). *print d3. *compute d4=d3. compute d4=nrow(d)-d3. compute d4={d3;d4}. *print d4. compute d5=cmax(d4). *print d5. compute min=rsum(d5)/(ncol(d)*nrow(d)). *print d2. *print d3. compute d33=rnkorder(d3). *print d33. compute d33=-d33+(ncol(d))+1. compute d333=d33. loop #i=2 to nrow(d). compute d333={d33;d333}. end loop. *print d333. compute d222=d2. loop #i=2to ncol(d). compute d222={d2,d222}. end loop. *print d222. *compute d22=rnkorder(d2). *print d22. compute c=d333 le d222. *print c. compute c2=c eq d. *print c2. compute dc2=csum(c2). *print dc2. compute gc=rsum(dc2)/(ncol(d)*nrow(d)). print gc/title "ガットマン再現性係数 (coefficient of reproductiblity)"/format f8.3. compute imp=gc-min. print min/title "最小周辺分布再現性 (minimum marginal reporductivity)"/format f8.3. print imp/title "向上パーセント (percent improvement)"/format f8.3. compute scal=imp/(1-min). print scal/title "尺度化係数 (coefficient of scalability)"/format f8.3. print {d3;d33}/cnames=nx/title "変数の順位"/rlabels="true" "order"/formt f6.0. compute cong=make(1,ncol(d),0). *print cong. compute tt=make(1,ncol(d),0). *print tt. loop i=1 to ncol(d). compute x={0;1;d(:,i)}. *print x. compute y={0;1;c(:,i)}. compute x=design(x). compute y=design(y). compute x=x(3:nrow(x),:). *print x. compute y=y(3:nrow(y),:). compute z=t(y)*x. compute z2=csum(z). compute z={z;z2}. compute z2=rsum(z). compute z={z,z2}. compute nxi=nx(i). print {d33(i), z(3,2)/z(3,3),(z(1,1)+z(2,2))/z(3,3)}/title=" "/clabels="oreder" "true" "conting" /rname=nxi/format f8.3. compute rn={"0 (est)"; "1 (est)";"total"}. print z/title=" "/rname=rn /clabels="0 (data)" "1 (data)" "total". compute tt(i)=z(3,2)/z(3,3). compute cong(i)=(z(1,1)+z(2,2))/z(3,3). end loop. print {d33;cong;tt}/cnames=nx/rlabels="order" "cong" "true"/formt f8.3. end matrix. restore. !enddefine. /*guttman var=t2001 to t2010/cut=4.*/.