我一直在尝试循环以下 sytanx 说 10 次。
COMPUTE tempvar=UNIFORM(10).
SORT CASES BY behaviour_code tempvar (A).
SPLIT FILE BY behaviour_code.
COMPUTE tempvar=1.
CREATE filter=CSUM(tempvar).
RECODE filter (1 thru 100=1) (3 thru highest=0).
SPLIT FILE OFF.
DISCRIMINANT
/GROUPS=behaviour_code(1 4)
/VARIABLES=hx hy hz
/SELECT=filter(1)
/ANALYSIS ALL
/PRIORS EQUAL
/STATISTICS=TABLE CROSSVALID
/CLASSIFY=NONMISSING POOLED.
EXECUTE.
语法本身从每个组中随机选择 x 个案例,然后运行 DISCRIMINANT 命令。
我使用循环命令尝试了以下操作:
SET MXLOOPS=10.
LOOP.
COMPUTE tempvar=UNIFORM(10).
SORT CASES BY behaviour_code tempvar (A).
SPLIT FILE BY behaviour_code.
COMPUTE tempvar=1.
CREATE filter=CSUM(tempvar).
RECODE filter (1 thru 100=1) (3 thru highest=0).
SPLIT FILE OFF.
DISCRIMINANT
/GROUPS=behaviour_code(1 4)
/VARIABLES=hx hy hz
/SELECT=filter(1)
/ANALYSIS ALL
/PRIORS EQUAL
/STATISTICS=TABLE CROSSVALID
/CLASSIFY=NONMISSING POOLED.
EXECUTE.
END LOOP.
谁能建议如何最好地让原始脚本有效地重新采样给定次数?