首页 > 其他分享 >STAT 311 Programming

STAT 311 Programming

时间:2024-08-21 16:05:22浏览次数:6  
标签:STAT 311 applicant Programming variable department answer Save your

Programming Assignment 8

STAT 311

Please complete the following problems and submit a file named STAT311-HW8 .R to Gradescope. You should start from the provided STAT311-HW8 .R file on Canvas.

Overview

Address each of the following questions. As always, you should start from the provided skeleton code. Each question should utilize the model associated with the question group.

All questions here utilize the Berkeley acceptance data in BerkeleyData .csv.

Students who intend to use the predict( . . .) function for these problems are advised to consult the docu- mentation in ?predict .glm to determine how it is used for different types of predictions in the context of logistic regression.

Note for autograder: When fitting models, you must fit using the format glm(var1~var2+ . . . ,  data=BerkeleyData); do not rename variables in the data frame.

Question 1 - (7 points total, 1 hidden)

Fit a logistic regression model that predicts acceptance based on the sex of the applicant.  Save the model as model.q1

a) What are the log-odds of being accepted for a male applicant? Save your answer in the variable q 1 .a

b) What are the odds of being accepted for a female applicant? Save your answer in the variable q1 .b

c) What is the probability of being accepted for a dai 写STAT 311 Programming male applicant? Save your answer in the variable q1 .c

d) What is the probability of being accepted for a female applicant? Save your answer in the variable q1 .d

e)  (Hidden answer) Based on this model, without considering other variables, does it appear that there is a statistically significant gender disparity in the admissions of Berkeley? Answer TRUE or FALSE. Save your answer in the variable q1 .e

Question 2 - (10 points total, 3 hidden)

Fit a logistic regression model that predicts acceptance based on the sex of the applicant and department, with no interactions. Save the model as model.q2

a) What is the change in log-odds of being accepted for someone applying to department E? Save your answer in the variable q2 .a

b) What is the log-odds of a female applicant being accepted into department C? Save your answer in the variable q2 .b

c) What is the multiplicative change in odds for a female applicant? Save your answer in the variable q2 .c

d) What is the probability of being accepted to department A for a male applicant? Save your answer in the variable q2 .d

e) What is the probability of being accepted to department A for a female applicant? Save your answer in the variable q2 .e

f)  (Hidden answer) Which department appears to be the most difficult to be admitted to? Your answer should be in the form ”A”, ”B”, ..., or ”F”. Save your answer in the variable q2 .f

g)  (Hidden answer) Which department appears to be the easiest to be admitted to? Your answer should be in the form ”A”, ”B”, ..., or ”F”. Save your answer in the variable q2.g

h)  (Hidden  answer)  Based on this model, without considering other variables, does it appear that there is a statistically significant gender disparity in the admissions of Berkeley? Answer TRUE or FALSE. Save your answer in the variable q2 .h

Question 3 - (9 points total, 1 hidden)

Fit a logistic regression model that predicts acceptance based on the sex of the applicant and department, including an interaction between the two variables. Save the model as model.q3

a) What is the multiplicative odds impact of a male applicant to department C compared to a male applicant to department A? Save your answer in the variable q3 .a

b) What is the multiplicative odds impact of a female applicant to department C compared to a male applicant to department A? Save your answer in the variable q3 .b

c) What is the multiplicative odds impact of a female applicant to department E compared to a male applicant to department E? Save your answer in the variable q3 .c

d) What is the multiplicative odds impact of a female applicant to department F compared to a male applicant to department F? Save your answer in the variable q3 .d

e) What is the probability of acceptance for a male applicant to department B? Save your answer in the variable q3 .e

f) What is the probability of acceptance for a female applicant to department B? Save your answer in the variable q3 .f

g)  (Hidden answer) The model coefficient femaleTRUE has a p-value of 6.21 × 10 −5 .  (Assuming you fit things correctly, hint I guess) TRUE or FALSE: This indicates a statistically significant difference of admissions for female applicants to Berkeley. Answer TRUE or FALSE. Save your answer in the variable q3.g

 

标签:STAT,311,applicant,Programming,variable,department,answer,Save,your
From: https://www.cnblogs.com/vvx-99515681/p/18367973

相关文章

  • 为什么QNAP威联通的quamgie或者video station无法预览缩略图?
    创作立场声明:原创分享,拒绝搬运~ hello大家好,这里是你们的新伙伴稳重的大王~ 本期给大家分享,如何在QNAP威联通的quamgie以及videostation中预览缩略图。 在QNAP的QTS4.5之前的固件版本,只需要在APPcenter全部应用商城,搜索安装codexpack就可以了。但是似乎由于版权......
  • [题解]P3311 [SDOI2014] 数数
    P3311[SDOI2014]数数看到多模式匹配,我们考虑先对所有模式串建立AC自动机。然后发现这道题和P4052文本生成器(题解)挺像的,后者让求包含至少一个模式串的个数,这道题让求一个也不包含的个数,这个就是一个用不用\(26^m\)去减的问题,很好处理。但这道题还多了一个条件,“幸运数”必须\(......
  • Ros2 Moveit2 - Robot Model and Robot State
    RobotModelandRobotState 在本节中,我们将向您介绍用于在MoveIt中使用运动学的C++API。RobotModel和RobotState类RobotModel 和 RobotState 类是提供对机器人运动学访问权限的核心类。RobotModel 类包含所有链接和关节之间的关系,包括从URDF加载的关节限制属......
  • 《面板变系数模型及 Stata 具体操作步骤》
    目录一、文献综述二、理论原理三、实证模型四、稳健性检验五、程序代码及解释六、代码运行结果一、文献综述在经济和社会科学研究领域,面板数据模型因其能够同时考虑个体和时间维度的信息而被广泛应用。传统的面板数据模型通常假设系数是固定的,但现实中,系数可能会随......
  • 错误 1 error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”
    前言全局说明VisualStudio2013jsoncpp0.10.7库编译LNK2038一、说明环境:Windows7旗舰版VisualStudio2013二、错误内容错误1errorLNK2038:检测到“RuntimeLibrary”的不匹配项:值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug”(mfc_mqtt-client-po......
  • Java基础——HttpStatus.class 源码中状态码总结
    HttpStatus.class源码中状态码总结HttpStatus.class源码////Sourcecoderecreatedfroma.classfilebyIntelliJIDEA//(poweredbyFernFlowerdecompiler)//packageorg.springframework.http;importorg.springframework.lang.Nullable;publicenumH......
  • day46-dynamic programming-part13-8.17
    tasksfortoday:1.647.回文子串2.516.最长回文子序列--------------------------------------------------------------------1.647.回文子串Inthispractice,itisimportanttofigureouttheessencetodecideifastringatargetone,thestring[i,j]is......
  • 诗|随想——202311-12月的一些絮絮叨叨
    诗|随想——202311-12月的一些絮絮叨叨20231122随想01茫然随想02平和20231122随想03活着随想04爱随想05呓语20231123随想06失去随想07朦胧随想08成长随想09爱你20231124随想10掌控随想11秘密随想12我记得20231125随想13你我随想14祈盼随想15生命......
  • SciTech-Mathematics-Probability+Statistics-Matlab(Mathworks Inc.): MATLAB官方文
    SciTech-Mathematics-Probability+StatisticsProbabilityDistributions:https://ww2.mathworks.cn/help/stats/probability-distributions-1.html?s_tid=CRUX_lftnavWorkingwithProbabilityDistributionsProbabilitydistributionsaretheoreticaldistributionsbas......
  • [C++ Error] f0201.cpp(11): E2379 Statement missing ;
    错误解释:这个错误表明在C++源代码文件f0201.cpp的第11行出现了一个语法错误,具体是缺少了一个分号;。C++语言规定语句的结束需要使用分号;,如果一个语句缺少了它,编译器就会抛出这样的错误。解决方法:打开f0201.cpp文件``,定位到第11行。检查那一行的代码,确保每个语句后面都有分号;......