SAS 数据分析中的z-score 标准化怎么写
来源:学生作业帮 编辑:百度作业网作业帮 分类:数学作业 时间:2024/08/15 11:53:35
SAS 数据分析中的z-score 标准化怎么写
![SAS 数据分析中的z-score 标准化怎么写](/uploads/image/z/18952981-61-1.jpg?t=SAS+%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E4%B8%AD%E7%9A%84z-score+%E6%A0%87%E5%87%86%E5%8C%96%E6%80%8E%E4%B9%88%E5%86%99)
根据公式来,给个例子:
DATA WT;
INPUT WEIGHT;
DATALINES;
64
71
53
67
55
58
77
57
56
51
76
68
;
PROC MEANS NOPRINT DATA=WT;VAR WEIGHT;OUTPUT OUT=WTMEANS
MEAN=WTMEAN STDDEV=WTSD;
RUN;
DATA WTDIFF;SET WT;
IF _N_=1 THEN SET WTMEANS;
DIFF=WEIGHT-WTMEAN;
Z=DIFF/WTSD; * 标准化(Z-SCORE);
RUN;
ODS RTF;
PROC PRINT DATA= WTDIFF;VAR WEIGHT DIFF Z;
RUN;
ODS RTF CLOSE;
DATA WT;
INPUT WEIGHT;
DATALINES;
64
71
53
67
55
58
77
57
56
51
76
68
;
PROC MEANS NOPRINT DATA=WT;VAR WEIGHT;OUTPUT OUT=WTMEANS
MEAN=WTMEAN STDDEV=WTSD;
RUN;
DATA WTDIFF;SET WT;
IF _N_=1 THEN SET WTMEANS;
DIFF=WEIGHT-WTMEAN;
Z=DIFF/WTSD; * 标准化(Z-SCORE);
RUN;
ODS RTF;
PROC PRINT DATA= WTDIFF;VAR WEIGHT DIFF Z;
RUN;
ODS RTF CLOSE;