SPSS随机化分组编程
1.完全随机设计分组SPSS编程
set seed=12345.
input program.
loop number=1 to 120.
compute random=uniform(120).
end case.
end loop.
end file.
end input program.
autorecode variables=random/into rank.
sort cases by rank(A).
recode rank(1 thru 30=1)(31 thru 60=2)(61 thru 90=3)(91 thru 120=4)into group.
execute.
2.随机区组设计分组的SPSS编程
set seed=???.
input program.
loop number=1 to n.
compute block=rnd((number-1)/K+0.5).
end case.
end loop.
end file.