sas数据集例题.docx

上传人:b****6 文档编号:4562839 上传时间:2022-12-06 格式:DOCX 页数:9 大小:189.31KB
下载 相关 举报
sas数据集例题.docx_第1页
第1页 / 共9页
sas数据集例题.docx_第2页
第2页 / 共9页
sas数据集例题.docx_第3页
第3页 / 共9页
sas数据集例题.docx_第4页
第4页 / 共9页
sas数据集例题.docx_第5页
第5页 / 共9页
点击查看更多>>
下载资源
资源描述

sas数据集例题.docx

《sas数据集例题.docx》由会员分享,可在线阅读,更多相关《sas数据集例题.docx(9页珍藏版)》请在冰豆网上搜索。

sas数据集例题.docx

sas数据集例题

sas数据集例题

LT

结果分析

一、

(1)

dataclass;

inputidbiochemistry$physicalpathology;

labelid='学号'biochemistry='生化'physical='物理'pathology='病理';

cards;

083687165

084746168

085737546

087757168

084858587

085787975

086807679

089677371

118705475

083706684

084627365

099827079

;

run;

procprintdata=classlabel;

run;

(2)

(3)

dataclass;

inputidbiochemistry$physical$pathology$ave$@@;

labelid='学号'biochemistry='生化'physical='物理'pathology='病理';

ave=mean(biochemistry,physical,pathology);

ifave<60thenave='E';

if60<=ave<70thenave='D';

if70<=ave<=79thenave='C';

if80<=ave<=89thenave='B';

if90<=ave<=100thenave='A';

return;

cards;

083687165

084746168

085737546

087757168

084858587

085787975

086807679

089677371

118705475

083706684

084627365

099827079

;

procprint;

run;

二.

6.

libnamesas7bdat'c:

\saslx';

datastudent;

infile'c:

\sasdt\student.txt';

lengthid$18;

lengthname$16;

inputid$name$Englishconputer;

age=2015-input(substr(id,7,4),4.);

ifmod(substr(compress(id),17,1),2)

thensex='1';

elsesex='2';

dropid;

run;

datasas7bdat.mstu;

setstudent;

ifsex=1;

keepnameagesexEnglishcomputer;

datasas7bdat.fstu;

setstudent;

ifsex=2;

keepnameagesexEnglishcomputer;

run;

procprint;

run;

 

 

7.

libnamesas7bdat'c:

\saslx';

datastudent;

infile'c:

\sasdt\student.txt';

lengthid$18;

lengthname$16;

inputid$name$Englishconputer;

age=2015-input(substr(id,7,4),4.);

ifmod(substr(compress(id),17,1),2)

thensex='1';

elsesex='2';

dropid;

run;

datasas7bdat.stu90;

setstudent;

whereEnglish>90andconputer>90;

run;

procprint;

run;

三.

首先导入数据集

dataliangbiao;

MERGED1D2;

datalb;

setliangbiaoD3;

procexportdata=lboutfile="d:

\cym\SAS作业\量表.sav"

REPLACE;

datalb;

arraylb[72]a1-a50b1-b22;

setlb;

lb

(1)=6-lb

(1);lb(5)=6-lb(5);lb(30)=6-lb(30);lb(43)=6-lb(43);

lb(49)=6-lb(49);lb(52)=6-lb(52);lb(56)=6-lb(56);lb(69)=6-lb(69);

sum1=sum(ofa1-a25);

sum2=sum(ofa26-a50);

sum3=sum(ofb1-b22);

datalb;

setlb;

procstandarddata=lbout=lbreplace;

varsum1sum2sum3;

run;

procsortdata=lb;

bysum3;

datacheng;

inputgroup@@;

datalines;

11111111112222222222222222222222222222222222222222222223333333333

run;

datalg;

MERGElbcheng;

run;

datalg;

setlg;

if(group=1)thensum='高分组';

if(group=2)thensum='中间组';

if(group=3)thensum='低分组';

run;

结果如下:

 

成绩

教师签名

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1