logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Nitesh BhardwajEconomics
(5/5)

552 Answers

Hire Me
expert
Jyoti PrajapatiStatistics
(/5)

786 Answers

Hire Me
expert
Kate DuggannMathematics
(5/5)

753 Answers

Hire Me
expert
Neil BissonnetteeCriminology
(5/5)

510 Answers

Hire Me
R Programming
(5/5)

nvestors A and B live in Alphaville, a small town with exactly one golf course and one Starbucks.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

0 big picture

The grade for each project includes 10 points for code that is clean and stylish. That means no errors. No dead ends. Include indentation, comments, and white space as appropriate. Format consistently. Observe clear and consistent naming conventions. Follow all instructions exactly. Some of these things are best accomplished after your code is working. Sometimes you will have a starter code, and it’s fine to use it, but make it look like your own work.

1 more investor

Investors A and B live in Alphaville, a small town with exactly one golf course and one Starbucks. They are strangers.

The data.frames inv.dat and mystats referred to below are exactly the same as in Rportf1. So you already have code to build mystats with columns xbar, ssd, and nobs. Most of the steps below ask you to add new columns to mystats.

Clean and stylish code is worth 10 points.

Investor A

Investor A has n = 16 investments in her portfolio. Each day she looks at the returns x1, x2, ..., x16 on these investments. She knows they are from a normal population, but she doesn’t know µ or σ. Each day she performs a hypothesis test at significance level α = .10. She tests H0 : µ = 5 versus HA : µ /= 5.

If each day’s data REALLY are from N (µ = 5, σ), then her investment portfolio is well- balanced and likely to make money. She doesn’t need to buy or sell anything. If she has evidence that µ /= 5, then her portfolio needs adjustment.

Her decision rule looks like this:

When the data reject H0 : µ = 5, I go to Starbucks and adjust my portfolio. Some- times this takes all day.

When the data fail to reject, I can relax and hold that portfolio for another day. These are good days to play golf.

Use inv.dat to compute each of the following vectors and add them to the data.frame

mystats. Each vector will have 20 elements.

1. (10 points) Compute the test statistic:

tstat =(x¯ − µ0) (s/ n)

This number can be negative or positive depending on values are evidence against H0.

x¯. Very small or very large

2. How small is very small? How large is very large? The boundary values for ’very small’ and ’very large’ are called the critical values. They are given by:

These don’t change day to day since they depend only on α and whether the test is two-tailed or one-tailed. Let tcrit1 be a 20-vector containing the negative critical value, and let tcrit2 contain the positive critical value.

3. (10 points) Perform the hypothesis test. If tstat is outside the critical values, Investor A rejects H0. If tstat is between the critical values, she accepts. Use this rule with ifelse() to create vector test1 populated with the values ACCEPT or REJECT.

4. (10 points) The p-value represents the conditional probability of getting a value of the test statistic more contradictory to H0 than tstat when H0 is true. Compute the vector of p-values like this:pval = P (Tn−1 ≤ −|tstat|) + P (Tn−1 ≥ |tstat|) = 2*pt(-abs(tstat), nobs-1)

5.(10 points) Use the p-value to perform the hypothesis test a different way. Compare the p-value to the significance level α. If pval α, reject H0. Otherwise, accept H0. Use this rule with ifelse() to create vector test2 populated with the values ACCEPT or REJECT. It should be identical to test1.

6. Finally, create vector dec.A and populate it with the values GOLF or STARBUCKS. The data.frame mystats should now be 20x10.

Investor B

Investor B’s portfolio is similar to Investor A’s. Every day he looks at the same data x1, x2, ..., x16, and he also believes the data are from a normal distribution. Like investor A, he is interested in testing H0 : µ = 5. His risk tolerance is similar to hers, so he uses the same α for his decisions.

Unfortunately, Investor B doesn’t remember how to perform a hypothesis test, so he bases his decisions on confidence intervals. His decision rule looks like this:

When my confidence interval does not contain 5, I reject H0 : µ = 5, head for Starbucks, and adjust my portfolio. Sometimes it’s hard to find a table.

When my confidence interval for µ contains 5, I accept H0 : µ = 5. That means I can relax and hold that portfolio for another day. These are good days to play golf.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme