Java Python Instructions:
MSE 609 Quantitative Data Analysis Midterm 3
1. Prepare your answers using Jupyter Notebook or R Markdown, and submit as a PDF or HTML document. Ensure your submission is clear, organized, and well-formatted.
2. Use complete sentences when explaining, commenting, or discussing. Provide thorough answers within the context of the problem for full credit.
3. Show all work and reasoning in your submission. Your grade will depend on the clarity, detail, and correctness of your answers.
4. The exam is open book and open notes. You may use textbooks, course notes, and approved coding tools (e.g., Jupyter Notebook or R Studio). However, using generative AI tools (e.g., large language models) is not permitted.
5. Total points = 100.
6. The exam duration is 1 week. Submit your completed exam by Thursday, November 14, at 11:59 PM. Late submissions will not be accepted.
7. Upload your submission to Crowdmark in PDF or HTML format.
Good Luck!
Problem 1 2 3 Total Max 42 40 18 100
Points
1
1. (42 points total) The data file question1.csv contains information about the economies of 366 metropolitan areas (MSAs) in the United States for the year 2006. The dataset includes variables such as the population, the total value of all goods and services produced for sale in the city that year per person (“per capita gross metropolitan product”, pcgmp), and the share of economic output coming from four selected industries.
a. (1 points) Load the data file and confirm that it contains 366 rows and 7 columns. Explain why there are seven columns when only six variables are described in the dataset.
b. (1 points) Compute summary statistics for the six numerical columns.
c. (4 points) Create univariate exploratory data analysis (EDA) plots for population and per capita GMP. Use histograms and boxplots, and describe the distributions of these variables.
d. (4 points) Generate a bivariate EDA plot showing per capita GMP as a function of population. Describe the relationship observed in the plot.
e. (3 points) Using only basic functions like mean, var, cov, sum, and arithmetic operations, cal- culate the slope and intercept of the least-squares regression line for predicting per capita GMP based on population.
f. (3 points) Compare the slope and intercept from your calculations to those returned by the lm function in R. Are they the same? Should they be?
g. (3 points) Add both regression lines to the bivariate EDA plot. Comment on the fit and whether the assumptions of the simple linear regression model appear to hold. Are there areas where the fit seems particularly good or poor?
h. (3 points) Identify Pittsburgh in the dataset. Report its population, per capita GMP, the per capita GMP predicted by your model, and the residual for Pittsburgh.
i. (2 points) Calculate the mean squared error (MSE) of the regression model. That is, compute n1 ni=1 e2i , where ei = Yi − Yˆi is the residual.
j. (2 points) Discuss whether the residual for Pittsburgh is large, small, or typical relative to the MSE.
2
k. (4 points) Create a plot of residuals (vertical axis) against population (horizontal axis). What pattern should you expect if the assumptions of the simple linear regression model are valid? Does the plot you generated align with these assumptions? Explain.
l. (3 points) Create a plot of squared residuals (vertical axis) against population (horizontal axis). What pattern should you expect if the assumptions of the simple linear regression model are valid? Does the plot you generated align with these assumptions? Explain.
m. (3 points) Carefully interpret the estimated slope in the context of the actual variables involved in this problem, rather than using abstract terms like ”predictor variable” or ”X”.
n. (3 points) Using the model, predict the per capita GMP for a city with a population that is 105 higher than Pittsburgh’s.
o. (3 points) Discuss what the model predicts would happen to Pittsburgh’s per capita GMP if a policy intervention were to increase its population by 105 people.
3
2. (40 points total) In real-world data analysis, the process goes beyond simply generating a model and reporting the results. It’s essential to accurately frame the problem MSE 609、 Java,C++ , select appropriate analytical methods, interpret the findings, and communicate them in a way that is accessible to an audience that may not be familiar with advanced statistical methods.
Research Scenario: Coral shells, known scientifically as Lithoria crusta, are marine mollusks that inhabit rocky coastal areas. Their meat is highly valued as a delicacy, eaten raw or cooked in many cultures. Estimating the age of Lithoria crusta, however, is difficult since their shell size is influenced not only by age but also by environmental factors, such as food supply. The traditional method for age estimation involves applying stain to a shell sample and counting rings under a microscope. A team of researchers is exploring whether certain physical characteristics of Lithoria crusta, particularly their height, might serve as indicators of age. They propose using a simple linear regression model with normally distributed errors to examine the association between shell height and age, positing that taller shells are generally older. The dataset for this research is available at question2.csv.
a. (3 points) Load the data. Describe the research hypothesis.
b. (4 points) Examine the two variables individually (univariate). Find summary measures for each (mean, variance, range, etc.). Graphically display each and describe your graphs. What is the unit of height?
c. (4 points) Generate a labeled scatterplot of the data. Describe interesting features or trends you observe.
d. (2 points) Fit a simple linear regression to the data, predicting the number of rings using the height of the Lithoria crusta.
e. (4 points) Generate a labeled scatterplot that displays the data and the estimated regression function line (you may add this to the previous scatterplot). Describe the fit of the line.
f. (5 points) Perform diagnostics to assess whether the model assumptions are met. If not, appro- priately transform the height and/or number of rings and re-fit your model. Justify your decisions and re-check your diagnostics.
g. (4 points) Interpret your final parameter estimates in context. Provide 95% confidence intervals for β0 and β1, and interpret these in the context of the problem.
h. (3 points) Determine whether there is a statistically significant relationship between the height
4
and the number of rings (and hence, the age) of Lithoria crusta. Explain your findings in the context of the problem.
i. (4 points) Find the point estimate and the 95% confidence interval for the average number of rings for a Lithoria crusta with a height of 0.128 (in the same unit as other observations of height). Interpret this in the context of the problem.
j. (4 points) We are interested in predicting the number of rings for a Lithoria crusta with a height of 0.132 (in the same unit as other observations of height). Find the predicted value and a 99% prediction interval.
k. (3 points) What are your conclusions? Identify a key finding and discuss its validity. Can you come up with any reasons for what you observe? Do you have any suggestions or recommen- dations for the researchers? How could this analysis be improved? (Provide 6–8 sentences in total.)
5
3. (18 points total) Load the stackloss data:
data(stackloss)
names(stackloss)
help(stackloss)
a. (3 points) Plot the data and describe any noticeable patterns or trends.
b. (5 points) Fit a multiple regression model to predict stack loss from the three other variables. The model is
Y =β0 +β1X1 +β2X2 +β3X3 +ε
where Y is stack loss, X1 is airflow, X2 is water temperature, and X3 is acid concentration. Sum- marize the results of the regression analysis, including the estimated coefficients and their interpre- tation.
c. (3 points) Construct 90 percent confidence intervals for the coefficients of the linear regression model. Interpret these intervals in the context of the problem.
d. (3 points) Construct a 99 percent prediction interval for a new observation when Airflow = 58, Water temperature = 20, and Acid = 86. Interpret the prediction interval.
e. (4 points) Test the null hypothesis H0 : β3 = 0. What is the p-value? Based on a significance level of α = 0.10, what is your conclusion? Explain your reasoning
相关推荐
matlab 图像合成_用MATLAB做图像合成加雾的处理
众所周知,现在有很多算法来对图像进行去雾处理。但反之,对图像增加雾的代码却少之又少,本代码就是基于Matlab实现了对图像的加雾处理。该方法可用做雾天图像的合成数据集。代码公开如下:clear;clc; % close all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%i...
InnoDB 内存结构总览:Change Buffer、AHI 与 Log Buffer
本文系统梳理InnoDB内存结构中的ChangeBuffer、Adaptive Hash Index(AHI)与LogBuffer。ChangeBuffer缓存二级索引页不在内存时的变更,减少随机IO,仅在页加载时合并;聚簇索引修改立即执行,因数据本身不可延后。AHI基于高频等值查询自动构建哈希索引,加速定位,仅支持等值操作。LogBuffer为redo log内存缓冲,配合磁盘日志实现崩溃恢复。三者均服务于性能优化,其中ChangeBuffer与AHI共享BufferPool空间,而LogBuffer独立
强化学习 | Multi Agents | Trust Region | HATRPO | HAPPO
ICLR2022多智能体论文,将trust region推广到MA上,保证单调递增。学习博客,共7k字,纯手敲。含大量手写笔记。
第三篇 第 6 课
前置:第三篇第 1 课(stdx 引入),第二篇第 1 课(std.regex)。环境:仓颉 SDK 1.2.0。本文所有代码与输出均逐行实测。
arcgis密度分析
密度分析 密度分析是指根据输入的要素数据集计算整个区域的数据集状况,从而产生一个连续的密度表面。通过计算密度,将每个采样点的值散布到整个研究区域,并获得输出栅格中每个像元的密度值。在 ArcGIS 中,分布密度的计算方法有点密度分析、线密度分析和核密度分析三种。 1.点密度分析 导入实验数据居民点图层和道路图层 在自定义里勾选空间分析模块Spatial Analyst 点击空间分析工具中密度分析内的点密度分析, 参数设置如下,其中输出像元大小表示输出栅格数据集的像元大小。值越小.
学习笔记7--激光雷达标定
本系列博客包括6个专栏,分别为:《自动驾驶技术概览》、《自动驾驶汽车平台技术基础》、《自动驾驶汽车定位技术》、《自动驾驶汽车环境感知》、《自动驾驶汽车决策与控制》、《自动驾驶系统设计及应用》,笔者不是自动驾驶领域的专家,只是一个在探索自动驾驶路上的小白,此系列丛书尚未阅读完,也是边阅读边总结边思考,欢迎各位小伙伴,各位大牛们在评论区给出建议,帮笔者这个小白挑出错误,谢谢! 此专栏是关于《自动驾驶汽车环境感知》书籍的笔记。 2.激光雷达标定 2.1 概述 激光雷达内参标定:内部激光发射器坐标系与雷达本
信创环境下PageOffice文档控件适配与实践
信创适配做到文档控件这一层,拼的已经不是"有没有国产版本",而是同一个功能在两类终端上是否真的等价。等价的标准很具体:同一次点击能得到同样的结果,同一份公文能得到同样的版式,同一个项目不需要维护两套代码。这背后是三件并不轻松的工作:服务端用一套接口同时支撑两类终端,客户端把两种系统与四种芯片的安装包分发清楚,文档内核层由产品侧跟着 WPS 的版本走。浏览器这一层的压力,则被收进了产品自己的窗口里——升级节奏由产品掌握,不再交给运气。
squirrel校园二手交易平台
squirrel校园二手交易平台 (适合寻找SSM项目练手的你。) 项目起源: 期末的课程设计,三人一组,我和两个舍友,一时起兴,决定做一个校园二手交易平台,一开始兴致与激情满满,可是后期时间上的冲突,让我们三个人对于这个项目有点累。 这个项目刚定题两天,BezosLee由于通过了360的网上在线笔试,收到了360公司的免费培训邀请,要去北京的360总部进行培训一周,值得庆...
【从零理解 Spring AI · 12】MCP 的两种角色:做客户端还是做服务端
上一篇讲了 MCP 的概念:标准协议、三大角色、M+N 替代 M×N。
langchain4j+milvus实战
本文主要研究一下如何使用langchain4j来对接向量数据库milvus。
电磁炉线圈加热仿真全流程:用Ansys Maxwell分析涡流效应与热损耗
本文详细介绍了使用Ansys Maxwell进行电磁炉线圈加热仿真的全流程。通过构建2D轴对称涡流场模型,深入分析了高频下的涡流效应、趋肤效应与热损耗分布,为优化线圈设计、提升加热效率与均匀性提供了量化依据和实用指南。
pcl2启动器下载(Minecraft PCL2 启动器 最新版 安装与使用说明)
摘要:PCL2(Plain Craft Launcher 2)是一款面向 Minecraft 的第三方启动器,支持正式版与快照版本管理、模组与整合包安装、Java 运行时自动匹配,绿色免安装、双击即可运行。适合在 Windows 上玩单机整合包、需要多版本共存或离线启动的用户使用
用Obsidian搭建个人知识库:AI时代如何构建你的第二大脑
AI 时代,真正有价值的不只是获取知识,而是沉淀属于自己的知识体系。本文从 Obsidian 安装、目录设计、双向链接、插件推荐到 AI 联动、多端同步,手把手教你打造高效、可持续进化的个人知识库,让知识真正为你所用。🧠
spring boot 4集成SQLLite,及其SQLLite的建库
spring boot 4集成SQLLite,及其SQLLite的建库
efm32 入门.pdf
本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。
RU DOS版、EFI版32bit/64bit BIOS常用工具
DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。
Java 集合容器高频面试题全解:HashMap 树化阈值、1.7 死循环与 ConcurrentHashMap 演进(2026 招聘 JD 真题复盘)
HashMap 树化阈值 8 的泊松分布依据、退化阈值 6 的防抖设计、JDK 1.7 头插成环死循环的排查与修复、1.8 尾插后为何仍线程不安全、ConcurrentHashMap 放弃分段锁的原因与 ForwardingNode 协作扩容、computeIfAbsent 死锁陷阱、大集合找重复的场景题选型,附三层追问链自测。题目来源为 38 期公开招聘 JD 样本与字节、拼多多、建行、美团、快手公开面经。
win10 跳过U8环境检测的IE WebControls.rar
win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。
spdlog 同步日志库使用详解
spdlog是一个轻量级 C++ 日志库,支持同步日志、异步日志、多线程日志、日志文件轮转和自定义日志格式。对于嵌入式 Linux 应用开发,我建议先使用。它可以帮我们完成:日志级别过滤。时间戳和线程 ID 输出。日志格式化。终端和文件输出。多线程安全写入。日志文件按大小或时间轮转。我们不需要自己实现互斥锁、文件写入、日志格式化和轮转等底层功能。
复分析 阿尔福斯(Ahlfors) 第三版答案 英文
答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案
JavaSE通关手册:数据类型与变量
代码无需额外处理,编译时编译器自动完成转换。
IDEA 简介:从零认识 IntelliJ IDEA
IDEA 全称,是由 JetBrains 公司开发的一款主流 Java 集成开发环境(IDE)。它集代码编辑、编译、调试、测试、版本控制、构建管理等功能于一体,被大量 Java 开发者视为日常开发的首选工具。所谓 IDE(Integrated Development Environment,集成开发环境),就是把写代码所需的各类工具整合到同一个界面中。相比只用文本编辑器加命令行编译,IDE 能显著减少重复操作,让开发者把精力集中在业务逻辑上。
Docker部署linkding:HTTPS与数据备份
部署私人书签库,除了让页面能够打开,还需要考虑几个实际问题:重建容器后数据是否保留、登录和保存是否正常、升级前怎样备份,以及出现 502 或 CSRF 错误时从哪里检查。本文使用 Docker Compose 部署 linkding,采用默认 SQLite 数据库,通过 Caddy 提供 HTTPS,并完成账户创建、数据持久化验证和备份。如果重建后账户或书签消失,应先检查是否换了项目目录、改了挂载路径,或者启动了另一套实例,不要急着重新初始化。遇到权限问题,应根据日志确认具体目录和运行用户,再调整权限。
动态代理两大流派:JDK 代理与子类代理
业务类想加日志,最直白的写法是侵入式修改: 问题很明显:每个方法都要改一遍,改一个业务要动十处。代理模式的解法是:调用方不直接依赖 ,而是依赖一个代理对象。代理对象长得跟目标一模一样,调用它 → 代理先执行增强逻辑 → 再转调真实对象。 关键在于:代理对象的类型是哪来的?这就是"动态"二字的含义:代理类在运行时才诞生。两个角色: 承载增强逻辑, 负责生成代理类。 组装代理并调用: 输出: 业务代码 一行没动,增强逻辑全在 里。这就是 AOP 的味道。 内部四步: 第 2 步 内部:先查 (同一个接口
C++20协程怎么运行?原理与三大核心组件深度剖析
C++20协程是轻量级的无栈状态机,通过co_await、co_yield、co_return实现挂起与恢复,由Promise、协程句柄和Awaitable三大组件协同工作。协程与线程互补,适用于高效管理大量并发I/O任务,显著降低上下文切换开销。其核心在于编译器生成的状态机机制,需配合库(如cppcoro)使用。掌握Promise控制逻辑、句柄生命周期管理及Awaitable语义,是构建高性能异步程序的基础。
c++ explicit关键字详解
explicit。
TRingBuffer两端都能增删(快递站版)
TRingBuffer 是一个支持两端增删、下标访问且容量动态增长的环形双端队列。它通过无符号索引的永不归零设计,利用减法自动模运算实现空满判断与元素计数,避免了传统环形缓冲浪费格子的问题。内部以票号(索引)标记首尾,扩容时重排元素为连续存储,保证 O(1) 操作与高缓存效率。虽不线程安全,但其高效性使其成为游戏开发中事件队列、命令缓冲等场景的理想选择。
Teamcenter Java SOA 开发:连接、查询与保存
本文介绍如何通过 Java 调用 Teamcenter SOA 接口实现外部系统对接,涵盖连接登录、查询保存等核心操作。以最小闭环示例展示 Connection、Service、ModelObject 等关键组件的使用,强调错误处理与事务管理要点。梳理了 DataManagement、Query、File Management 等 API 模块分工,并结合“工作移交WebService”案例,说明幂等性设计与流程状态返回的重要性。适用于 Web 门户、ERP 集成等场景,建议批量操作用 bulk 接口优化性
Java 项目实战:交友项目后台系统——网关统一鉴权与 B 端管理后台
本次改造通过引入SpringCloud Gateway实现网关统一鉴权与路由,新建mf-admin管理端复用C端域服务(Dubbo调用),实现管理员登录与用户管理四件查询。核心套路:网关白名单+双体系JWT(同工具不同payload)、管理端零直连业务库、分页形态区分(MySQL自动count/Mongo手动count)、浏览器端独立聚合。踩坑12条,附自检清单与后续改造方向,可复用于多角色后台系统。
Mac上装了最新版本的Android Studio,但是没找到jdk的设置选项也没找到jbr的目录
新版Android Studio(2025.3.1+)因三项变更导致常见问题:一、JDK设置移至“DaemonJVM criteria”,新项目默认自动探测或下载JDK;二、JBR目录改名为带版本号的jbr-21等,需进入.app/Contents/查看,或通过About窗口确认运行时;三、命令行缺adb因platform-tools未加入PATH,需在SDK Manager中勾选并配置~/.zshrc中的ANDROID_HOME及PATH。重装或清理残留可解决缺失问题,切勿手动设JAVA_HOME或安装冲
2061



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



