Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. A team of scientists recorded weight change experienced by each of n = 100 rats following treatment with an experimental drug. Their data is

. A team of scientists recorded weight change experienced by each of n = 100 rats following treatment with an experimental drug. Their data is stored in datafile.csv. Based on their data, the team concludes that no weight change occurred. (a) (8 marks) The "power" of a test gives the probability of not committing a Type-2 error. Suppose that it is later established that the drug unequivocally had an effect = 0.3 grams on weight change. make a simulation in Python to estimate the power of the team's ability to detect the change. Justify your parameterization of any distribution from which you simulate. Submit your code and your justification. You may build your own random number generator from scratch, or you may use 1 import numpy X = numpy . random . uniform () to generate a random variable X that comes from a uniform distribution on (0, 1). No other "builtin" pseudo-random number generator may be used. Moreover, if you use the built-in generator shown above you may only do so to generate random variables one at a time. You'll likely need to store simulated data in an array. When you generate a new random observation, you'll need to add it to the array. You can do that using the code below. # make an empty array in which to store data data = numpy . array ( [ ] ) # here , I'll just generate 10 uniform (0,1) RVs and add them to the data array one at a time for i in range ( 10 ): X = numpy . random . uniform () data = numpy . append ( data , X ) # adds X to the end of data array (b) (2 marks) Use your simulation in part (a) to estimate power given effect sizes (i) = 0.3, (ii) = 0.5, and (iii) = 0.2 based on 100 000 replicate experiments (don't be surprised if it takes a minute or two to run).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability With Applications and R

Authors: Robert P. Dobrow

1st edition

1118241257, 1118241258, 978-1118241257

More Books

Students also viewed these Mathematics questions