Question: Answer the following using MATLAB code: In designing an experiment, compute power of a hypothesis test and determine the sample size needed to ensure statistical

Answer the following using MATLAB code:
In designing an experiment, compute power of a hypothesis test and determine the sample size needed to ensure statistical significance and power
Your code may use the following MATLAB commands ``` mean, std, cdf, icdf``` and normal functions for computing (`length`,`inv`,`sqrt`,...), but otherwise *no built-in functions for statistics*.
*Read the questions carefully and name variables of solutions as specified.*
Researchers are investigating the effectiveness of a new drug designed to lower blood pressure. Five individuals with hypertension participated in a pilot study. The researchers measured the systolic blood pressure of each individual before and after they took the drug for a period of one month. The systolic blood pressure readings (in mmHg) for each individual before and after the intervention are recorded below:
Individual Before Drug (mmHg) After Drug (mmHg)
1155150
2160155
3145138
4150151
5170160
These data and code to test the null hypothesis that this drug did not reduce systolic blood pressure can be found in the MATLAB code for this problem. Run this code and you should find that you can reject this null hypothesis (p =0.0022),
Q4a) Write and execute MATLAB code to compute the power of this test to detect a drop of 5 mmHg in pressure. (The correct answer should be between 20% and 40%)
Q4b) Write and execute MATLAB code to compute the total number of subjects you expect to need to raise this power to 95%. Save this value in the variable named `n_needed`.(The correct answer should be between 10 and 30.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!