Assignment 1
ECON 3E03 – Fall 2024
Due: Sunday, September 29, 11:59pm
Total Marks: 20
Worth: 10% of your final grade
Assignment Description
This assignment provides an introduction to the R software package. This assignment is based on Units 1 and 2 in the course. Using the course datasets, you will be required to answer a series of questions.
Some of the R commands needed to complete the assignment are found throughout the weekly lecture and tutorial notes. You may need to do your own research to find additional codes to complete certain questions. The use of AI (e.g., ChatGPT) to assist in coding is permitted; however, please note the following:
1) Any code which you obtain from an AI source must be clearly indicated in your answer documents.
2) The AI does not always write accurate codes...
This assignment may be completed individually or in groups of up to four students.
To access the assignment submission dropbox,
a group are responsible for forming and managing their own groups. Do not assign yourself to a
group with other students unless they have already agreed to work with you.
The assignment is to be submitted via Avenue. Emailed assignments cannot be accepted.
The name(s) of the student(s) preparing the assignment must appear clearly on the title page of the assignment. Any “group member” whose name does not appear on the title page will not receive a grade for the submission. Failure to include a title page will result in a grade deduction.
© Dr. Colin Mang, 2024
page, even if you are submitting the assignment individually
you must join a group on the Avenue Groups
. Students who choose to work in
Assignment Instructions
On Avenue, you will find the following data files listed in the Data Files content folder:
spending.RData LFSJune24.RData
These data files will be used for the assignment.
On Avenue, you will find the following R Script file listed in the Assignments content folder: Assignment R Script.R
Perform the following tasks in order:
1) Select you group members to work with.
2) All students must enroll in a group on Avenue, even if you are completing the assignment on your own. If you are working on your own, join an empty group where you will be the only member. If you are working with other students then each member of the group must self-enroll in the group on Avenue. After the first member enrolls, make note of the group number so that other members can self-enroll in the same group. If you accidently join the wrong group by mistake, please email your professor to correct it. Do not join a group without talking to the other group members first!
3) If you are working on your own, skip this step. If you are working with other students, choose a Group Leader. The Group Leader will be responsible for ensuring the project is submitted and for other aspects as described below.
4) Download the two datasets and the Assignment R Script.R file.
5) Rename the Assignment R Script.R file to StudentNumber.R where StudentNumber is the Group Leader’s student number (i.e., 12345678.R).
6) Open the R Script file. The R Script file has the following structure:
#Assignment R Script #
#ECON3E03 Fall 2024
#Part 1 - spending.RData
set.seed(xx) # Replace xx with group leader student number
SpendingSample <- spending[-sample(1:nrow(spending), 653), ] # Generates a unique 80% sample that is different from any other group
# Use the new datafile SpendingSample for the Part 1 Questions
### Enter Codes for Each Question below this line. If you have used an AI program to write any codes, you must indicate the use of AI by including " # This code generated by AI " after the code
### End of Part 1
#Part 2 - LFSJune2024.RData
set.seed(xx) # Replace xx with group leader student number
LFSSample <- LFSJune2024[-sample(1:nrow(LFSJune2024), 4043), ] # Generates a unique 80% sample that is different from any other group
# Use the new datafile LFSSample for the Part 2 Questions
### Enter Codes for Each Question below this line. If you have used an AI program to write any codes, you must indicate the use of AI by including " # This code generated by AI " after the code
### End of Part 2
7) On Line 1, indicate that this code is for Assignment 1. On Line 2 write the names of all group members.
8) On Lines 7 and 22, replace xx with the group leader’s student number.
[Insert Assignment Number]
[Insert Name(s)]
9) Determine the appropriate code to conduct the tests required for Part 1. Type the code into the space between the lines:
### Enter Codes for Each Question below this line.
[Enter your codes here]
### End of Part 1
10) Determine the appropriate codes to conduct the tests required for Part 2. Type the code into the space between the lines:
### Enter Codes for Each Question below this line.
[Enter your codes here]
### End of Part 1
11) If you have used an AI tool (e.g., ChatGPT) to write any of the codes, you must include the
line:
# This code generated by AI
12) Run your R Script.
13) Prepare a written report answering each of the questions below. Copy and paste the analysis output from R where appropriate.
14) Save your report in MS Word (.docx) or PDF (.pdf) format with the file name StudentNumber.docx or StudentNumber.pdf where StudentNumber is the student number of the group leader. Ensure that the report contains a title page that lists the full names and student numbers of all group members and clearly identifies which group member is the group leader for this assignment. Failure to include a title page will result in a grade deduction.
15) Upload the report StudentNumber.docx/StudentNumber.pdf AND the R Script file StudentNumber.R to the assignment dropbox on Avenue.
Note that the set seed and sample commands will take a random 80% subsample of the data that is different for every group. For this reason, the numbers that you get with your output will not be the same for any two groups. Be mindful of this fact if you are comparing your work with other groups. If you want to play around with the data to test out commands before running your R Script, be sure to apply the set seed and sample commands only once before doing so.
after each code in your R script that was written by an AI. You must also include the statement in
your answer document for each question where you used an AI.
Assignment Questions
The following are the assignment questions. When answering each question, be sure to include the relevant R output as well as any written explanation required in your answer document.
Part 1 [10 Marks]
Part 1 uses the spending.RData dataset
1) [2 Marks] Conduct a hypothesis test of the following: Can we conclude with 95% confidence that persons who rent their home are less likely than homeowners to have a computer?
2) [2 Marks] Conduct a hypothesis test of the following: Can we conclude with 95% confidence that persons who rent their home are less likely than homeowners to have a vehicle?
3) [3 Marks] Create a scatter plot with age on the X-axis and total expenditure on the Y-axis. What is the correlation coefficient between age and total expenditure?
4) [3 Marks] Examine the variable SH002. Do persons who own their home and have a mortgage spend more on their principal accommodation than persons who rent?
Part 2 [10 Marks]
Part 2 uses the LFSJune24.RData dataset
5) [2 Marks] Create a scatter plot with job tenure on the X-axis and hourly earnings on the Y- axis. What is the correlation between job tenure and hourly earnings?
6) [2 Marks] Conduct a hypothesis test of the following: Do persons with a permanent job earn more per hour than persons who do not have a permanent job?
7) [3 Marks] Conduct a hypothesis test of the following: Do persons who are unionized earn more per hour than persons who are not unionized?
8) [3 Marks] Conduct a hypothesis test of the following: Do unionized workers in the public sector earn more per hour than unionized workers in the private sector?
A note on plagiarism: this is an independent assignment, which you are expected to complete within your own group. It is plagiarism to copy someone else’s work verbatim, which includes R Script files. Any work you submit should be the product of your group only.
相关推荐
AI 应用开发:四维架构落地实战——以 HR Agent 为例拆解感知·推理·记忆·执行【意图路由、规划编排、长期记忆、工具执行、面试题】
本文基于四维架构(感知·推理·记忆·执行),以HR Agent为例,系统拆解大模型应用从“聊天”到“生产可用”的落地路径。通过Spring AI实现意图路由、规划编排、RAG检索与工具调用,结合真实踩坑复盘,揭示架构化设计对安全、成本与可维护性的关键价值,为AI Agent工程化提供可复用的实战框架。
AI 问数真的能替代 BI 报表吗?
AI问数赋能自然语言查询,提升临时分析效率,但无法替代传统报表。报表适用于稳定输出与持续监控,AI则擅长探索性提问。企业用好AI问数,关键在于夯实数据模型、统一指标口径、健全权限体系与结果校验机制。合理组合报表、仪表板与AI,才能实现高效、准确的业务洞察。
告别Modern Standby噩梦:Win11睡眠断网冻结的根源剖析与S3睡眠回归实战
本文深入剖析了Windows 11中Modern Standby(现代待机)模式导致睡眠后断网、系统冻结等问题的根源,指出其与硬件驱动、后台活动的兼容性矛盾。文章提供了通过修改注册表键值强制系统回归稳定S3睡眠状态的详细实战步骤,帮助用户彻底解决睡眠故障,实现可靠的远程访问与挂机任务。
【从零理解 Spring AI · 12】MCP 的两种角色:做客户端还是做服务端
上一篇讲了 MCP 的概念:标准协议、三大角色、M+N 替代 M×N。
BFD+OSPF+FRR:构建高可用网络的核心铁三角
摘要:VRRP、OSPF、BFD和FRR协同实现网络高可用。VRRP负责网关冗余,OSPF确保路由可达,BFD提供毫秒级故障检测,FRR实现快速路径切换。故障时,BFD立即检测并通知OSPF,FRR在OSPF收敛前切换流量,VRRP完成网关切换(如需)。BFD采用异步模式动态建立,效率最高。该机制确保业务流量无缝切换,提升网络可靠性。
达梦慢sql和统计信息收集
各计划节点的执行顺序为:缩进越多的越先执行,同样缩进的上面的先执行,下面的后执行,上下的优先级高于内外。在建立索引的时候,要考虑索引的最左匹配原则(在使用 SQL 语句时,如果 where 部分的条件不符合最左匹配原则,可能导致索引失效,或者不能完全发挥建立的索引的功效);执行计划是 SQL 语句的执行方式,由查询优化器为语句设计的执行方式,交给执行器去执行。生产系统中,对于频繁变动的数据表,多次执行计划可能会出现不一致的问题,这往往是由于统计信息不准导致的,索引定期收集统计信息就很有必要了。
ChatGPT、Perplexity、Gemini 与 AI Overviews 引用对比:谁的引用更可信
AI 引擎的引用机制差异很大:ChatGPT 以行内引用加 Sources 列表呈现来源,Perplexity 几乎逐句可溯源,Gemini 在回答中内嵌相关来源链接,AI Overviews 则把多源聚合答案与来源列表一起放在搜索结果顶部。本文从引用透明度、来源偏好、可干预性 3 个维度对比这 4 个引擎,并给出 GEO 的 3 点启示,帮企业在多引擎环境下提升被引用的概率。
三菱A800变频器矢量控制实战:从速度控制到位置控制的PLG参数设置全解析
本文深入解析了三菱A800变频器结合FR-A8AP选件板与PLG(脉冲编码器)实现高精度矢量控制的实战应用。详细阐述了从速度控制、转矩控制到位置控制三种高级模式的切换逻辑、核心参数设置及硬件接线要点,帮助工程师充分发挥A800变频器的闭环控制潜力,应对复杂工业自动化场景。
抽象主义人工智能和生命体AI的内在联系
彭军辉提出“抽象主义人工智能”作为第四大AI范式,批判符号主义、连接主义、行为主义剥离生命本体的误区,确立“智能是现象,生命是本体”的核心公理。主张原生智能必须依附具备存续诉求的生命本体,提出“生命体AI理论”,构建七层演化阶梯与自闭环工程框架,强调智能不可跳过底层存续机制直接模拟语言。该体系为生成式AI提供科学边界,推动从“仿真表象”向“原生智能”的范式跃迁,开辟硅基人工生命新赛道。
深入浅出ISP:用RKISP2.x Tuner工具理解AWB、AE、HDR等核心模块的实战调参
本文深入解析RKISP2.x Tuner工具在ISP图像处理中的实战应用,重点探讨AWB、AE、HDR等核心模块的调参技巧。通过环境搭建、调试工具使用和实际案例,帮助开发者掌握如何在不同光照条件下优化图像质量,实现精准的白平衡、曝光控制和动态范围处理。
基于模板匹配实现手写汉字识别matlab源码含GUI
主要包括三个按钮和三个图像显示框:第一个按钮用于选择待匹配的手写汉字图像,第二个按钮用于进行匹配,第三个按钮用于清除所有内容。当用户点击匹配按钮时,会自动调用模板匹配函数,并在图像显示框中显示匹配结果。上述代码首先将之前提取的Hu不变矩特征存储在T矩阵中,并将对应的类别信息存储在L向量中。然后读取待匹配汉字,提取其Hu不变矩特征,并使用pdist2函数计算待匹配汉字与所有汉字模板的距离。本文介绍了如何使用matlab实现手写汉字识别,包括汉字模板提取、模板匹配算法、GUI界面设计等方面。
OpenAI Control Room 架构拆解:给企业 AI Agent 加一套可审计的急停系统
OpenAI 公开了用于追踪和停止研究模型工作负载的 Control Room。本文拆解 job_id、推理前鉴权、35 秒撤销窗口与 Fail Closed 设计,并给出企业 AI Agent 急停控制面的数据模型、FastAPI 参考实现、缓存撤销策略和故障演练清单。
PyTorch深度学习实战(47)——使用PyTorch构建Transformer模型
相较于传统模型,如循环神经网络 (RNN),Transformer 的优势在于能够理解输入和输出序列中元素之间的关系,在大语言模型 (如 ChatGPT 和 DeepSeek) 的发展中起到了关键作用,为了从零开始构建 Transformer,首先探讨自注意力机制,包括查询 (query)、键 (key) 和值 (value) 向量,以及缩放点积注意力 (SDPA)。将层归一化和残差连接集成到多头注意力层中,并与前馈层结合,构建编码器层,堆叠编码器层构建编码器,还将实现 Transformer 中的解码器。
OpenClaw 深度调查:把 AI 助手做成你自己的控制平面
对 openclaw/openclaw 的完整技术尽调:Gateway 架构、Agent 运行时、工具与沙箱、30 个消息通道、181 个插件、安全信任边界、工程代价与采用建议。17 章 / 10 张图,全部数字标注口径,数据截至 2026-10-31。
OpenHarmony之Histreamer引擎深度解析:pipeline_core架构如何全面取代GStreamer,一统音视频播放与录制
Histreamer是OpenHarmony多媒体框架的核心媒体引擎,采用架构设计。一个轻量级的媒体引擎组件,提供播放、录制等场景的媒体数据流水线处理。1.播放场景分为如下几个节点:数据源读取、解封装、解码、输出;2.录制场景分为如下几个节点:数据源读取、编码、封装、输出。该引擎从OH5.0开始取代了原有的媒体引擎gstreamer(部分文档还保留较老架构的讲解),提供统一的音视频播放、录制、元数据解析等能力。
蓝牙模块HM-10手册
蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。
AI赋能智慧港口建设|造形家快速生成港口全要素三维场景
随着智慧港口、港口数字孪生项目的持续推进,港口三维场景的需求日益旺盛。传统港口三维建模,往往需要航拍倾斜摄影采集数据,再人工搭建吊机、岸桥、船舶、集装箱等大量工业设施模型,项目周期长、人力成本高,修改迭代繁琐,制约港口可视化项目落地效率。国产AI三维建模工具,依托卫星影像 AI 识别能力,无需航拍作业,一键快速搭建港口完整三维场景,为港口数字孪生、方案汇报、投标演示提供高效的场景解决方案。
win10 跳过U8环境检测的IE WebControls.rar
win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。
从设备增点到治理闭环:老旧小区物业数智化落地实践
系统连接合同审批、银行流水、收费记录与项目台账,执行到期提醒、收入核验、异常标色和月度对账,让每一笔资金来源明确、去向可查。针对设施老旧、诉求响应慢、公共收益不透明等问题,津南以6类小区为试点场景,统一建设物业数字化底座,关联楼栋、单元、房屋、业主、空间、设施设备、工单、公共收益等核心数据。系统采用统一编码管理,将摄像头、路灯、井盖、道路、绿化等设施纳入资产台账,解决纸质记录更新滞后、故障责任难追溯的问题。基于历史工单建立分类模型和知识库,辅助识别照明、给排水、电梯、环境秩序、秩序维护等问题;
ssm框架搭建
这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载
jre9下载 jdk9
(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】
企业微信iPad协议详解:接口接入、实时消息同步与语音转码实践
深入解析企业微信iPad协议的技术架构与开发思路,涵盖API接口接入、长连接通信、实时消息同步、Silk语音转码、异常重连及高并发优化,帮助开发者了解企业微信自动化系统的设计与实现。
Product Hunt 热榜 2026-11-13:Plurai Simulation、YouArt Desktop App、Omnigraph
2026-11-13 Product Hunt 新产品精选:Plurai Simulation、YouArt Desktop App、Omnigraph。汇总 15 款产品的中文介绍、功能关键词和产品链接。
【AI Agent面试系列】AI Agent可观测、评测、安全相关的知识点
之前的文章介绍了和,本文主要介绍AI Agent的测评、可观测等知识。
Docling 原理解读:是什么、为什么、怎么样
从论文视角拆解 Docling 的整体架构、DoclingDocument 数据模型、PDF 预处理、版面分析、OCR、TableFormer 双解码器、阅读顺序与装配流程,并解释版面框与 OCR 框的区别。
WorkBuddy 实战:一句话需求 → 七屏可交互原型,户外徒步 App 的 AI 设计全流程
WorkBuddy 实战:一句话需求 → 七屏可交互原型,户外徒步 App 的 AI 设计全流程,跟着博主一起来还原整个过程。
从认识人工智能到理解机器学习:我的 AI 入门第一课
正式开始学习人工智能之前,我对 AI 的认识其实比较模糊:知道 ChatGPT、知道大模型,也知道现在很多岗位都在谈 AI,但如果有人问我“人工智能到底是什么”“机器是怎么学会识别一只猫的”,我未必能从头到尾讲清楚。上午的课程更偏向行业全景:人工智能的发展、研究方向、NLP、岗位分工、学习路线和 AI Coding 工具。下午的课程更偏向技术基础:机器学习的原理、有监督学习、深度学习、模型训练和评估方法。
企业宣传片发前如何批量排查并遮挡视频里的敏感信息
做企业视频的人都会碰到一个具体问题:实拍画面里混进了不该出现的信息。办公室背景里有贴着客户信息的白板,采访对象的授权书边缘露出一串身份证号码,街采素材里路人面孔和车牌号直接入镜。人眼在时间线上扫视,会漏掉快速闪过的帧、画面边缘的小字、以及暗光区域里的证件号码。用抹影AI完成车牌、人脸和证件区域批量检测后,又手动补充了两个时间段的屏幕遮罩,最终导出时画面已无合规隐患。重点关注快速运动、遮挡、低光照条件下的目标,这些是漏检的高发区域。导入视频后选择要检测的目标类型(人脸、车牌、证件号、二维码等)。
面向工业对讲的双通道声学 DSP 模组 A-59(NR2050-A)方案解析与工程落地案例
A-59模组以NR2050-A DSP为核心,37.5×16mm邮票孔封装,支持-40℃~85℃工业温域,兼容A-06/A-09/A-29系列,可低成本替换存量设备。通过固件切换实现三种模式:模式一(低改版成本,适配矿井、电梯);模式二(最优AEC,用于医院呼叫);模式三(双波束独立输出,支持双人会议语音分离)。集成AEC、ENC、BF与AGC算法,有效抑制回声、噪声与串扰,解决对讲系统核心声学难题。选型需注意参考信号路径、麦间距与温度匹配,建议先做声学测试再量产。
SAP商业AI正式通过网信备案:企业落地AI五问
中数通“CDC商业AI”通过广东网信部门备案,标志着SAP商业AI在华本地化迈出关键一步。然而,合规仅是起点,企业真正需关注的是:AI能否融入核心流程、数据治理是否健全、责任归属是否清晰、价值衡量机制是否建立。从“可用”到“用好”,关键在于工作流重构、跨团队协同与业务结果导向的评估体系。国产模型成本优势与本地部署能力为ERP深度集成提供可能,但真正的竞争力仍在于对数据、流程与业务上下文的理解力。
1320



被折叠的 条评论
为什么被折叠?



