程序代写案例-HW9
时间:2022-04-28
Math 181A, Spring 2022, HW9
Clearly and thoroughly write your solutions on blank paper. Show all your work. You may list
answers in exact form (e.g., ⇡) or round to three decimal places (e.g., 3.142), unless the problem says
otherwise. On any problem involving R, you should include your code and output as part of your
answer. You may take a screenshot of the code/output, or write it by hand.
1. State the decision rule (i.e., test) that would be used to test the following hypotheses for the specific
test statistic mentioned. Then, make a decision using the data provided and write a conclusion. Assume
the data come from a normal distribution with unknown µ and known . Include a picture (OK to
draw by hand, doing this in R is inecient) of the sampling distribution for the test statistic and label
the critical region.
a. H0 : µ = 20, H1 : µ < 20, n = 16, = 3, and ↵ = 0.06. Test stat: x. Data: x = 18.5
b. H0 : µ = 20, H1 : µ < 20, n = 16, = 3, and ↵ = 0.06. Test stat:
x 20
/
p
n
. Data: x = 18.5
c. H0 : µ = 10, H1 : µ 6= 10, n = 100, = 0.4, and ↵ = 0.12. Test stat: x. Data: x = 11
d. H0 : µ = 50, H1 : µ > 50, n = 60, = 4, and ↵ = 0.08. Test stat: 3x. Data: x = 50.5
2. Calculate the P -values for problems 1b and 1c. Does using these P -values lead you to the same
conclusions as the critical regions did?
3. Suppose you wanted to alter problem 1a so that the P -value, when calculated, would equal 0.04. If
you could only change , what value would it need to equal to get the P -value to be 0.04?
4. In December 2017, the J-RPG Xenoblade Chronicles 2 was released for Nintendo Switch. The game
is epic in its number of main quests and side quests. Those that try to finish every aspect of the game are
known as “completionists”. What is the average time for all completionists in the world (currently)?
Assume completion times are normally distributed with unknown mean and standard deviation 50
hours (a reasonable estimate for RPGs). Before you collect data, your friend claims this average time
is 250 hours (based on her personal experience). You think the value is something di↵erent and go to
HowLongToBeat.com to find some data. Based on when I looked at this page (don’t use more recent
data!): 80 completionists had submitted their times for an average of 258 hours and 49 minutes. Define
parameter(s), write hypotheses, draw a sampling distribution, and decide which hypothesis to support
using ↵ = 0.01 (and any one of the three methods shown in class). [For those curious, my completion
time was around 225 hours, and my current play time is around 600 hours because of expansion pass
content!]
5. Students often wonder what to do if you get a P -value of exactly 0.05 when ↵ = 0.05. In truth, it
doesn’t matter if you suggest rejecting H0 or keeping it, because the probability your P -value exactly
equals ↵ is a 0 probability event (the P -value is also a random variable). Let’s say you wanted to be
evil and make a problem for your next statistics exam where the P -value would exactly equal 0.05.
You plan to make a problem where we study µ from X ⇠ N(µ, 32) with data x = 7 and n = 28. What
value(s) should you have students use for the null hypothesis to get your P -value to be 0.05 assuming
a two-sided H1?
6. Change is Coming!
a. Suppose a problem has H0 : µ = µ0 and H1 : µ 6= µ0 . If a given data set causes us to reject H0
when ↵ = 0.02, would the same data force us reject H0 if ↵ = 0.05?
b. Suppose a problem has H0 : µ = µ0 and H1 : µ > µ0 . If a given data set causes us to reject H0
for some ↵, would the same data force us to reject H0 if we change H1 to µ 6= µ0? Assume ↵
remains the same.
7. You’ve just made the best app ever! You plan to upload it to the app store and are curious
how many reviews you might get from users. The histogram of review counts for various apps in the
Apple store is very right-skewed: most apps get a small number of reviews, but some apps like
Pandora, PayPal, and LinkedIn get millions. It turns out that ln(review count) is roughly normally
distributed with = 2.6 (for those apps with more than 5 reviews). In this problem, we’ll explore
Y ⇠ N(µ, 2.62) where Y = lnX is the natural log of the review counts. Your friend claims that µ = 6.5,
but you think it’s higher: people love rating stu↵ in the modern era! Using the data set AppleStore.csv
(found on Canvas/TritonEd in the Homework folder), conduct a hypothesis test to determine whom to
momentarily believe in life. This data set contains information on 7197 random apps from Apple’s app
store. Load this into R using the “Import Dataset” button in the upper right window of R studio. Make
sure to remove rows with 5 or fewer reviews. Your answer will be a mix of R code and written work.
Use ↵ = 0.01. The rating count tot column lists how many times a given app has been rated/reviewed
by users.


essay、essay代写