SAS练习题及程序答案
sas测试题及答案

sas测试题及答案1. SAS中,如何将一个数据集的所有变量的值增加10?A. data dataset; set dataset; +10; run;B. data dataset; set dataset; +10; quit;C. data dataset; set dataset; +10; run;D. data dataset; set dataset; +10;答案:C2. 在SAS中,如何创建一个新的数据集,并将原数据集中的变量`Var1`和`Var2`复制到新数据集中?A. data new_dataset; set old_dataset; Var1 =old_dataset.Var1; Var2 = old_dataset.Var2; run;B. data new_dataset; set old_dataset; Var1 = Var1; Var2 = Var2; run;C. data new_dataset / old_dataset; set old_dataset; Var1 = old_dataset.Var1; Var2 = old_dataset.Var2; run;D. data new_dataset; set old_dataset; Var1 = Var1; Var2 = Var2; quit;答案:A3. SAS中,如何使用`proc print`步骤打印数据集的前10行?A. proc print data=dataset firstobs=10;B. proc print data=dataset firstobs=1 obs=10;C. proc print data=dataset firstobs=10;D. proc print data=dataset firstobs=1 obs=10;答案:B4. 在SAS中,如何使用`if-then`语句来创建一个新的变量`NewVar`,当`Var1`大于10时,`NewVar`的值为`Var1`的两倍,否则为0?A. data dataset; set dataset; if Var1 > 10 then NewVar = 2 * Var1; else NewVar = 0; run;B. data dataset; set dataset; if Var1 > 10 then NewVar = 2 * Var1; NewVar = 0; run;C. data dataset; set dataset; if Var1 > 10 NewVar = 2 *Var1; else NewVar = 0; run;D. data dataset; set dataset; if Var1 > 10 then NewVar = 2 * Var1; else NewVar = 0; quit;答案:A5. SAS中,如何使用`proc means`步骤计算数据集中`Var1`的平均值?A. proc means data=dataset N mean of Var1;B. proc means data=dataset N mean Var1;C. proc means data=dataset N=mean Var1;D. proc means data=dataset N mean Var1;答案:D结束语:以上是SAS测试题及答案,希望能够帮助您更好地理解和掌握SAS编程的基础知识。
sas练习题(打印版)

sas练习题(打印版)### SAS练习题(打印版)#### 一、基础数据操作1. 数据导入- 题目:使用SAS导入一个CSV文件,并列出前5个观测值。
- 答案:使用`PROC IMPORT`过程导入数据,并用`PROC PRINT`展示前5个观测。
2. 数据筛选- 题目:筛选出某列数据大于50的所有观测。
- 答案:使用`WHERE`语句进行筛选。
3. 数据分组- 题目:根据某列数据对数据集进行分组,并计算每组的均值。
- 答案:使用`PROC MEANS`过程和`BY`语句进行分组和计算。
4. 数据排序- 题目:按照某列数据的升序或降序对数据集进行排序。
- 答案:使用`PROC SORT`过程进行排序。
#### 二、描述性统计分析1. 单变量分析- 题目:计算某列数据的均值、中位数、标准差等统计量。
- 答案:使用`PROC UNIVARIATE`过程进行单变量描述性统计分析。
2. 频率分布- 题目:计算某列数据的频数和频率分布。
- 答案:使用`PROC FREQ`过程进行频率分布分析。
3. 相关性分析- 题目:计算两列数据的相关系数。
- 答案:使用`PROC CORR`过程计算相关系数。
#### 三、假设检验1. t检验- 题目:对两组独立样本的均值进行t检验。
- 答案:使用`PROC TTEST`过程进行t检验。
2. 方差分析- 题目:对多个组别数据进行方差分析。
- 答案:使用`PROC ANOVA`过程进行方差分析。
3. 卡方检验- 题目:对分类变量进行卡方检验。
- 答案:使用`PROC FREQ`过程和`CHI2TEST`选项进行卡方检验。
#### 四、回归分析1. 简单线性回归- 题目:使用一个自变量和一个因变量进行简单线性回归分析。
- 答案:使用`PROC REG`过程进行简单线性回归。
2. 多元线性回归- 题目:使用多个自变量和一个因变量进行多元线性回归分析。
- 答案:同样使用`PROC REG`过程,但包括多个自变量。
SAS~base~考试必备~70真题(附答案解析)

1.The following SAS program is submitted:data WORK.TOTAL;set WORK.SALARY;by Department Gender;if First.<_insert_code_> then Payroll=0;Payroll+Wagerate;if Last.<_insert_code_>;run;The SAS data set WORK.SALARY is currently ordered by Gender within Department.Which inserted code will accumulate subtotals for each Gender within Department?A. GenderB. DepartmentC. Gender DepartmentD. Department GenderAnswer: A-------------------------------------2.Given the following raw data records in TEXTFILE.TXT:----|----10---|----20---|----30John,FEB,13,25,14,27,FinalJohn,MAR,26,17,29,11,23,CurrentTina,FEB,15,18,12,13,FinalTina,MAR,29,14,19,27,20,CurrentThe following output is desired:Obs Name Month Status Week1 Week2 Week3 Week4 Week51 John FEB Final $13 $25 $14 $27 .2 John MAR Current $26 $17 $29 $11 $233 Tina FEB Final $15 $18 $12 $13 .4 Tina MAR Current $29 $14 $19 $27 $20Which SAS program correctly produces the desired output?A.data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXTFILE.TXT' dsd;input Name $ Month $;if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $;format Week1-Week5 dollar6.;run;proc print data=WORK.NUMBERS;run;B.data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXTFILE.TXT' dlm=',' missover;input Name $ Month $;if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $;format Week1-Week5 dollar6.;run;proc print data=WORK.NUMBERS;run;C.data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXTFILE.TXT' dlm=',';input Name $ Month $ @;if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $;format Week1-Week5 dollar6.;run;proc print data=WORK.NUMBERS;run;D.data WORK.NUMBERS;length Name $ 4 Month $ 3 Status $ 7;infile 'TEXTFILE.TXT' dsd @;input Name $ Month $;if Month='FEB' then input Week1 Week2 Week3 Week4 Status $;else if Month='MAR' then input Week1 Week2 Week3 Week4 Week5 Status $;format Week1-Week5 dollar6.;run;proc print data=WORK.NUMBERS;run;Answer: C-------------------------------------3.The Excel workbook REGIONS.XLS contains the following four worksheets:EASTWESTNORTHSOUTHThe following program is submitted:libname MYXLS 'regions.xls';Which PROC PRINT step correctly displays the NORTH worksheet?A. proc print data=MYXLS.NORTH;run;B. proc print data=MYXLS.NORTH$;run;C. proc print data=MYXLS.'NORTH'e;run;D. proc print data=MYXLS.'NORTH$'n;run;Answer: D-------------------------------------4.The following SAS program is submitted:data WORK.DATE_INFO;Day="01" ;Yr=1960 ;X=mdy(Day,01,Yr) ;run;What is the value of the variable X?A. the numeric value 0B. the character value "01011960"C. a missing value due to syntax errorsD. the step will not compile because of the character argument in the mdy function.Answer: A-------------------------------------5.Which statement specifies that records 1 through 10 are to be read from the raw data file customer.txt?A. infile 'customer.txt' 1-10;B. input 'customer.txt' stop@10;C. infile 'customer.txt' obs=10;D. input 'customer.txt' stop=10;Answer: C-------------------------------------6.After a SAS program is submitted, the following is written to the SAS log:101 data WORK.JANUARY;102 set WORK.ALLYEAR(keep=product month num_Sold Cost); 103 if Month='Jan' then output WORK.JANUARY;104 Sales=Cost * Num_Sold;105 keep=Product Sales;-----22ERROR 22-322: Syntax error, expecting one of the following: !,!!, &, *, **, +, -, , <=, <>, =, >, >=,AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG,NL,NOTIN, OR, ^=, |, ||, ~=.106 run;What changes should be made to the KEEP statement to correct the errors in the LOG?A. keep=(Product Sales);B. keep Product, Sales;C. keep=Product, Sales;D. keep Product Sales;Answer: D-------------------------------------7.Which of the following choices is an unacceptable ODS destination for producing output that can be viewed in Microsoft Excel?A. MSOFFICE2KB. EXCELXPC. CSVALLD. WINXPAnswer: D-------------------------------------8.The SAS data set named WORK.SALARY contains 10 observations for each department,and is currently ordered by Department. The following SAS program is submitted:data WORK.TOTAL;set WORK.SALARY(keep=Department MonthlyWageRate);by Department;if First.Department=1 then Payroll=0;Payroll+(MonthlyWageRate*12);if Last.Department=1;run;Which statement is true?A. The by statement in the DATA step causes a syntax error.B. The statement Payroll+(MonthlyWageRate*12); in the data step causes a syntax error.C. The values of the variable Payroll represent the monthly total for each department in the WORK.SALARY data set.D. The values of the variable Payroll represent a monthly total for all values of WAGERATE in the WORK.SALARY data set.Answer: C-------------------------------------10.The following SAS program is submitted:data WORK.RETAIL;Cost='$20,000';Discount=.10*Cost;run;What is the result?A. The value of the variable Discount in the output data set is 2000.No messages are written to the SAS log.B. The value of the variable Discount in the output data set is 2000.A note that conversion has taken place is written to the SAS log.C. The value of the variable Discount in the output data set is missing. A note in the SAS log refers to invalid numeric data.D. The variable Discount in the output data set is set to zero.No messages are written to the SAS log.Answer: C 因为有一个$符号-------------------------------------11.Given the existing SAS program:proc format;value agegrplow-12 ='Pre-Teen'13-high = 'Teen';run;proc means data=SASHELP.CLASS;var Height;class Sex Age;format Age agegrp.;run;Which statement in the proc means step needs to be modified or added to generate the following results:Analysis Variable : HeightNSex Age Obs Minimum MaximumMean------------------------------------------------------------------F Pre-Teen 3 51.3 59.855.8Teen 6 56.5 66.563.0M Pre-Teen 4 57.3 64.859.7Teen 6 62.5 72.066.8--------------------------------------------------------------------A. var Height / nobs min max mean maxdec=1;B. proc means data=SASHELP.CLASS maxdec=1 ;C. proc means data=SASHELP.CLASS min max mean maxdec=1;D. output nobs min max mean maxdec=1;Answer: C-------------------------------------12.The Excel workbook QTR1.XLS contains the following three worksheets:JANFEBMARWhich statement correctly assigns a library reference to the Excel workbook?A. libname qtrdata 'qtr1.xls';B. libname 'qtr1.xls' sheets=3;C. libname jan feb mar 'qtr1.xls';D. libname mydata 'qtr1.xls' WORK.heets=(jan,feb,mar); Answer: A-------------------------------------13.The following SAS program is submitted:data WORK.TEST;set WORK.MEASLES(keep=Janpt Febpt Marpt);array Diff{3} Difcount1-Difcount3;array Patients{3} Janpt Febpt Marpt;run;What new variables are created?A. Difcount1, Difcount2 and Difcount3B. Diff1, Diff2 and Diff3C. Janpt, Febpt, and MarptD. Patients1, Patients2 and Patients3Answer: A-------------------------------------14.Which of the following programs correctly invokes the DATA Step Debugger:A.data WORK.TEST debug;set WORK.PILOTS;State=scan(cityState,2,' ');if State='NE' then description='Central'; run;B.data WORK.TEST debugger;set WORK.PILOTS;State=scan(cityState,2,' ');if State='NE' then description='Central'; run;C.data WORK.TEST / debug;set WORK.PILOTS;State=scan(cityState,2,' ');if State='NE' then description='Central'; run;D.data WORK.TEST / debugger;set WORK.PILOTS;State=scan(cityState,2,' ');if State='NE' then description='Central';run;Answer: c-------------------------------------15.Which statement is true concerning the SAS automatic variable _ERROR_?A. It cannot be used in an if/then condition.B. It cannot be used in an assignment statement.C. It can be put into a keep statement or keep= option.D. It is automatically dropped.Answer: D-------------------------------------16.The following SAS program is submitted:data WORK.DATE_INFO;X='04jul2005'd;DayOfMonth=day(x);MonthOfYear=month(x);Year=year(x);run;What types of variables are DayOfMonth, MonthOfYear, and Year?A. DayOfMonth, Year, and MonthOfYear are character.B. DayOfMonth, Year, and MonthOfYear are numeric.C. DayOfMonth and Year are numeric. MonthOfYear is character.D. DayOfMonth, Year, and MonthOfYear are date values.Answer: B-------------------------------------17.Given the following data step:data WORK.GEO;infile datalines;input City $20.;if City='Tulsa' thenState='OK';Region='Central';if City='Los Angeles' thenState='CA';Region='Western';datalines;TulsaLos AngelesBangor;run;After data step execution, what will data set WORK.GEO contain?A.City State Region----------- ----- -------Tulsa OK WesternLos Angeles CA WesternBangor WesternB.City State Region ----------- ----- ------- Tulsa OK Western Los Angeles CA Western BangorC.City State Region ----------- ----- ------- Tulsa OK Central Los Angeles CA Western Bangor WesternD.City State Region ----------- ----- ------- Tulsa OK Central Los CA Western BangorAnswer: A-------------------------------------18.Which statement describes a characteristic of the SAS automatic variable _ERROR_?A. The _ERROR_ variable maintains a count of the number of data errors in a DATA step.B. The _ERROR_ variable is added to the program data vector and becomes part of the data set being created.C. The _ERROR_ variable can be used in expressions in the DATA step.D. The _ERROR_ variable contains the number of the observation that caused the data error.Answer: C-------------------------------------19.The SAS data set WORK.ONE contains a numeric variable named Num and a character variable named Char:WORK.ONENum Char--- ----1 233 231 77The following SAS program is submitted:proc print data=WORK.ONE;where Num='1';run;What is output?A.Num Char--- ----1 23B.Num Char--- ----1 231 77C.Num Char--- ----1 233 231 77D. No output is generated.Answer: D-------------------------------------20. The data set WORK.REALESTATE has the variable LocalFee with a format of 9. and a variable CountryFee with a format of 7.;The following SAS program is submitted:data WORK.FEE_STRUCTURE;format LocalFee CountryFee percent7.2;set WORK.REALESTAT;LocalFee=LocalFee/100;CountryFee=CountryFee/100;run;What are the formats of the variables LOCALFEE and COUNTRYFEE in the output dataset?A. LocalFee has format of 9. and CountryFee has a format of 7.B. LocalFee has format of 9. and CountryFee has a format of percent7.2C. Both LocalFee and CountryFee have a format of percent7.2D. The data step fails execution; there is no format for LocalFee.Answer: C-------------------------------------21.Given the SAS data set WORK.PRODUCTS:ProdId Price ProductType Sales Returns------ ----- ----------- ----- -------K12S 95.50 OUTDOOR 15 2B132S 2.99 CLOTHING 300 10R18KY2 51.99 EQUIPMENT 25 53KL8BY 6.39 OUTDOOR 125 15DY65DW 5.60 OUTDOOR 45 5 DGTY23 34.55 EQUIPMENT 67 2The following SAS program is submitted:data WORK.OUTDOOR WORK.CLOTH WORK.EQUIP;set WORK.PRODUCTS;if Sales GT 30;if ProductType EQ 'OUTDOOR' then outputWORK.OUTDOOR;else if ProductType EQ 'CLOTHING' then output WORK.CLOTH;else if ProductType EQ 'EQUIPMENT' then output WORK.EQUIP; run;How many observations does the WORK.OUTDOOR data set contain?A. 1B. 2C. 3D. 6Answer: B-------------------------------------22.Which step displays a listing of all the data sets in the WORK library?A. proc contents lib=WORK run;B. proc contents lib=WORK.all;run;C. proc contents data=WORK._all_; run;D. proc contents data=WORK _ALL_; run;Answer: c-------------------------------------23.Which is a valid LIBNAME statement?A. libname "_SAS_data_library_location_";B. sasdata libname "_SAS_data_library_location_";C. libname sasdata "_SAS_data_library_location_";D. libname sasdata sas "_SAS_data_library_location_";Answer: C-------------------------------------24.Given the following raw data records:----|----10---|----20---|----30Susan*12/29/1970*10Michael**6The following output is desired:Obs employee bdate years1 Susan 4015 102 Michael . 6Which SAS program correctly reads in the raw data?A.data employees;infile 'file specification' dlm='*';input employee $ bdate : mmddyy10. years; run;B.data employees;infile 'file specification' dsd='*';input employee $ bdate mmddyy10. years;run;C.data employees;infile 'file specification' dlm dsd;input employee $ bdate mmddyy10. years;run;D.data employees;infile 'file specification' dlm='*' dsd;input employee $ bdate : mmddyy10. years; run;Answer: D-------------------------------------25.Given the following code:proc print data=SASHELP.CLASS(firstobs=5 obs=15);where Sex='M';run;How many observations will be displayed?A. 11B. 15C. 10 or fewerD. 11 or fewerAnswer: D-------------------------------------26.Which step sorts the observations of a permanent SAS data set by two variables and stores the sorted observations in a temporary SAS data set?A.proc sort out=EMPLOYEES data=EMPSORT;by Lname and Fname;run;B.proc sort data=SASUSER.EMPLOYEES out=EMPSORT;by Lname Fname;run;C.proc sort out=SASUSER.EMPLOYEES data=WORK.EMPSORT;by Lname Fname;run;D.proc sort data=SASUSER.EMPLOYEES out=SASUSER.EMPSORT; by Lname and Fname;run;Answer: B-------------------------------------27.Given the SAS data set WORK.TEMPS:Day Month Temp--- ----- ----1 May 7515 May 7015 June 803 June 762 July 8514 July 89The following program is submitted:proc sort data=WORK.TEMPS;by descending Month Day; run;proc print data=WORK.TEMPS; run;Which output is correct?A.Obs Day Month Temp--- --- ----- ----1 2 July 852 14 July 893 3 June 764 15 June 805 1 May 756 15 May 7B.Obs Day Month Temp --- --- ----- ----1 1 May 752 2 July 853 3 June 764 14 July 895 15 May 706 15 June 80C.Obs Day Month Temp --- --- ----- ----1 1 May 752 15 May 703 3 June 764 15 June 805 2 July 856 14 July 89D.Obs Day Month Temp--- --- ----- ----1 15 May 702 1 May 753 15 June 804 3 June 765 14 July 896 2 July 85Answer: C-------------------------------------28.Given the SAS data set WORK.P2000: Location Pop2000-------- -------Alaska 626931Delaware 783595Vermont 608826Wyoming 493782and the SAS data set WORK.P2008:State Pop2008-------- -------Alaska 686293Delaware 873092Wyoming 532668The following output is desired:Obs State Pop2000 Pop2008 Difference1 Alaska 626931 686293 593622 Delaware 783595 873092 894973 Wyoming 493782 532668 38886 Which SAS program correctly combines the data?A.data compare;merge WORK.P2000(in=_a Location=State)WORK.P2008(in=_b);by State;if _a and _b;Difference=Pop2008-Pop2000;run;B.data compare;merge WORK.P2000(rename=(Location=State)) WORK.P2008;by State;if _a and _b;Difference=Pop2008-Pop2000;run;C.data compare;merge WORK.P2000(in=_a rename=(Location=State)) WORK.P2008(in=_b);by State;if _a and _b;Difference=Pop2008-Pop2000;run;D.data compare;merge WORK.P2000(in=_a) (rename=(Location=State)) WORK.P2008(in=_b);by State;if _a and _b;Difference=Pop2008-Pop2000;run;Answer: C-------------------------------------29.The following SAS program is sumbitted:data ;infile 'DATAFILE.TXT';input @1 Company $20. @25 State $2. @;if State=' ' then input @30 Year;else input @30 City Year;input NumEmployees;run;How many raw data records are read during each iteration of the DATA step?A. 1B. 2C. 3D. 4Answer: A-------------------------------------30.You're attempting to read a raw data file and you see the following messages displayed in the SAS Log:NOTE: Invalid data for Salary in line 4 15-23.RULE: ----+----1----+----2----+----3----+----4----+----5--4 120104 F 46#30 11MAY1954 33Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4NOTE: 20 records were read from the infile 'c:\employees.dat'.The minimum record length was 33.The maximum record length was 33.NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables.What does it mean?A. A compiler error, triggered by an invalid character for the variable Salary.B. An execution error, triggered by an invalid character for the variable Salary.C. The 1st of potentially many errors, this one occurring on the 4th observation.D. An error on the INPUT statement specification for reading the variable Salary.Answer: B------------------------------------------------------------------31. Given the following raw data records in DATAFILE.TXT:----|----10---|----20---|----30Kim,Basketball,Golf,TennisBill,FootballTracy,Soccer,TrackThe following program is submitted:data WORK.SPORTS_INFO;length Fname Sport1-Sport3 $ 10;infile 'DATAFILE.TXT' dlm=',';input Fname $ Sport1 $ Sport2 $ Sport3 $;run;proc print data=WORK.SPORTS_INFO;run;Which output is correct based on the submitted program?A.Obs Fname Sport1 Sport2 Sport31 Kim Basketball Golf Tennis2 Bill Football3 Tracy Soccer TrackB.Obs Fname Sport1 Sport2 Sport31 Kim Basketball Golf Tennis2 Bill Football Football Football3 Tracy Soccer Track TrackC.Obs Fname Sport1 Sport2 Sport31 Kim Basketball Golf Tennis2 Bill Football Tracy SoccerD.Obs Fname Sport1 Sport2 Sport31 Kim Basketball Golf Tennis2 Bill FootballAnswer: C------------------------------------------------------------------32.Consider the following data step:data WORK.NEW;set WORK.OLD;Count+1;run;The variable Count is created using a sum statement. Which statement regarding this variable is true?A. It is assigned a value 0 when the data step begins execution.B. It is assigned a value of missing when the data step begins execution.C. It is assigned a value 0 at compile time.D. It is assigned a value of missing at compile time.Answer: C------------------------------------------------------------------33.The following SAS program is submitted:data WORK.TEST;set WORK.PILOTS;if Jobcode='Pilot2' then Description='Senior Pilot';else Description='Unknown';run;The value for the variable Jobcode is: PILOT2.What is the value of the variable Description?A. PILOT2B. UnknownC. Senior PilotD. ' ' (missing character value)Answer: B------------------------------------------------------------------34.A user-defined format has been created using the FORMAT procedure.How is it stored?A. in a SAS catalogB. in a memory resident lookup tableC. in a SAS dataset in the WORK libraryD. in a SAS dataset in a permanent SAS data libraryAnswer: AThese formats must be stored in the WORK.FORMATS or SASUSER.FORMATS catalog------------------------------------------------------------------ 35.given the SAS data set SASDATA.TWO:X Y-- --5 23 15 6The following SAS program is submitted:data SASUSER.ONE SASUSER.TWO OTHER;set SASDATA.TWO;if X eq 5 then output SASUSER.ONE;if Y lt 5 then output SASUSER.TWO;output;run;What is the result?A.data set SASUSER.ONE has 5 observationsdata set SASUSER.TWO has 5 observationsdata set WORK.OTHER has 3 observationsB.data set SASUSER.ONE has 2 observationsdata set SASUSER.TWO has 2 observationsdata set WORK.OTHER has 1 observationsC.data set SASUSER.ONE has 2 observationsdata set SASUSER.TWO has 2 observationsdata set WORK.OTHER has 5 observationsD. No data sets are output. The DATA step fails execution due to syntax errors.Answer: A------------------------------------------------------------------ 36.Given the contents of the raw data file 'EMPLOYEE.TXT':----+----10---+----20---+----30--Xing 2 19 2004 ACCTBob 5 22 2004 MKTGJorge 3 14 2004 EDUCThe following SAS program is submitted:data WORK.EMPLOYEE;infile 'EMPLOYEE.TXT';input@1 FirstName $@15 StartDate@25 Department $;run;Which SAS informat correctly completes the program?A. date9.B. mmddyy10.C. ddmmyy10.D. mondayyr10.Answer: B-------------------------------------------------------------37.The SAS data set Fed.Banks contains a variable Open_Date which has been assigned a permanent label of "Open Date". Which SAS program temporarilyreplaces the label "Open Date" with the label "Starting Date" in the output?A.proc print data=SASUSER.HOUSES label;label Open_Date "Starting Date";run;B.proc print data=SASUSER.HOUSES label;label Open_Date="Starting Date";run;C.proc print data=SASUSER.HOUSES;label Open_Date="Starting Date";run;D.proc print data=SASUSER.HOUSES;Open_Date="Starting Date";run;Answer: B------------------------------------------------------------------ 38.Given the SAS data set WORK.ONE:X Y Z- - --1 A 271 A 331 B 452 A 523 B 704 A 824 C 91The following SAS program is submitted:data WORK.TWO;set WORK.ONE;by X Y;if First.Y;run;proc print data=WORK.TWO noobs; run;Which report is produced?A.X Y Z-- -- --1 B 452 B 693 B 704 A 82 4 C 91B.X Y Z -- -- -- 1 A 271 B 452 A 522 B 693 B 704 A 82 4 C 91C.X Y Z -- -- -- 1 A 33 1 B 452 B 693 B 704 A 824 C 91D. The PRINT procedure fails because the data set WORK.TWO is not created in the DATA step.Answer: B------------------------------------------------------------------39.The following SAS program is submitted:data WORK.AUTHORS;array Favorites{3} $ 8 ('Shakespeare','Hemingway','McCaffrey'); run;What is the value of the second variable in the dataset WORK.AUTHORS?A. HemingwayB. HemingwaC. ' ' (a missing value)D. The program contains errors. No variables are created.Answer: B------------------------------------------------------------------ 40.The following SAS program is submitted:data WORK.PRODUCTS;Prod=1;do while(Prod LE 6);Prod + 1;end;run;What is the value of the variable Prod in the output data set?A. 6B. 7C. 8D. . (missing numeric)Answer: B。
SAS认证考试(官方练习题集和校正答案)

1. A raw data file is listedbelow.The following program issubmitted using this file asinput:data work.family;infile 'file-specification';<insert INPUTstatement here>run;Which INPUT statementcorrectly reads the values forthe variable Birthdate asSAS date values?a.input relation$ first_name$ birthdate date9.;b.input relation$ first_name$ birthdatemmddyy8.;c.input relation$ first_name$ birthdate :date9.;d.input relation$ first_name$ birthdate :mmddyy8.;Correct answer: dAn informat is used to translate the calendar date to a SAS datevalue. The date values are in the form of two-digit values formonth-day-year, so the MMDDYY8. informat must be used.When using an informat with list input, the colon-formatmodifier is required to correctly associate the informat with thevariable name.You can learn about•informats in Reading Date and Time Values•the colon-format modifier in Reading Free-FormatData.2. A raw data file is listed below.1---+----10---+----20---+---Jose,47,210Sue,,108The following SAS program is submitted using the raw data fileabove as input:data employeestats;<insert INFILE statement here>input name $ age weight;run;The following output is desired:name age weightJose47210Sue.108Which of the following INFILE statements completes theprogram and accesses the data correctly?a.infile 'file-specification' pad;b.infile 'file-specification' dsd;c.infile 'file-specification' dlm=',';d.infile 'file-specification' missover;Correct answer: bThe PAD option specifies that SAS pad variable length recordswith blanks. The MISSOVER option prevents SAS fromreading past the end of the line when reading free formatteddata. The DLM= option specifies the comma as the delimiter;however, consecutive delimiters are treated as one by default.The DSD option correctly reads the data with commas asdelimiters and two consecutive commas indicating a missingvalue like those in this raw data file.You can learn about•the PAD option in Reading Raw Data in Fixed Fields•the MISSOVER option in Creating MultipleObservations from a Single Record•the DLM= option and the DSD option in Reading Free-Format Data.3. The following program is submitted:data numrecords;infile cards dlm=',';input agent1 $ agent2 $ agent3 $;cards;jones,,brownjones,spencer,brown;run;What is the value for the variable named Agent2 in the secondobservation?a.Brownb.Spencerc.' ' (missing character value)d.There is no value because only one observation iscreated.Correct answer: dThe CARDS statement enables you to read instream data. Anynumber of consecutive commas are considered to be a singledelimiter as a result of the DLM= option, and the length of eachvariable defaults to 8 bytes. Therefore, the values jones,brownjon, and spencer are assigned to Agent1, Agent2, andAgent3, respectively, for the first observation. The rest of thedata on the record is not read by the INPUT statement and is notoutput to the data set.You can learn about•the CARDS statement in Creating SAS Data Sets fromRaw Data•the default length of variables in Reading Free-FormatData.4. A raw data file is listed below.1---+----10---+----20---+----30---+----40---+----50TWOSTORY 1040 2 1SANDERS ROAD $55,850CONDO 2150 4 2.5JEANS AVENUE $127,150The following program is submitted using this file as input:data work.houses;infile 'file-specification';<insert INPUT statement here>run;Which one of the following INPUT statements reads the rawdata file correctly?a.input @1 style $8.+1 sqfeet 4.+1 bedrooms 1.@20 baths 3.street 16.@40 price dollar8;b.input @1 style $8+1 sqfeet 4.+1 bedrooms 1.@20 baths 3.street $16@40 price dollar8.;c.input @1 style $8.+1 sqfeet 4.+1 bedrooms 1.@20 baths 3.street $16.@40 price dollar8.;d.input @1 style $8.+1 sqfeet 4.+1 bedrooms 1.@20 baths 3street 16.@40 price dollar8.;Correct answer: cFormatted input requires periods as part of the informat name.The period is missing from the variables Style and Street inAnswer b, the variable Baths in Answer d, and the variablePrice in Answer a (which is also missing a dollar sign to readthe variable Street as a character value).You can learn about formatted input and informats in ReadingRaw Data in Fixed Fields.5. The following SAS program is submitted at the start of a newSAS session:libname sasdata 'SAS-data-library';data sasdata.sales;set sasdata.salesdata;profit=expenses-revenues;run;proc print data=sales;run;The SAS data set Sasdata.Salesdata has ten observations.Which one of the following explains why a report fails togenerate?a.The DATA step fails execution.b.The SAS data set Sales does not exist.c.The SAS data set Sales has no observations.d.The PRINT procedure contains a syntax error.Correct answer: bThe DATA step creates a permanent SAS data set,Sasdata.Salesdata. The PRINT procedure is printing atemporary SAS data set, Sales, that is stored in the Worklibrary. At the beginning of the SAS session, Work.Sales doesnot exist.You can learn about•creating permanent data sets with the DATA step inCreating SAS Data Sets from Raw Data•temporary data sets in Basic Concepts.6. Which action assigns a reference named SALES to a permanentSAS data library?a.Issuing the command:libref SALES 'SAS-data-library'b.Issuing the command:libname SALES 'SAS-data-library'c.Submitting the statement:libref SALES 'SAS-data-library';d.Submitting the statement:libname SALES 'SAS-data-library';Correct answer: dThe LIBNAME statement assigns a reference known as a librefto a permanent SAS data library. The LIBNAME commandopens the LIBNAME window.You can learn about the LIBNAME statement in ReferencingFiles and Setting Options.7. The following SAS program is submitted:data newstaff;set staff;<insert WHERE statement here>run;Which one of the following WHERE statements completes theprogram and selects only observations with a Hire_date ofFebruary 23, 2000?a.where hire_date='23feb2000'd;b.where hire_date='23feb2000';c.where hire_date='02/23/2000'd;d.where hire_date='02/23/2000';Correct answer: aA SAS date constant must take the form of one- or two-digitday, three-digit month, and two- or four-digit year, enclosed inquotation marks and followed by a d ('ddmmmyy<yy>'d).You can learn about SAS date constants in Creating SAS DataSets from Raw Data.8. Which one of the following SAS date formats displays the SASdate value for January 16, 2002 in the form of 16/01/2002?a.DATE10.b.DDMMYY10.c.WEEKDATE10.d.DDMMYYYY10.Correct answer: bThe requested output is in day-month-year order and is 10 byteslong, so DDMMYY10. is the correct format. AlthoughWEEKDATE10. is a valid SAS format, it does not display theSAS date value as shown in the question above.DDMMYYYY10. is not a valid SAS date format, and theDATE w. format cannot accept a length of 10.You can learn about•the DDMMYY10. format in Creating List Reports•the WEEKDATE10. format in Reading Date and TimeValues.9. Which one of the following displays the contents of an externalfile from within a SAS session?a.the LIST procedureb.the PRINT procedurec.the FSLIST procedured.the VIEWTABLE windowCorrect answer: cThe PRINT procedure and VIEWTABLE window display thevalues in SAS data sets. The FSLIST procedure displays thevalues in external files. There is no LIST procedure in SAS.You can learn about•the PRINT procedure in Creating List Reports•the VIEWTABLE window in Referencing Files andSetting Options.10. The SAS data set Sashelp.Prdsale contains the variablesRegion and Salary with 4 observations per Region.Sashelp.Prdsale is sorted primarily by Region and withinRegion by Salary in descending order.The following program is submitted:data one;set sashelp.prdsale;retain temp;by region descending salary;if first.region thendo;temp=salary;output;end;if last.region thendo;range=salary-temp;output;end;run;For each region, what is the number of observation(s) written tothe output data set?a.0b.1c. 2d.4Correct answer: cThe expression first.region is true once for each regiongroup. The expression last.region is true once for each regiongroup. Therefore, each OUTPUT statement executes once for atotal of 2 observations in the output data set.You can learn about the FIRST.variable expression and theOUTPUT statement in Reading SAS Data Sets.11. The following SAS program is submitted:proc contents data=sasuser.houses;run;The exhibit below contains partial output produced by theCONTENTS procedure.Data Set Name SASUSER.HOUSES Observations15Member Type DATA Variables6Engine V9Indexes0Created Tuesday, April 22,2003 03:09:25 PMObservationLength56Last Modified Tuesday, April 22,2003 03:09:25 PMDeletedObservationsProtection Compressed NO Data Set Type Sorted NOLabel Residential housing for saleDataRepresentationWINDOWS_32Encoding wlatin1 Western (Windows)Which of the following describes the Sasuser.Houses data set?a.The data set is sorted but not indexed.b.The data set is both sorted and indexed.c.The data set is not sorted but is indexed.d.The data set is neither sorted nor indexed.Correct answer: dThe exhibit above shows partial output from the CONTENTSprocedure, In the top right-hand column of the output, you seethat Indexes has a value of 0, which indicates that no indexesexist for this data set. Also, Sorted has a value of NO, whichindicates that the data is not sorted.You can learn about the CONTENTS procedure in ReferencingFiles and Setting Options.12. The following SAS program is submitted:proc sort data=work.test;by fname descending salary;run;Which one of the following represents how the observations aresorted?a.The data set Work.Test is stored in ascending order byboth Fname and Salary values.b.The data set Work.Test is stored in descending order byboth Fname and Salary values.c.The data set Work.Test is stored in descending order byFname and ascending order by Salary values.d.The data set Work.Test is stored in ascending order byFname and in descending order by Salary values.Correct answer: dThe DESCENDING keyword is placed before the variable nameit modifies in the BY statement, so the correct description is indescending order by Salary value within ascending Fnamevalues.You can learn about the SORT procedure and theDESCENDING keyword in Creating List Reports.13. The following SAS program is submitted:data names;title='EDU';if title='EDU' thenDivision='Education';else if title='HR' thenDivision='Human Resources';else Division='Unknown';run;Which one of the following represents the value of the variableDivision in the output data set?catiocationc.Human Red.Human ResourcesCorrect answer: bThe length of the variable Division is set to 9 when the DATAstep compiles. Since the value of the variable Title is EDU, thefirst IF condition is true; therefore, the value of the variableDivision is Education.You can learn about•the length of a variable in Understanding DATA StepProcessing•IF-THEN statements in Creating and ManagingVariables.14. Which one of the following SAS programs creates a variablenamed City with a value of Chicago?a.data work.airports;AirportCode='ord';if AirportCode='ORD' City='Chicago';run;b.data work.airports;AirportCode='ORD';if AirportCode='ORD' City='Chicago';run;c.data work.airports;AirportCode='ORD';if AirportCode='ORD' then City='Chicago';run;d.data work.airports;AirportCode='ORD';if AirportCode='ORD';then City='Chicago';run;Correct answer: cThe correct syntax for an IF-THEN statement is: IF expressionTHEN statement;In this example, the variable City is assigned a value ofChicago only if the expression AirportCode='ORD' is true.You can learn about IF-THEN statements in Creating andManaging Variables.15. The following SAS program is submitted:data work.building;code='DAL523';code='SANFRAN604';code='HOUS731';length code $ 20;run;Which one of the following is the length of the code variable?a.6b.7c.10d.20Correct answer: aThe DATA step first goes through a compilation phase, then anexecution phase. The length of a variable is set during thecompilation phase and is based on the first time the variable isencountered. In this case, the variable code is set to the lengthof the text string DAL523 which is 6 characters long. The nextassignment statements are ignored during compilation. TheLENGTH statement is also ignored since the length has alreadybeen established, but a note will be written to the log.You can learn about•the compilation phase of the DATA step inUnderstanding DATA Step Processing•the LENGTH statement in Creating and ManagingVariables.16. Which of the following statements creates a numeric variablenamed IDnumber with a value of 4198?a.IDnumber=4198;b.IDnumber='4198';c.length IDnumber=8;d.length IDnumber $ 8;Correct answer: aThe first reference to the SAS variable in the DATA step setsthe name, type, and length of the variable in the program datavector (PDV) and in the output SAS data set. The assignmentstatement IDnumber=4198; is the first reference and creates anumeric variable named IDnumber with a default storage lengthof 8 bytes.You can learn about•creating variables in the DATA step in UnderstandingDATA Step Processing•numeric variables in Basic Concepts.17. The following program is submitted:data fltaten;input jobcode $ salary name $;cards;FLAT1 70000 BobFLAT2 60000 JoeFLAT3 30000 Ann;run;data desc;set fltaten;if salary>60000 then description='Over 60';else description='Under 60';run;What is value of the variable named description when thevalue for salary is 30000?a.Under 6b.Under 60c.Over 60d.' ' (missing character value)Correct answer: aThe variable description is being created by the IF-THEN/ELSE statement during compilation. The first occurrenceof the variable description is on the IF statement, and since itis assigned the value Over 60, the length of the variable is 7.Therefore, for the salary value of 30000, description has thevalue of Under 6 (the 0 is truncated.)You can learn about•the compilation phase of the DATA step inUnderstanding DATA Step Processing•IF-THEN/ELSE statements in Creating and ManagingVariables.18. A raw data file is listed below.1---+----10---+----20---+---102320The following program is submitted:data all_sales;infile 'file-specification';input receipts;<insert statement(s) here>run;Which statement(s) complete(s) the program and produce(s) arunning total of the Receipts variable?a.total+receipts;b.total 0;sum total;c.total=total+receipts;d.total=sum(total,receipts);Correct answer: aThe SUM function and the assignment statement do not retainvalues across iterations of the DATA step. The sum statementtotal+receipts; initializes total to 0, ignores missing valuesof receipt, retains the value of total from one iteration to thenext, and adds the value of receipts to total.You can learn about the sum statement in Creating andManaging Variables.19. A raw data file is listed below.1---+----10---+----20---+---1901 21905 11910 61925 11941 1The following SAS program is submitted and references the rawdata file above:data money;infile 'file-specification';input year quantity;total=total+quantity;What is the value of total when the data step finishesexecuting?a.0b.1c.11d. . (missing numeric value)Correct answer: dThe variable Total is assigned a missing value during thecompilation phase of the DATA step. When the first record isread in, SAS processes: total=.+2; which results in a missingvalue. Therefore the variable Total remains missing for allobservations.You can learn about•the compilation phase of the DATA step inUnderstanding DATA Step Processing•using missing values with arithmetic operators inCreating SAS Data Sets from Raw Data.20. The following program is submitted:data test;average=mean(6,4,.,2);run;What is the value of average?a.0b.3c.4d. . (missing numeric value)Correct answer: cThe MEAN function adds all of the non-missing values anddivides by the number of non-missing values. In this case, 6 + 4+ 2 divided by 3 is 4.You can learn about the MEAN function in Transforming Datawith SAS Functions.21. The following SAS program is submitted:data work.AreaCodes;Phonenumber=3125551212;Code='('!!substr(Phonenumber,1,3)!!')';run;Which one of the following is the value of the variable Code inthe output data set?a.( 3)b.(312)c.3d.312Correct answer: aAn automatic data conversion is performed whenever a numericvariable is used where SAS expects a character value. Thenumeric variable is written with the BEST12. format and theresulting character value is right-aligned when the conversionoccurs. In this example, the value of Phonenumber is convertedto character and right-aligned before the SUBSTR function isperformed. Since there are only 10 digits in the value ofPhonenumber, the right-aligned value begins with two blanks.Therefore the SUBSTR function picks up two blanks and a 3,and uses the BEST12. format to assign that value to Code. Then,the parentheses are concatenated before and after the two blanksand a 3.You can learn about automatic data conversion and theSUBSTR function in Transforming Data with SAS Functions.22. The following SAS program is submitted:data work.inventory;products=7;do until (products gt 6);products+1;end;run;Which one of the following is the value of the variableproducts in the output data set?a.5b.6c.7d.8Correct answer: dA DO UNTIL loop always executes at least once because thecondition is not evaluated until the bottom of the loop. In theSAS program above, the value of Products is incremented from7 to 8 on the first iteration of the DO UNTIL loop, before thecondition is checked. Therefore the value of Products is 8.You can learn about DO UNTIL loops in Generating Datawith DO Loops.23. The following program is submitted:data work.test;set work.staff (keep=salary1 salary2 salary3);<insert ARRAY statement here>run;Which ARRAY statement completes the program and createsnew variables?a.array salary{3};b.array new_salary{3};c.array salary{3} salary1-salary3;d.array new_salary{3} salary1-salary3;Correct answer: bAlthough each of the ARRAY statements listed above is a validstatement, only Answer B creates new variables namednew_salary1, new_salary2 and new_salary3. Answer C andAnswer D both create an array that groups the existing data setvariables salary1, salary2, and salary3. Since the array inAnswer A is named salary, it also uses the existing data setvariables.You can learn about creating new variables in an ARRAYstatement in Processing Variables with Arrays.24. Which of the following permanently associates a format with avariable?a.the FORMAT procedureb.a FORMAT statement in a DATA stepc.an INPUT function with format modifiersd.an INPUT statement with formatted style inputCorrect answer: bTo permanently associate a format with a variable, you use theFORMAT statement in a DATA step. You can use theFORMAT procedure to create a user-defined format. You usethe INPUT function to convert character data values to numericvalues with an informat. You use the INPUT statement to readdata into a data set with an informat.You can learn about•permanently assigning a format to a variable in Creatingand Managing Variables•the FORMAT statement in Creating List Reports•the FORMAT procedure in Creating and ApplyingUser-Defined Formats•the INPUT function in Transforming Data with SASFunctions•the INPUT statement in Reading Raw Data in FixedFields.25. The following report is generated:Which of the following steps created the report?a.proc freq data=sasuser.houses;tables style price /nocum;format price dollar10.;label style="Style of homes"price="Asking price";run;b.proc print data=sasuser.houses;class style;var price;table style,n price*mean*f=dollar10.;label style="Style of homes"price="Asking price";run;c.proc means data=sasuser.houses n mean;class style;var price;format price dollar10.;label style="Style of homes"price="Asking price";run;d.proc report data=sasuser.houses nowd headline;column style n price;define style / group "Style of homes";define price / mean format=dollar8."Asking price";run;Correct answer: dThe FREQ procedure cannot create the average asking price.The CLASS statement and the VAR statement are not valid foruse with the PRINT procedure. The MEANS procedure outputwould have both the N statistic and the N Obs statistic since aCLASS statement is used. The REPORT procedure producedYou can learn about•the FREQ procedure in Producing DescriptiveStatistics•the PRINT procedure in Creating List Reports•the MEANS procedure in Producing DescriptiveStatistics•the REPORT procedure in Creating Enhanced List andSummary Reports.26. A SAS report currently flows over two pages because it is toolong to fit within the specified display dimension. Which one ofthe following actions would change the display dimension sothat the report fits on one page?a.Increase the value of the LINENO option.b.Decrease the value of the PAGENO option.c.Decrease the value of the LINESIZE option.d.Increase the value of the PAGESIZE option.Correct answer: dThe PAGESIZE= SAS system option controls the number oflines that compose a page of SAS procedure output. Byincreasing the number of lines available per page, the reportmight fit on one page.You can learn about the PAGESIZE= option in ReferencingFiles and Setting Options.27. Which one of the following SAS REPORT procedure optionscontrols how column headings are displayed over multiplelines?a.SPACE=BEL=d.BREAK=Correct answer: bThe SPLIT= option specifies how to split column headings. TheSPACE=, LABEL= and BREAK= options are not valid optionsin PROC REPORT.You can learn about the SPLIT= option for the REPORTprocedure in Creating Enhanced List and Summary Reports.28. The following SAS program is submitted:ods html file='newfile.html';proc print data=sasuser.houses;run;proc means data=sasuser.houses;run;proc freq data=sasuser.shoes;run;ods html close;proc print data=sasuser.shoes;run;How many HTML files are created?a.1b.2c. 3d.4Correct answer: aBy default, one HTML file is created for each FILE= option orBODY= option in the ODS HTML statement. The ODS HTMLCLOSE statement closes the open HTML file and ends theoutput capture. The Newfile.html file contains the output fromthe PRINT, MEANS, and FREQ procedures.You can learn about the ODS HTML statement in ProducingHTML Output.29. A frequency report of the variable Jobcode in the Work.Actorsdata set is listed below.Jobcode Frequency Percent CumulativeFrequencyCumulativePercentActor I233.33233.33 Actor II233.33466.67 Actor III233.336100.00Frequency Missing = 1The following SAS program is submitted:data work.joblevels;set work.actors;if jobcode in ('Actor I', 'Actor II') thenjoblevel='Beginner';if jobcode='Actor III' thenjoblevel='Advanced';else joblevel='Unknown';run;Which of the following represents the possible values for the variable joblevel in the Work.Joblevels data set?a.Advanced and Unknown onlyb.Beginner and Advanced onlyc.Beginner, Advanced, and Unknownd.' ' (missing character value)Correct answer: aThe DATA step will continue to process those observations that satisfy the condition in the first IF statement Although Joblevel might be set to Beginner for one or more observations, the condition on the second IF statement willevaluate as false, and the ELSE statement will execute and overwrite the value of Joblevel as Unknown.You can learn about•the IF statement in Creating SAS Data Sets from RawData•the ELSE statement in Creating and ManagingVariables.30. The descriptor and data portions of the Work.Salaries data setare shown below.Variable Type Len Posname Char80salary Char816status Char88name status salaryLiz S15,600Herman S26,700Marty S35,000The following SAS program is submitted:proc print data=work.salaries;where salary<20000;run;What is displayed in the SAS log after the program is executed?a.A NOTE indicating that 1 observation is read.b.A NOTE indicating that 0 observations were read.c.A WARNING indicating that character values have beenconverted to numeric values.d.An ERROR indicating that the WHERE clause operatorrequires compatible variables.Correct answer: dSalary is defined as a character variable. Therefore, the valuein the WHERE statement must be the character value 20,000enclosed in quotation marks.You can learn about the WHERE statement in Creating ListReports.31. Which of the following statements is true when SAS encountersa syntax error in a DATA step?a.The SAS log contains an explanation of the error.b.The DATA step continues to execute and the resultingdata set is complete.c.The DATA step stops executing at the point of the errorand the resulting data set contains observations up to thatpoint.d.A note appears in the SAS log indicating that theincorrect statement was saved to a SAS data set forfurther examination.Correct answer: aSAS scans the DATA step for syntax errors during thecompilation phase. If there are syntax errors, those errors getwritten to the log. Most syntax errors prevent further processingof the DATA step.You can learn about how SAS handles syntax errors in theDATA step in Understanding DATA Step Processing.32. Which TITLE statement would display JANE'S DOG as the textof the title?a.title "JANE"S DOG";b.title 'JANE"S DOG';c.title "JANE'S DOG";d.title 'JANE' ' 'S DOG';Correct answer: c。
SAS期末试题及答案解析

5月31日上机作业:《统计分析系统SAS》模拟练习,结果不用上传保险公司为了解车险投保人对保险公司工作的满意程度Y和投保人的年龄X1、事故的严重程度X2及投保人的焦虑程度X3之间的关系,随机调查了该保险公司的23位报险人,得到数据表如下。
将数据作变换:将X2与Y数据上加上你学号的后1位,如学号的最后一位数据为2,则第1位报险人的X2=51+2,Y=48+2,其余数据依此类推。
一、数据集的建立1. 简述建立数据集时,SAS逻辑库的作用2. 若在D盘根目录建立了一个名字为“AA”的逻辑库,,上述数据集名字为temp,在windows 环境下数据集全名为_ ,SAS环境下,数据集名字的完整表示为_ 。
二、基本统计分析1.INSIGHT中,得到变量X2的均值为_ ,标准差为_ ,变异系数为_ _,方差为为__ 2.变量Y的的均值为_ ,标准差为_ ,变异系数为_ _,方差为为_ _。
三、正态性检验对数据进行正态性检验,以0.1为显著性水平进行检验,得到的结果中,变量为正态分布,为非正态分布;变量Y的中位数为,数据中有25%的值小于。
四、相关分析1.变量X1和Y的相关系数为R= ,X2和Y的相关系数R=,X3和Y的相关系数R=,X2和X3的相关系数R= 。
2. 写出用相关系数说明问题时,要注意的几点,至少写出3点。
(答案供参考)答:1)相关系数很强并不表示变量间一定有因果关系,也可能是两个变量同时受第三个变量的影响而使他们有很强的相关;2)相关系数是说明线性联系程度的。
相关系数接近于0的变量间可能存在非线性联系(可能是曲线关系);3)有时个别极端数据可能影响相关系数;4)强相关并不表示一定存在因果关系;5)弱相关并不表示变量间不存在关系。
五、假设检验1.简述假设检验的基本思想。
在假设检验中,P值的含义是什么?(答案供参考)答:首先给定一个原假设H0,H0是关于总体参数的表述,与此同时存在一个与H0相对立的备择假设H1,H0与H1有且仅有一个成立;经过一次抽样,若发生了小概率事件(通常把概率小于0.05的事件称为小概率事件),可以依据“小概率事件在一次实验中几乎不可能发生”的理由,怀疑原假设不真,作出拒绝原假设H0,接受H1的决定;反之,若小概率事件没有发生,就没有理由拒绝H0,从而应作出拒绝H1的决定。
统计软件SAS试题及答案(新)

滨州医学院2010~2011学年第一学期《统计软件》试题(A卷)(考试时间:120分钟,满分:100分)用题班级:2008级统计学专业一、数据库整理:(1题共42分)做题要求:按照要求写出程序,书写要符合SAS程序的规则。
随机抽取8名医学生的基础课程成绩与医学专业课程成绩,其成绩数据如表:医学基础课医学专业课解剖组胚生化生理内科外科妇产儿科X1 X2 X3 X4 Y1 Y2 Y3 Y470 64 97 77 59 81 63 8177 53 72 62 76 82 77 7975 82 66 68 62 75 72 8274 84 84 58 78 79 59 8275 68 73 72 77 81 73 7674 70 94 79 66 93 64 8274 84 86 82 79 79 55 78 (1)用input和cards语句将以上数据建立一个永久性数据集a1,逻辑库名exam,存放路径为’ d:\sas\exam1’,数据库内包含8个变量,分别为8门功课成绩,变量名如表中所示;(8分)libname exam ' d:\sas\exam1';data exam.a1;input X1 X2 X3 X4 Y1 Y2 Y3 Y4 @@;cards;70 64 97 77 59 81 63 8177 53 72 62 76 82 77 7975 82 66 68 62 75 72 8274 84 84 58 78 79 59 8275 68 73 72 77 81 73 7674 70 94 79 66 93 64 8274 84 86 82 79 79 55 7868 83 79 66 80 67 66 78;run;(2)用set语句建立临时性数据集a2,且该数据集不包括外科成绩低于80分的学生成绩;(6分)data a2;set exam.a1;if y2>=80then output a2;run;(3)将(1)中建立的数据集拆分成医学基础课与医学专业课两个数据集,数据集名称分别为exam_base与exam_spe,并将妇产命名为gyn。
SAS练习题及程序答案

1.随机取组随机取组 有无重复试验的两种有无重复试验的两种 本题是无重复本题是无重复 DATA PGM15G; DO A=1 TO 4; /*A 为窝别*/ DO B=1 TO 3; ; /*B /*B 为雌激素剂量*/ INPUT X @@; X @@; /*X /*X 为子宫重量*/OUTPUT ;END ;END ;CARDS ;106 116 145 42 68 115 70 111 133 42 63 87 ; RUN ;ods html ; /*将结果输出成网页格式,SAS9.0以后版本可用*/ PROC GLM DATA =PGM15G; CLASS A B;MODEL X=A B / X=A B / SS3SS3;MEANS A B; /*给出因素A 、B 各水平下的均值和标准差*/MEANS B / B / SNK SNK ; /*对因素B (即剂量)各水平下的均值进行两两比较*/ RUN ;ODS HTML CLOSE ;2. 2*3析因设计析因设计 两因素两因素 完全随机完全随机 统计方法统计方法 2*3析因设计析因设计 tiff =f 的开方的开方DATA aaa; DO zs=125,200;DO repeat=1 TO 2; ; /*/*每种试验条件下有2次独立重复试验*/ do js=0.015,0.030,0.045; INPUT cl @@; OUTPUT ;END ;END ;END ; CARDS ;2.70 2.45 2.60 2.78 2.49 2.72 2.83 2.85 2.86 2.86 2.80 2.87 ; run ;PROC GLM ;CLASS zs js; MODEL cl=zs js zs*js / cl=zs js zs*js / SS3SS3; MEANS zs*js;LSMEANS zs*js / TDIFF PDIFF ; ; /*/*对 zs 和js 各水平组合而成的试验条件进行均数进行两两比较*/ RUN ;ODS HTML CLOSE ;练习一:2*2横断面研究列链表横断面研究列链表 方法:卡方方法:卡方 矫正卡方矫正卡方 FISHERDATA PGM19A;DO A=1 TO 2; DO B=1 TO 2;INPUT F @@;OUTPUT ;END ;END ;CARDS ; 2 26 8 21 ;run ;PROC FREQ ; WEIGHT F;TABLES A*B / A*B / CHISQ CHISQ ;RUN ;样本大小 = 57练习二:对裂列连表练习二:对裂列连表 结果变量结果变量 换和不换换和不换 三部曲三部曲 1横断面研究横断面研究 P 《0.05 RDATA PGM19B; DO A=1 TO 2; DO B=1 TO 2;INPUT F @@;OUTPUT ;END ;END ;CARDS ; 40 3414 1 19252 ; run ; ods html ;PROC FREQ ; WEIGHT F;TABLES A*B / A*B / CHISQCHISQ cmh ; RUN ;ods html close ;样本大小 = 57练习三:病例对照2*2 病例组中病例组中 有何没有那个基因有何没有那个基因 是正常的3.8倍,倍, 则有可能导致痴呆则有可能导致痴呆 要做前瞻性研究要做前瞻性研究 用对裂用对裂DATA PGM20;DO A=1 TO 2; DO B=1 TO 2;INPUT F @@;OUTPUT ;END ;END ;CARDS ; 240 60 360 340 ;run ; ods html ; PROC FREQ ; WEIGHT F;TABLES A*B / A*B / CHISQ CHISQcmh ; RUN ; ods html close ;总样本大小 = 1000 练习四:配对设计配对设计 隐含金标准2*2 MC 卡方卡方 检验检验 34和0在总体上在总体上((B+C 《40 用矫正卡方) 是否相等是否相等 则可得甲培养基优于乙培养基则可得甲培养基优于乙培养基 一般都用矫正一般都用矫正 因卡方为近似计算因卡方为近似计算DATA PGM19F; INPUT b c;chi=(ABS(b-c)-1)**2/(b+c);p=1-PROBCHI(chi,1);求概率 1减掉从左侧积分到卡方的值减掉从左侧积分到卡方的值 chi=ROUND(chi, 0.001);IF p>0.0001 THEN p=ROUND(p,0.0001);FILEPRINT ; PUT (打印在输出床口) #2 @10'Chisq' @30 'P value'(#表示行) #4 @10 chi @30 p; CARDS ; 34 0 ;run;ods html close;练习五:双向有序R*C列连表列连表用KPA data aaa;do a=1 to 3;do b=1 to 3;input f @@;output;end;end;cards ;58 2 31 42 78 9 17;run;ods html;*简单kappa检验;proc freq data=aaa;weight f;(频数)(频数)tables a*b;test kappa;run ;*加权kappa检验;proc freq;weight f;tables a*b;test wtkap;run ;ods html close;SAS 系统FREQ 过程频数 百分比 行百分比列百分比a *b 表a b 合计1 2 31 5839.4621.3632.046342.8692.06 86.57 3.173.774.7611.112 10.682.001.49 4228.5784.0079.2574.7614.0025.935034.013 85.4423.5311.94 96.1226.4716.981711.5650.0062.963423.13合计 6745.58 5336.052718.37147100.00a *b 表的统计量对称性检验统计量 (S) 2.8561自由度 3Pr > S 0.4144对称性检验指 总体上主对角线的上三角数相加是否与下三角三个数相加 对称性检验与KPA 检验是否一致 是否一个可以代替另一个检验 Pe理论观察一致率 独立假设性基础上计算的 相互独立简单 Kappa 系数Kappa 0.6809渐近标准误差 0.050095% 置信下限 0.583095% 置信上限 0.7788H0 检验: Kappa = 0总体的H0 下的渐近标准误差 0.0597Z 11.4112H0 检验: Kappa = 0单侧 Pr> Z <.0001双侧 Pr>|Z| <.0001总体的KPA是否为0 KPA大于0两种方法的一致性有统计学意义 小于0 不一致性有统计学意义加权的 Kappa 系数加权的 Kappa 0.6614渐近标准误差 0.056095% 置信下限 0.551695% 置信上限 0.7711置信区间不包括0 拒绝H0 按此计算结果可以用一种取代另一种方法 但要看专业要求达到多少才可以 观测一致率达到多少才可以代替样本大小 = 147FREQ 过程频数 百分比 行百分比列百分比a *b 表a b 合计1 2 31 5839.4692.0686.5721.363.173.7732.044.7611.116342.862 10.682.001.494228.5784.0079.2574.7614.0025.935034.013 85.4423.5311.9496.1226.4716.981711.5650.0062.963423.13合计 6745.58 5336.052718.37147100.00a *b 表的统计量对称性检验统计量 (S) 2.8561自由度 3Pr > S 0.4144简单 Kappa 系数Kappa 0.6809渐近标准误差 0.050095% 置信下限 0.583095% 置信上限 0.7788加权的 Kappa 系数加权的 Kappa 0.6614渐近标准误差 0.056095% 置信下限 0.551695% 置信上限 0.7711H0 检验: 加权的 Kappa = 0H0 下的渐近标准误差 0.0646Z 10.2406单侧 Pr> Z <.0001双侧 Pr>|Z| <.0001对加权的KPA 检验 与简单的(利用对角线上的数据分析)加权还要利用对角线以外的数据分析 样本大小 = 147练习六:双向无序R*C 列连表列连表 用卡方理论频数小于5没有超过五分之一,没有超过五分之一,一般用卡方一般用卡方一般用卡方 实在不行用FISHER 检验检验 超过用KPA 两种血型都是按小中大排列两种血型都是按小中大排列 相互不影响相互不影响 独立的独立的 接受H0 不一致不一致行与列变量相互不影响行与列变量相互不影响 DATA PGM20A; DO A=1 TO 4; DO B=1 TO 3;INPUT F @@;OUTPUT ;END ;END ;CARDS ;431 490 902 388 410 800 495 587 950 137 179 325 ; run ; ods html ; PROC FREQ ; WEIGHT F;TABLES A*B / A*B / CHISQCHISQ ;*exact; RUN ;ods html close ;样本大小 = 6094练习七:单向有序R*C 秩和检验秩和检验*方法1;(单因素非参数 HO 三个药物疗效相同 H1不完全相等)不完全相等) DATA PGM20C; DO A=1 TO 4; DO B=1 TO 3; INPUT F @@;OUTPUT ;END ;END ;CARDS ; 15 4 1 49 9 15 31 50 45 5 22 24 ; run ; ods html ;PROC NPAR1WAY WILCOXON ; FREQ FREQ F;CLASS B; VAR A; RUN ;*方法2;(FIQ CHIM ) proc freq data =PGM20C; weight f;tables b*a/ b*a/cmh cmhscores =rank; run ; ods html close ;总样本大小 = 270练习八:练习八: 双向有序双向有序 属性不同属性不同 R*C 4种目的4种方法种方法SPEARMAN 秩相关分析 DATA PGM20E; DO A=1 TO 3; DO B=1 TO 3;INPUT F @@;OUTPUT ;END ;END ;CARDS ; 215 131 148 67 101 128 44 63 132;run ; ods html ; PROC CORR SPEARMAN ;VAR A B; FREQ F; RUN ;ods html close ;统计分析与SAS 实现第1次上机实习题一、定量资料上机实习题要求:要求:(1) 先判断定量资料所对应的实验设计类型;(2) 假定资料满足参数检验的前提条件,请选用相应设计的定量资料的方差分析,并用SAS 软件实现统计计算;(3) 摘录主要计算结果并合理解释,给出统计学结论和专业结论。
SAS练习题及答案

1.SAS系统主要完成以数据为中心的四大功能,其中核心功能为:统计分析功能2.在SAS系统的组成模块中,能进行数据管理和数据加工、处理的模块……BASE模块3.SAS显示管理系统窗口中能够提交当前运行的SAS程序执行过程的窗口为:…………………………………………………………………PGM窗口4.如下一段SAS程序:DATA ;INPUT X @@;CARDS:2 3 4 9 1 ;RUN;模块当运行程序以后SAS系统会产生SAS数据集………………………………………( C )A. DATAB. NULLC. DATA1D.程序错误5.INPUT语句一般用来指定数据的读入方式,可以读取各种类型的数据包括字符型,现有如下的一段程序:DATA ONE;INPUT NAME $ SCORE;CARDS;Wanglin 85Zhang dong-feng 90;那么在第二个观测中读取到的NAME 为……………………………………………(B)A. Zhang dong-fengB. ZhangC. Zhang doD. Zhang dong6.假设变量X的值为5,有如下程序IF X<5 THENX=X+3;ELSEX=X-2;则执行程序以后变量X的值为………………………………………………………( B)A. 5B.3C.8D. 程序错误7.DATA TEST;DO I=1 TO 3;PUT I= ;END;RUN;程序结果在LOG窗口输出形式为……………………………………………………( A )A. I=1 I=2 I=3B.I=2 I=3 I=4C. 不显示D. I=3 I=2 I=18.假设变量X1=-10.253 X2=-5 则[SIGN(X1)+ABS(X2)]/INT(X1)的运算结果为………………………………………( B)A.-4B.-0.4C. 4D.0.5759.逻辑运算[(5<1)|(4<>2)]&(7>2)的结果为:……………………………………( 1 )10.以下几个统计量在UNIVARIATE过程中能求得到得而在MEANS过程中无法求得的是………………………………………………………………………………………( B )A. meanB. varC. Q1D.range11.SAS系统主要完成以数据为中心的四大功能,其中能够将Excel、Lotus、DBF、TXT等数据转化成SAS 数据集属于…………………………… (数据管理功能 )12. SAS数据集是关系型结构,分成两部分:描述部分和。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1.随机取组有无重复试验的两种本题是无重复DATA PGM15G;DO A=1TO4; /*A为窝别*/DO B=1TO3; /*B为雌激素剂量*/INPUT X @@; /*X为子宫重量*/OUTPUT;END;END;CARDS;106 116 14542 68 11570 111 13342 63 87;RUN;ods html; /*将结果输出成网页格式,SAS9.0以后版本可用*/ PROC GLM DATA=PGM15G;CLASS A B;MODEL X=A B / SS3;MEANS A B; /*给出因素A、B各水平下的均值和标准差*/MEANS B / SNK; /*对因素B(即剂量)各水平下的均值进行两两比较*/ RUN;ODS HTML CLOSE;2.2*3析因设计两因素完全随机统计方法 2*3析因设计 tiff =f的开方DATA aaa;DO zs=125,200;DO repeat=1TO2; /*每种试验条件下有2次独立重复试验*/do js=0.015,0.030,0.045;INPUT cl @@;OUTPUT;END;END;END;CARDS;2.70 2.45 2.602.78 2.49 2.722.83 2.85 2.862.86 2.80 2.87;run;PROC GLM;CLASS zs js;MODEL cl=zs js zs*js / SS3;MEANS zs*js;LSMEANS zs*js / TDIFF PDIFF; /*对 zs和js各水平组合而成的试验条件进行均数进行两两比较*/RUN;ODS HTML CLOSE;练习一:2*2横断面研究列链表方法:卡方矫正卡方 FISHERDATA PGM19A;DO A=1TO2;DO B=1TO2;INPUT F @@;OUTPUT;END;END;CARDS;2 268 21;run;PROC FREQ;WEIGHT F;TABLES A*B / CHISQ;RUN;样本大小 = 57练习二:对裂列连表结果变量换和不换三部曲 1横断面研究 P《0.05 RDATA PGM19B;DO A=1TO2;DO B=1TO2;INPUT F @@;OUTPUT;END;END;CARDS;40 34141 19252;run;ods html;PROC FREQ;WEIGHT F;TABLES A*B / CHISQ cmh;RUN;ods html close;样本大小 = 57练习三:病例对照2*2 病例组中有何没有那个基因是正常的3.8倍,则有可能导致痴呆要做前瞻性研究用对裂DATA PGM20;DO A=1TO2;DO B=1TO2;INPUT F @@;OUTPUT;END;END;CARDS;240 60360 340;run;ods html;PROC FREQ;WEIGHT F;TABLES A*B / CHISQ cmh;RUN;ods html close;总样本大小 = 1000练习四:配对设计隐含金标准2*2 MC卡方检验 34和0在总体上(B+C《40 用矫正卡方)是否相等则可得甲培养基优于乙培养基一般都用矫正因卡方为近似计算DATA PGM19F;INPUT b c;chi=(ABS(b-c)-1)**2/(b+c);p=1-PROBCHI(chi,1);求概率 1减掉从左侧积分到卡方的值chi=ROUND(chi, 0.001);IF p>0.0001THEN p=ROUND(p,0.0001);FILE PRINT;PUT(打印在输出床口) #2 @10'Chisq' @30'P value'(#表示行)#4 @10 chi @30 p;CARDS;34 0;run;ods html close;练习五:双向有序R*C列连表用KPA data aaa;do a=1to3;do b=1to3;input f @@;output;end;end;cards;58 2 31 42 78 9 17;run;ods html;*简单kappa检验;proc freq data=aaa;weight f;(频数)tables a*b;test kappa;run;FREQ 过程a *b 表的统计量对称性检验指总体上主对角线的上三角数相加是否与下三角三个数相加对称性检验与KPA 检验是否一致是否一个可以代替另一个检验 Pe理论观察一致率独立假设性基础上计算的相互独立总体的KPA 是否为0 KPA 大于0两种方法的一致性有统计学意义 小于0 不一致性有统计学意义置信区间不包括0 拒绝H0 按此计算结果可以用一种取代另一种方法 但要看专业要求达到多少才可以 观测一致率达到多少才可以代替 样本大小 = 147FREQ 过程a *b 表的统计量对加权的KPA检验与简单的(利用对角线上的数据分析)加权还要利用对角线以外的数据分析样本大小 = 147练习六:双向无序R*C 列连表用卡方理论频数小于5没有超过五分之一,一般用卡方实在不行用FISHER检验超过用KPA 两种血型都是按小中大排列相互不影响独立的接受H0 不一致行与列变量相互不影响DATA PGM20A;DO A=1TO4;DO B=1TO3;INPUT F @@;OUTPUT;END;END;CARDS;431 490 902388 410 800495 587 950137 179 325;run;ods html;PROC FREQ;WEIGHT F;TABLES A*B / CHISQ;*exact;RUN;ods html close;样本大小 = 6094练习七:单向有序R*C 秩和检验*方法1;(单因素非参数 HO三个药物疗效相同 H1不完全相等)DATA PGM20C;DO A=1TO4;DO B=1TO3;INPUT F @@;OUTPUT;END;END;CARDS;15 4 149 9 1531 50 455 22 24;run;ods html;PROC NPAR1WAY WILCOXON;FREQ F;CLASS B;VAR A;RUN;*方法2;(FIQ CHIM)proc freq data=PGM20C;weight f;tables b*a/cmh scores=rank;run;ods html close;总样本大小 = 270练习八:双向有序属性不同 R*C 4种目的4种方法SPEARMAN秩相关分析DATA PGM20E;DO A=1TO3;DO B=1TO3;INPUT F @@;OUTPUT;END;END;CARDS;215 131 14867 101 12844 63 132;run;ods html;PROC CORR SPEARMAN;VAR A B;FREQ F;RUN;ods html close;统计分析与SAS实现第1次上机实习题一、定量资料上机实习题要求:(1)先判断定量资料所对应的实验设计类型;(2)假定资料满足参数检验的前提条件,请选用相应设计的定量资料的方差分析,并用SAS软件实现统计计算;(3)摘录主要计算结果并合理解释,给出统计学结论和专业结论。
【练习1】取4窝不同种系未成年的大白鼠,每窝3只,随机分配到三个实验组中,分别注射不同剂量雌激素,经过一定时间后处死大白鼠测子宫重量,资料见表1。
问剂量和窝别的各自水平下子宫重量之间的差别有无统计学意义?若剂量间差别有统计学意义,请作两两比较。
表1 未成年大白鼠注射不同剂量雌激素后的子宫重量子宫重量(g)窝别剂量(μg/100g):0.2 0.4 0.8 合计1 106 116 145 3672 42 68 115 2253 70 111 133 3144 42 63 87 192合计260 358 480 1098【SAS程序】:程序1【练习2】一位工程师研究由钻头压力产生的冲力。
考察了A(钻孔速度)和B(进料速度),两因素分别取2与3水平,各水平组合下均做了两次独立重复实验,资料见表2。
假定资料满足参数检验的前提条件,且两因素对观测结果的影响地位平等,已知冲力越小越好,试作分析,尽可能给出较为明确的统计和专业结论。
表2 在钻孔速度和进料速度取不同水平的条件下冲力的测定结果钻孔冲力(单位)速度进料速度:0.015 0.030 0.045125 2.70 2.45 2.602.78 2.49 2.72200 2.83 2.85 2.862.86 2.80 2.87【SAS程序】:程序2.二、定性资料上机实习题要求:(1)若题目中未给出表格,请列出标准的列联表,并对其命名;(2)若题目中已列出不规范的表格,先修改,然后对其命名;(3)根据分析目的或自己提出分析目的、资料的前提条件选用相应的统计分析方法,并用SAS软件实现计算;(4)将主要计算结果摘录出来,给出统计学和专业结论。
【练习1】某卫生防疫站对屠宰场及肉食零售点的猪肉,检查其表层沙门氏菌带菌情况,结果如下表。
试比较屠宰场与肉食零售点猪肉表层沙门氏菌的带菌率之间差别有无统计学意义?表1 屠宰场及肉食零售点猪肉表层沙门氏菌抽检结果采样地点检查数阳性数值带菌率(%)屠宰场28 2 7.14零售点29 8 27.59【SAS程序】:练习1【练习2】有人对某部门22707名雇员中,普查了HBsAg,其中3454名阳性,19253名为阴性。
从1975年起,追踪了3年,发现在阳性组有40名患了肝癌,阴性组仅一名患肝癌。
试选用合适的方法对资料进行全面分析。
【SAS 程序】:练习2【练习3】APOE-4等位基因与老年痴呆性的关联研究:以600名晚发及散发老年痴呆患者和400名正常对照为研究对象,分析APOE-4等位基因与老年痴呆性的关系。
表4 APOE-4等位基因与老年痴呆性病例对照关联研究AGT 等位基因 例数合计 病例组 对照组 APOE-4 240 60 300 非APOE-4360 340 700 合计6004001000【SAS 程序】:练习3【练习4】请分析下表资料。
已从专业上认定培养的阳性结果就是“真阳性”,而不会出现假阳性。
甲培养基 培养结果例数乙培养基结果:+ - 合计 + 36 34 70 - 0 135 135 合计36169205配对设计2×2列联表资料总体率差异性检验统计量的计算公式 若b +c ≥40时若b +c <40时【SAS 程序】:练习4【练习5】请分析下表资料。
表6 两法检查室壁收缩运动的符合情况 ━━━━━━━━━━━━━━━━━━━对比法测 冠心病人数 定的结果核素法∶正常 减弱 异常 ───────────────────()()c a c c a a odd ++=//)(11比数()()d b d d b b odd ++=//)(22比数d b c a odd odd OR //21==1)(22=+-=νχc b c b 1)1(22=+--=νχcb c b异常 8 9 17───────────────合计 67 53 27━━━━━━━━━━━━━━━━━━━【SAS程序】:练习5简单kappa检验和加权kappa检验这两种方法都是用来检验两种评价方法是否具有一致性的方法。