首页 > 其他分享 >MS3251 Analytics Using SAS

MS3251 Analytics Using SAS

时间:2024-11-28 21:01:44浏览次数:6  
标签:code Analytics set SAS Using 2016 data your

MS3251 Analytics Using SAS

Assignment 2

  • You must complete the assignment by yourself. Exchanging ideas with classmates isencouraged, but you must not cross the line between discussion and collaboration. Showing your work to your classmates is a non-acceptable collaboration. All identified collaboration work will have a 0 mark.
  • Complete all questions. Put all of your SAS code into one PDF file. You must mark eachquestion’s answer as SAS comment statements in the code, such as /*Task 1*/. Nameyour code file as nnnnnnnn.pdf, where nnnnnnnn is your full name.You should set all irrelevant statements in your code as SAS comment statements. Beaware that your SAS code created under a non-English operating system may containextraneous characters when viewed in an English operating system. You are responsiblefor ensuring your submitted code is free of these characters. All extraneous charactersinyour submitted code will be considered errors. Utilising codes not included in the course notes will not be accepted as correct answers,even though they are not wrong.
  • When running in SAS OnDemand Studio, your submitted SAS code should be error-free.
  • You must submit your code file via the link Assignment 2 under the Assignments sectionof the course on Canvas. If you submit your file more than once, only the latest submittedfile will be marked. The assignment is due at 06:00 AM on 4 December 2024. Two marksshall be deducted for every 1 minute or less late. The submission link will be closed at06:30 AM on 4 December 2024. Submission by other methods will not be accepted.

Tasks Download Assignment2.zip from the Assignments folder under the Files section. Expand theipped file for the following:rofile_2016.sas7bdatFlying_2016.sas7bdat

Redemption_2016.sas7bdat

  • Variables_Disctionary.xlsx

The variable descriptions can be found in Variables_Dictionary.xlsx. Do not change the contents of these data sets unless you are told to do so explicitly. You are asked to write an SAS program for the tasks below. Unless stated explicitly, you can deploy Task 1:Define a SAS library named xxxxxxxx for the folder containing the three SAS data sets in yourAS Studio account, where xxxxxxxx is your given name (or first name). Use only thefirst eightollowing activities:• Create a new data set named Profile that includes all columns and rows fromProfile_2016. Store Profile in the SAS Work library.

Add a new column named Tenure to Profile. Calculate a member’s tenure as full yearsfrom their join date to 1 January 2017. For example, if a member’s join date is 1 August1996, their tenure on 1 January 2017 would be 20.

  • Print a report showing the range (maximum minus minimum) of Tenure values in theProfile. There is no need to include the report in your submitted code.Task 3:Write a SAS program for the following activities:
  • Sort the observations in Profile by Member_ID.
  • Sort the observations in Redemption_2016 by Member_ID and store the sorted data setin a temporary SAS data set.
  • Sort the observations in Flying_2016 by Member_ID and store the sorted data set in atemporary SAS data set.

Task 4:

Write one SAS DATA step to reshape the sorted Flying_2016 data set by collapsingobservations with the same Member_Id into a single observation. Name this new SAS datathe dataset:Variable NameDescriptionMember_IdMember’s identity.

Air_CityUNumber of times the member had flown with CityU Airlines (i.e.Airline value = ‘CityU’) in 2016. Equal 0 if none.Air_NonCityUNumber of times the member had flown with non-CityU Airline.e. Airline value ^= ‘CityU’) in 2016. Equal 0 if none.Merge the sorted Profile and Flying data sets by Member_ID. Name the merged data

  • Keep all columns from both data sets in Profile1.For members who did not fly in 2016, set Air_CityU and Air_NonCityU to 0.
  • For members who did not earn bonus points from flying in 2016, set FlyBonus_Earned toTask 6:

Write one SAS DATA step for all of the following activities:

  • Merge the sorted Redemption_2016 and Profile1 by Member_ID. Name the merged dataset Profile2.
  • Sum the redemption points for each member in 2016. If a member had no redemption in2016, set the sum to 0. Store these sums in a new column named Redeemed in Profile2.• Replace each member’s bonus point balance in 代写MS3251 Analytics Using SAS  Profile2 with a new balance value,calculated as bonus point balance at the end of 2015 + bonus points earned  flying in2016 – bonus points redeemed in 2016. {P.S. Some bonus point balances in the datasetmay be negative. Keep them in the data set. No adjustment is required.}
  • Each Member_ID appears only once in Profile2.Drop the variables Date and Redeemed_point from the sorted Redemption_2016 in

Profile2.Task 7:

Write a SAS program to report the following statistics and information without requiringfurther manual calculations:

  1. a) The number of male members who flew only with CityU Airlines in 2016.
  2. b) The number of members who had no bonus point redemptions in 2016.
  3. c) The top 1000 bonus points earners in 2016.There is no need to include the reports in your submitted code.Task 8:Write a SAS program to generate a report on the number of members in Profile2 for each ofthe followingbonus point balance groups:
  1. a) 100,000 or lower
  2. b) 100,001 – 300,000
  3. c) 300,001 – 500,000
  4. d) 500,001 or higher

You are not allowed to use the DATA step for this task. The report should look exactly likethis:There is no need to include the reports in your submitted code.{Hint: First, create a user-defined format for the bonus point balance groups. Next, use anappropriate report procedure to write the results, including the formatted bonus pointbalance values, to a SAS dataset. Finally, print that SAS dataset with the required title, labels,and formats.}

-END-

标签:code,Analytics,set,SAS,Using,2016,data,your
From: https://www.cnblogs.com/CSE231/p/18574045

相关文章

  • vue2-解决node-sass安装失败问题,提示python缺失
    当前NodeJs版本v18.16.0Node-Sass与NodeJs版本关系对照图安装Node-Sass报错提示截图原因分析node-sass的代码主要是C++实现,运行node-sass需要进行编译后再运行,而python可以为node-sass提供运行时编译环境,所以正常情况下下载node-sass源代码同时会检查python的安装,确保正常......
  • 什么是 C++ 中的类型别名和 using 声明? 如何使用类型别名和 using 声明?
    1)什么是C++中的类型别名和using声明?   在C++中,类型别名和using声明都是用于提高代码可读性和可维护性的工具。一、类型别名类型别名是给现有类型起一个新的名字。可以使用`typedef`关键字或者`using`关键字来定义类型别名。1.使用typedef:typedefin......
  • sass
    基础概念sass是脚本语言,通过预处理生成css文件,语法有两种分别是.scss和.sass,scss和css的语法相同用{}表示代码块,sass使用缩进表示代码块,语法和python相似编译命令scssstyle.scssstyle.cssscss和sass的不同语法区别安装在vue3中npminstallsass-S如果想全局安装......
  • Survey on Reasoning Capabilities and Accessibility of Large Language Models Usin
    本文是LLM系列文章,针对《SurveyonReasoningCapabilitiesandAccessibilityofLargeLanguageModelsUsingBiology-relatedQuestions》的翻译。使用生物学相关问题对大型语言模型的推理能力和可访问性的调查摘要1引言2相关工作3方法4结果5讨论结论......
  • 机器学习_线性回归_岭回归算法预测波士顿房价代码实现(机器学习全流程)(附带数据集hou
    #1.导入外部数据集HousingDataimportpandasaspdboston_data=pd.read_csv(r"C:\Users\鹰\Desktop\ML_Set\HousingData.csv")#数据基本描述print(boston_data.head())print(boston_data.describe())print(boston_data.shape)#2.数据基本处理-缺失值处理,特征值和......
  • PatentGPT: A Large Language Model for Patent Drafting Using Knowledgebased Fine-
    本文是LLM系列文章,针对《PatentGPT:ALargeLanguageModelforPatentDraftingUsingKnowledgebasedFine-tuningMethod》的翻译。PatentGPT:一种使用基于知识的微调方法进行专利起草的大型语言模型摘要1引言2相关工作3提出的方法4实验5基准测试6总结......
  • 新一代 Java 代码审计工具—铲子 SAST
     .产品定位铲子SAST是一款简单易用的JAVASAST(静态应用程序安全测试)工具,旨在为安全工程师提供一款简单、好用、价格厚道的代码安全扫描产品。一分钟即可完成安装|一个按钮创建扫描任务|一键查看漏洞数据流支持主流的java开发框架| 采用轻量、快捷的污点分析|支......
  • C4996 'scanf': This function or variable may be unsafe. Consider using scanf_s i
    错误原因VS平台认为scanf函数不安全,要求换成scanf_s函数解决方案方案一:将scanf换成scanf_s[不建议]将scanf换成scanf_s但是,scanf_s函数只能在vs上使用,其他平台无法使用,故修改后代码无法移植,不建议方案二:#define_CRT_SECURE_NO_WARNINGS在头文件之前增加预处理器指令#defin......
  • MySQL登录时出现ERROR 1045: Access denied for user ‘root‘@‘localhost‘ (using p
    Mysql在使用过程中,可能会遇到登录问题,比如常见的错误信息:“Accessdeniedforuser‘root’@‘localhost’(usingpassword:YES)”。本文将分析这个问题的可能原因,并提供一系列解决方案. 定位报错原因出现这个Accessdenied问题的原因有如下可能:MySQL的服务器停止了。......
  • Explicit Inductive Inference using Large Language Models
    本文是LLM系列文章,针对《ExplicitInductiveInferenceusingLargeLanguageModels》的翻译。使用大型语言模型进行显式归纳推理摘要1引言2相关工作3显示归纳推理4实验设置5结果和讨论6结论局限性摘要据报道,大型语言模型(LLM)在推理任务上存在不......