STA 471 Final Exam

STA 471 Due: 5/15/2019
Final Exam
When compiling your answers to the following questions, follow all guidelines for homework
assignments listed in the syllabus. A hard copy of your work is to be turned in to my office
(Kimball 810) by 5:00 PM on the due date. You are not permitted to collaborate on these
questions with another student.
1. One method used to identify whether a patient requires a hearing aid is to play a recording of
a set of words being pronounced quietly, then request that the patient repeat those words.
The number of words correctly identified ("Hearing”) by a set of patients is recorded in
hearing.txt (UBLearns). Four different recordings (“ListID”) were used, containing different
sets of words. The purpose of this study is to determine whether the lists of words are
equally difficult to hear. (15 pts)
a) Produce side-by-side boxplots of the hearing scores by list ID.
b) State the hypotheses to be tested in this study.
c) Fit an appropriate model to address the study question, and present output that displays
the test statistic and p-value. Also state the conclusion in context.
d) Reproduce the p-value from part (c) using the pf(.) function.
e) What percentage of total variability in hearing scores is explained by list ID?
f) Identify which pairs of lists have mean hearing scores that differ significantly.
g) Test whether the model residuals are normally distributed.
h) Test the assumption of constant variance using the Levene test, providing the hypotheses,
p-value, and conclusion.

STA 471作业代做、代写Python/c++,Java程序语言作业
2. The following data are from a study carried out decades ago regarding attitudes toward sex
education being instituted in public schools. (10 pts)
Disposition Sex Education
Favor Oppose
Conservative 645 142
Moderate 812 129
Liberal 766 65
a) Produce a single barplot that displays all the data
b) Create a labeled matrix object to store the data.
c) Carry out the chi-square test for association. Give the hypotheses, test statistic, p-value,
and conclusion in context.
d) Reproduce the p-value from part (b) using the pchisq(.) function.
e) Examine the standardized Pearson residuals from the chi-square test, and describe how
the observed data depart from independence.
3. This question will involve a comparison of the two-sample procedures we have considered in
this course. (15 pts)
a) Set the randomization seed to 4444. Generate one sample of size 1 = 35 from
and another sample of size 2 = 35 from . We
wish to test. Obtain the p-value for this test using each of the following
procedures:
i. The two-sample t-test (equal variances).
ii. The two-sample t-test (unequal variances).
iii. The paired t-test.
b) Obtain a fourth p-value, this time using the Wilcoxon rank sum test of whether the two
population medians are the same.
c) Generate data and carry out the four tests a large number of times, say ?? = 10,000 (take
care that you are no longer using a randomization seed). At the end of the simulation,
you should have 10,000 p-values for each of the four procedures. Report the simulationbased
type I error rate for each procedure.
d) Based on your simulation, how do these four procedures perform when the two
populations have the same location parameters?
e) Now change the value of 2 to 22, and re-run the simulation, again using = 10,000.
Report the simulation-based estimates of power for all four procedures in this scenario.
f) Describe your power results – are they different than you expected
4. When MRI brain scans first became available, an interesting research question involved the
relationship between measurable brain size and IQ. Forty psychology students volunteered
for MRI scans of their brains, and brain size was recorded in terms of the number of pixels
mapped by the scan (brain_size.txt). (10 pts)
a) Fit the simple linear regression model:
and provide the estimated regression coefficients.
b) Test for a linear relationship between IQ and pixel count. Give the hypotheses, test
statistic, p-value, and conclusion in context.
c) There are additional variables present in the data set that may be related to IQ. Use the
simple linear regression model fit previously as your base model. Use the forward
selection technique to determine whether any of Height, Weight, or Gender can be
included as significant predictors of IQ. Do not include excessive output.
d) Obtain the
statistic for your final model.
5. Nerds frequently impersonate fantasy characters and roll dice to determine what happens in
their silly adventure game. Usually this involves rolling a single 20-sided die. Other times,
the player may need to roll, for example, eight 6-sided dice. It would be nice to have a way
to quickly simulate the rolling of multiple dice. (10 pts)
a) Write a program to simulate rolling a single 20-sided die. The possible outcomes are all
integers between 1 and 20, and each outcome should be equally likely. While not
required, you may wish to use existing functions like runif(.) and floor(.).
b) To give evidence that your program works properly, execute it 10,000 times, store the
value of each roll, and use them to build a barplot. Use your barplot to make an argument
that the code works as intended.
c) Write a function called “roll1” that simulates rolling a single die with a user-supplied
number of sides (i.e., the single argument passed to the function is the number of sides on
the die.) For example, the code “roll1(sides=20)” should simulate rolling a single 20-
sided die.
d) Write a more general function called “roll” which takes two arguments: the number of
identical dice to be rolled, and the number of sides on one of the dice. For example, the
code “roll(number=8, sides=6)” should roll 8 standard six-sided dice.
e) In nerdy fantasy games, it’s a really big deal when your 20-sided die lands on 20. It is
extremely rare for a player to roll 20’s on consecutive throws. It is unheard of to roll
three straight 20’s. Use your “roll” function and a while loop to count how many
attempts (an attempt is the rolling of three 20-sided dice) it takes to roll three straight 20’s
in simulation. Call this value “number_of_attempts”.
f) Store = 1,000 values of “number_of_attempts” and create a histogram. (This will take
quite a while to run. Go get some lunch; no joke.)

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected]

微信:codinghelp

原文地址:https://www.cnblogs.com/blogy/p/10853312.html

时间: 2024-11-05 21:36:32

STA 471 Final Exam的相关文章

Final Exam Arrangement

题目链接 题意: 输入n个左闭右开的线段,如果两个线段有重叠部分,那么这两个线段必然不能在一组.求,最少分几组,并且输出每组都有谁 分析: 将一个线段拆开成左右端点,排序.从左向右扫描,如果遇到的是左端点,那么直接加入到集合中,此时集合中的这些线段两两有重合部分,所以是可以分到同一组的:如果遇到的是右端点,那么当前线段之后将和当前线段没有重合点,必然不能放到一组.这样贪心的将每一个线段尽可能的分到一个组中(分到哪个组无所谓,只要分到了一个组中,答案就能减少),就可以保证答案是最少的.当一个线段不

BNUOJ 33535 Final Exam Arrangement

In Zhejiang University, there are N different courses labeled from 1 to N. Each course has its own time slot during the week. We can represent the time slot of a course by an left-closed right-open interval [s, t). Now we are going to arrange the fin

Math 353/DSC 301, Spring 2019, Final Exam

Math 353/DSC 301, Spring 2019, Final ExamPlease remember to write down your name and student ID. This is the take-home portion whichhas four problems. Only independently-finished and fully-justified answer will receive full credit.1. [11 = 3 + 2 + 4

ECON4016 - FINAL EXAM

ECON4016 - FINAL EXAMThe final exam consists 4 small projects. You can choose 2 of them to finish and send meyour report. For each of the small projects you choose, you should perform data analysisusing the data I provide to you and the techniques we

2019 Multi-University Training Contest 7 Kejin Player Final Exam

Kejin Player 期望DP 题意: 初始等级为1,每一级有四个参数 r , s , x , a . 每一级有一个概率p=r/s花费a的代价升级到下一级,失败可能会倒退到x级 设从 l 到 r 的期望为 g(l, r), 这种期望满足减法 g(l, r) = g(1, r) − g(1, l). 因为升级只能一级一 级升, 所以要从 1 升级到 r, 必然要经过 l. 求一个前缀和 sum[i+1]=sum[i]+ai * si / ri + (sum[i]-sum[x])*(si-ri)

oj--cs10116 final exam

http://cs101.openjudge.cn/practice/12560/ 样例的结果是对的,但是WA,还没找到原因 #include<cstdio> int map[105][105]; bool issur[105][105]; int main(){ int n,m; scanf("%d %d",&n,&m); for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ scanf("%d&

有感于Java Final Exam

秋季学期的java已经结课了,当看到教务平台贴出的通知说考试形式为单选题时,心中喜忧参半. 可喜的是这种考试形式还是比较得民心,毕竟除了判断题,最好做的也就是单选题了. 然而期中考试选择题50%的命中率还历历在目,不免心生忧虑.然后后来的事实证明,果然我的忧虑不是毫无道理的,再次被虐,而且被虐的毫无怨言. 考试完后把还有印象的几道题目在eclipse上跑了跑,结果也是不堪回首.... 然后我决定把它们记下来,以期在不远的将来能够一雪前耻. #1.对,你没有看错,就是这道题,我当时靠着卓越的逆向思

Algorithm lesson final exam

1.algorithm analysis O B/W/AV/AMOR,混入其他问题,设计+分析 2.传统算法(肯定要考) 1)divide and conquer master therem. recursive tree.分析复杂度.递归树加起来得到最终结果 2)greedy algorithm example sort->select 拟阵 独立系统的贪心模板,直接得到近似比 3)dynamic programming sub-optimal structrue.编辑距离 3.graph a

加州大学伯克利分校Stat2.3x Inference 统计推断学习笔记: FINAL

Stat2.3x Inference(统计推断)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Academia.edu) ADDITIONAL PRACTICE FOR THE FINAL In the following problems you will be asked to choose one of the four options (A)-(D). The options are sta