-
Notifications
You must be signed in to change notification settings - Fork 0
/
904reliability.txt
72 lines (65 loc) · 14.5 KB
/
904reliability.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
%macro item_mean(score_data,xiaoti,out_data);
proc means data=&score_data noprint ;
var &xiaoti;
output out=datasets ;
run;
proc transpose data=datasets out=&out_data;
var &xiaoti;
id _stat_;
run;
%mend;
************************************ nandu;
%macro nandu(a_score,zf,vars,firstvar,b_items,xuanzuofenzhi);
%split_group(&a_score.,&zf.);
%item_mean(&a_score.,&zf.,tmp_all);
data tmp_all;
set tmp_all;
tihao2="&zf.";
run;
data item;
set &b_items end=kkk;
tihao2="&zf.";
retain zfz znd;
if _n_=1 then do; zfz=fenzhi; znd=yugunandu;end;
else do; zfz=zfz+fenzhi; znd=znd+yugunandu;end;
if kkk then do; zfz=zfz-&xuanzuofenzhi.;znd=znd/_n_;end;
if kkk;
run;
data nandu;
merge tmp_all item;
by tihao2;
sjnandu=mean/zfz;
run;
data zhishi;
set nandu;
ndlev='中等';
if sjnandu <0.3 then ndlev= '较难';
if sjnandu >0.7 then ndlev= '较易';
run;
************* reliability;
data tmp;
set &a_score.;
proc corr data=tmp outp=cortmp alpha nosimple noprint NOCORR NOMISS;
var &vars;
run;
data correl;
set cortmp;
tihao2="&zf.";
if _type_="RAWALPHA";
label &firstvar.="信度(ALPHA系数)";
run;
data out;
merge zhishi correl;
by tihao2;
run;
proc print data=out noobs label;
var tihao2 zfz mean znd sjnandu ndlev &firstvar.;
label tihao2="试卷" zfz="满分值" mean="平均分" znd="预估难度" sjnandu="实际难度"
ndlev="难度级别"
;
title " 全卷难度信度";
footnote "题目包括: &vars.";
run;
%mend;
*********example;
*%nandu(test.score,zf,zgt1 zgt2 zgt3,zgt3,test.items,25);******最后一个参数为选做题分值;