MAT 4378 – MAT 5317, Analysis of categorical data, Assignment 3 1
MAT 4378 – MAT 5317, Analysis of categorical data
Assignment 3
Due date: in class on Monday, November 18, 2019
Remark: You can use R for your computations for Questions 2 to 4. If you use
R please provide the output. However, the R output is not an answer to a question.
Please provide one or two sentences to properly answer the question.
1. Consider a ratio estimator h(ˆθ1,ˆθ2) = ˆθ1/ˆθ2, where the estimated variancecovariance
2. A carefully controlled experiment was conducted to study the effect of the size of
the deposit level on the likelihood that a returnable one-liter soft drink bottle
will be returned. The data to follow show the number of bottles that were
returned (Wi) out of 500 sold (ni) at each of size deposit levels (Xi
in cents):
Deposit level xi 2 5 10 20 25 30
Number sold ni 500 500 500 500 500 500
Number returned wi 72 103 170 296 406 449
An analysist believes that a logistic regression model is appropriate for studying
the relation between the size of the deposit and the probability a bottle will be
returned.
(a) Find the maximum likelihood estimates for β0 and β1. Give the estimated
regression model.
(b) Obtain a scatter plot of the sample proportions against the level of the
deposit, and superimpose the estimated logistic response onto the plot.
Does the fitted logistic response function appear to fit well?
(c) Obtain exp(βˆ
1) and interpret this number.
(d) What is the estimated probability that a bottle will be returned when the
deposit is 15 cents?
(e) Estimate the amount of deposit for which 75% of the bottles are expected
to be returned.
MAT 4378 – MAT 5317, Analysis of categorical data, Assignment 3 2
(f) In part (e), we have an estimate ˆx = g(βˆ
0, βˆ
1) for the level of the deposit
that corresponds to π = 75% of the bottles are returned. This estimator is
a non-linear function of βˆ
0, βˆ
1. Use the delta-method to find an asymptotic
estimated standard error for this estimate. Hint: It will be helpful to
use the function vcov on your glm object. Furthermore, to multiply the
matrices A and B with R use A %*% B.
3. A marketing research firm was engaged by an automobile manufacturer to conduct
a pilot study to examine the feasibility of using logistic regression for
ascertaining the likelihood that a family will purchase a new car during the
next year. A random sample of 33 suburban families was selected. Data on
annual family income (x1, in thousands of dollars) and the current age of the
oldest family automobile (x2, in years) were obtained. A followup interview
conducted 12 months later was used to determine whether the family actually
purchased a new car (y = 1) or did not purchase a new car (y = 0) during the
year. The data is found in the file CarPurchase.csv.
(a) Find the maximum likelihood estimates of β0, β1, and β2. State the estimated
logistic regression model.
(b) Obtain exp(βˆ1) and exp(βˆ2) and interpret these numbers.
(c) What is the estimated probability that a family with annual income of $50
thousand and an oldest car of 3 years will purchase a new car next year?
4. Rather than finding the probability of success at an explanatory variable value,
MAT 4378作业代做
it is often of interest to find the value of an explanatory variable given a desired
probability of success. This is referred to as inverse prediction. One application
of inverse prediction involves finding the amount of pesticide or herbicide needed
to have a desired kill rate when applied to pests or plants. The lethal dose level
xπ (commonly called “LDz”, where z = 100 π is defined as
xπ =(cloglog(π) − β0)β1
for the complementary log-log regression model
cloglog(π) = β0 + β1 x.
(a) Show how xπ is derived by solving for x in the complementary log-log
regression model.
(b) We can obtain 95% confidence interval for xπ as follows:
Describe how this confidence interval for xπ is derived. (Note that there is
generally no closed-form solution for the confidence interval limits, which
leads to the use of iterative numerical procedures.)
MAT 4378 – MAT 5317, Analysis of categorical data, Assignment 3 3
(c) Turner et al. (1992) uses logistic regression to estimate the rate at which
picloram, a herbicide, kills tall larkspur, a weed. Their data was collected
by applying four different levels of picloram to separate plots, and the
number of weeds killed out of the number of weeds within the plot was
recorded. The data are in the file picloram.csv. Complete the following:
(i) We will use a cloglog model instead of a logistic regression model. Give
the estimated complementary log-log model.
(ii) Compute eβˆ1 and interpret this number within the context of the problem.
(iii) Plot the observed proportion of killed weeds and the estimated model.
Describe how well the model fits the data.
Note: Here are some commands that you might find helpful. We are
assuming that the dataframe is called picloram.data and that the
fitted model is called mod.
## plot proportions versus x
with(picloram.data, plot(x = picloram, y = kill/total,
xlab = "Picloram", ylab = "Proportion of weeds killed",
panel.first = grid(col = "gray", lty = "dotted")))
# Put estimated esimated response on the plot
curve(expr = predict(object = mod,
newdata = data.frame(picloram = x), type = "response"),
col = "red", add = TRUE)
(iv) Estimate the 0.9 kill rate level “LD90” for picloram. Add lines to the
plot in (iii) to illustrate how it is found (the segments() function can
be useful for this purpose).
(v) We are assuming that your fitted model is the glm object mod. Use
the following commands to compute a 95% confidence interval for the
0.9 kill rate. Note: The function uniroot solves for the root of a
function over an interval.
b0 = summary(mod)$coefficients[1,1]
b1 = summary(mod)$coefficients[2,1]
LD.x<-(log(-log(1-0.9))-b0)/b1
root.func <- function(x, mod.obj, pi0, alpha) {
beta.hat <- mod.obj$coefficients
cov.mat <- vcov(mod.obj)
var.den <- cov.mat[1,1] + x^2*cov.mat[2,2] +
2*x*cov.mat[1,2]
abs(beta.hat[1] + beta.hat[2]*x - log(-log(1-pi0)))/
sqrt(var.den) - qnorm(1-alpha/2) }
lower <- uniroot(f = root.func, interval =
c(min(picloram.data$picloram), LD.x),
mod.obj = mod, pi0 = 0.9, alpha = 0.05)
MAT 4378 – MAT 5317, Analysis of categorical data, Assignment 3 4
upper <- uniroot(f = root.func, interval =
c(LD.x, max(picloram.data$picloram)),
mod.obj = mod, pi0 = 0.9, alpha = 0.05)
lower$root
upper$root
(vi) In part (v), we found a 95% CI for x0.9. Explain in a few sentences
how these commands give us the lower and the upper bound of the
confidence interval.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codehelp

MAT 4378 – MAT 5317, Analysis of categorical的更多相关文章

  1. C++中的Mat, const Mat, Mat &,Mat &, const Mat &的区别

    Mat, copy传递,不会改变外部变量的Mat. Mat &, reference传递,函数内部修改将会改变外部. const Mat, copy传递,在函数内,不会被修改,也不会影响到外部 ...

  2. ncnn 源码学习-Mat.h Mat.c

    纯小白记录下腾讯的ncnn框架源码的学习.纯粹写给自己看的,不保证正确性. Mat 类似于 caffe中的blob,是一个张量的存储结构体. 一.数据成员: 1.void * data 多维数据按一位 ...

  3. [MAT]使用MAT比較多个heap dump文件

    使用MAT比較多个heap dump文件 调试内存泄露时,有时候适时比較2个或多个heap dump文件是非常实用的.这时须要生成多个单独的HPROF文件. 以下是一些关于怎样在MAT里比較多个hea ...

  4. MAT使用--转

    原文地址: [1]http://ju.outofmemory.cn/entry/172684 [2]http://ju.outofmemory.cn/entry/129445 MAT使用入门 MAT简 ...

  5. Android 内存分析工具 MAT(Memory Analyzer Tool)

    如果使用DDMS确实发现了我们的程序中存在内存泄漏,那又如何定位到具体出现问题的代码片段,最终找到问题所在呢?如果从头到尾的分析代码逻辑,那肯定 会把人逼疯,特别是在维护别人写的代码的时候.这里介绍一 ...

  6. Eclipse Memory Analyzer(MAT)使用

    https://user.qzone.qq.com/731573705/blog/1436389384 Eclipse Memory Analyzer(MAT)使用  一.OutOfMemoryErr ...

  7. MAT使用入门

    原文出处: 高建武 (Granker,@高爷) MAT简介 MAT(Memory Analyzer Tool),一个基于Eclipse的内存分析工具,是一个快速.功能丰富的JAVA heap分析工具, ...

  8. MAT工具定位分析Java堆内存泄漏问题方法

    一.MAT概述与安装 MAT,全称Memory Analysis Tools,是一款分析Java堆内存的工具,可以快速定位到堆内泄漏问题.该工具提供了两种使用方式,一种是插件版,可以安装到Eclips ...

  9. opencv中Mat与IplImage,CVMat类型之间转换

    opencv中对图像的处理是最基本的操作,一般的图像类型为IplImage类型,但是当我们对图像进行处理的时候,多数都是对像素矩阵进行处理,所以这三个类型之间的转换会对我们的工作带来便利. Mat类型 ...

随机推荐

  1. IT兄弟连 HTML5教程 HTML5和CSS3的关系

    HTML5是第五版HTML的标准,CSS3则是第三版CSS,新增一些非常实用的选择器和样式属性,并且CSS3语言开发是朝着模块化发展的.以前的规范作为一个模块实在是太庞大而且比较复杂,所以,把它分解为 ...

  2. 使用ScriptX控件实现IE浏览器分页打印功能

    之前讲过js调用ie浏览器自带打印的用法,今天讲使用插件的方式.浏览器自带打印不能控制页边距.页眉页脚等选项,尤其是如果分页打印的话,无法自动将前一页标题带到本页,所以不适用多页打印的功能.使用Scr ...

  3. gitlab的安装配置与简单使用

    安装 gitlab,建议系统内存 6G ,不然会报错. 一.如何安装 gitlab 下载 gitlab 的 RPM 包 https://packages.gitlab.com/gitlab/gitla ...

  4. 部署asp.net core Kestrel 支持https 使用openssl自签ssl证书

    通过openssl生成证书 openssl req -newkey rsa:2048 -nodes -keyout my.key -x509 -days 365 -out my.cer openssl ...

  5. GitHub 2019年年度报告:Python最受欢迎,VScode贡献者高达19.1K

    前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者: 开源最前线(ID:OpenSourceTop) PS:如有需要Pyt ...

  6. PHP+Swoole 作为网络通信框架

    PHP的异步.并行.高性能网络通信引擎,使用纯C语言编写,提供了PHP语言的异步多线程服务器,异步TCP/UDP网络客户端,异步MySQL,异步Redis,数据库连接池,AsyncTask,消息队列, ...

  7. JS基础语法---for循环遍历数组

    for循环遍历数组 要显示数组中的每个数据,可以如下: var arr=[10,20,30,40,50]; //显示数组中的每个数据 console.log(arr[0]); console.log( ...

  8. SSH免密码登录和Git免密操作

    SSH免密码登录和Git免密操作 每次打完包后都需要把包传到对应的服务器上从而让测试人员下载安装,但是每次ssh或scp时都需要重新输入密码:使用git代码托管平台只要修改了密码就需要输入密码.本文主 ...

  9. Tomcat启动分析(二)-自己编译Tomcat

    为了方便分析Tomcat源码,利用大家习惯的方式来进行Debug调试,那么如何将Tomcat源码导入到Eclipse呢,这就是本文的重点 1 准备 1.1 获取Tomcat源码 获取tomcat源码有 ...

  10. Python—端口检测(socket)

    基于python检测端口是否在使用 原理:创建一个socket服务,连接对应的 ip:port ,如果能够连接,说明端口被占用:若端口可用,则不可连接. #!/usr/bin/evn python # ...