Perform an appropriate hypothesis test

Assignment Help MATLAB Programming
Reference no: EM133256623

Assignment - Research Methods and Statistics

Question 1. For a particular illness, there are two possible treatments: Medicine A and Medicine B. It is known that there is an unwanted, but non-life-threatening, side effect of both of these medicines. A hospital is conducting a study to determine if these medicines are equally likely to cause this side effect to help them determine which medicine they should use. Over a period of 3 months the hospital randomly allocates one of these medicines to patients with this particular illness.

During the study period 250 patients were given Medicine A, and 135 of these patients had the side effect. During the study period 240 patients were given Medicine B, and 96 of these patients had the side effect.

You will perform a hypothesis test to determine if there is a difference between the two medicines in terms of the probability that a person taking that medicine will have the side effect.

In the following parts all calculations must be done by hand, unless otherwise specified.

(a) What kind of hypothesis test will you be doing?

(b) Define the variables and parameter of interest.

(c) What are the null and alternative hypotheses?

(d) Calculate the estimate for the parameter of interest.

(e) Calculate the appropriate test statistic.

(f) Calculate the p-value (you will need to use MATLAB).

(g) Based on the p-value do you reject or retain the null hypothesis at the 5% level of significance? Provide justification for your answer.

(h) Summarise your conclusion from Part (g) in the context of the question. (i) Calculate the 95% confidence interval for the parameter of interest. (j)(1 point) Summarise your confidence interval in the context of the question.

Question 2. The NOAA Atlantic hurricane database contains data about the positions and attributes of storms in the Atlantic from 1975 - 2020, measured every six hours during the lifetime of a storm.

Two of these attributes are the storm's maximum sustained wind speed in knots (wind) and the air pressure at the storm's center in millibars (pressure). This data, storm data.xlsx, can be found on the Assignment 6 page on MyUni. Perform a linear regression analysis to investigate the relationship between wind and pressure by completing the following steps.

In these steps, assume that wind is the predictor variable and pressure is the response
variable.

(a) Load the data into MATLAB and perform a linear regression using the MATLAB command fitlm(). Provide your code and output.

(b) Use MATLAB to create an appropriate scatterplot of this regression and add the line of best fit to your plot. Make sure your axes are labelled.

(c) Based on the output of your linear regression, write down the equation of the line of best fit.

(d) Perform an appropriate hypothesis test to determine whether there is a statistically significant linear relationship between wind and pressure at the 5% level of signifi- cance by completing the following steps.

i. Write down the appropriate null and alternative hypotheses.

ii. From your MATLAB output in Part (a), state the observed value of the test statistic.

iii. From your MATLAB output in Part (a), state the p-value.

iv. Based on your p-value do you retain or reject your null hypothesis at the 5% level of significance? Provide justification for your answer.

v. Write your conclusion in the context of the question.

(e) An important part of performing a linear regression is assumption checking. Complete the following steps to check if our assumptions are valid.

i. Using MATLAB, create a residuals vs fitted values scatterplot. Based on this plot, are our assumptions of linearity and constant spread valid? Provide justification for your answers.

ii. Using MATLAB, create a normal probability plot of the residuals. Based on this plot, is our assumption of normality valid? Provide justification for your answer.

iii. A statistician has looked at this problem and believes the assumption of independence is not valid. Provide a reason why the statistician believes this.

Question 3. In order to produce better wines, and hence improve sales, researchers have studied how the physiochemical properties of wine affect its quality. In the paper, Modeling wine pref- erences by data mining from physicochemical properties, the authors note that an increase in alcohol often improves quality of vinho verde white wine.

We will consider a predictive model for the alcohol content in wine (alcohol) based on four predictor variables, the amount of residual sugar in the wine (residual sugar), the amount of chlorides in the wine (chlorides), the pH value of the wine (pH), and the amount of sulphates in the wine (sulphates). The data we are using comes from the aforementioned study, and includes a sample of 4898 vinho verde white wines. The output of the multiple linear regression in MATLAB is:

>> X = table(residual_sugar, chlorides, pH, sulphates, alcohol);

>> wine_model = fitlm(X) wine_model =
Linear regression model:
alcohol ~ 1 + residual_sugar + chlorides + pH + sulphates

Estimated Coefficients:
Estimate SE tStat pValue

(Intercept) 11.743 0.32436 36.203 1.6755e-254
residual_sugar -0.10189 0.0029509 -34.528 5.3552e-234
chlorides -18.091 0.67513 -26.796 1.0428e-147
pH 0.12099 0.10036 1.2056 0.22805
sulphates -0.27563 0.12996 -2.1208 0.033986

Number of observations: 4898, Error degrees of freedom: 4893 Root Mean Squared Error: 1.02
R-squared: 0.307, Adjusted R-Squared: 0.307
F-statistic vs. constant model: 542, p-value = 0

When performing multiple linear regression we determine our regression model by ini- tially including all predictor variables, and then we perform hypothesis tests on each pre- dictor variable to determine if it could be removed from the model. Determine if either residual sugar or pH could be removed from our model by completing the following steps.

(a) To test if residual sugar can be removed from our model, we have the following hypotheses:
H0 : βresidual sugar = 0,

HA : βresidual sugar 0,

where βresidual sugar is the regression coefficient for residual sugar.
i. Based on the given MATLAB output, state the p-value for this test. ii. Based on the p-value, do we reject or retain the null hypothesis at the 5% level of significance? Provide justification for your answer.

(b) To test if pH can be removed from our model, we have the following hypotheses:

H0 : βpH = 0,

HA : βpH ?= 0,
where βpH is the regression coefficient for pH.

i. Based on the given MATLAB output, state the p-value for this test. ii. Based on the p-value, do we reject or retain the null hypothesis at the 5% level of significance? Provide justification for your answer.

(c) Based on your conclusions from Parts (a) and (b), if you were going to re- duce this model, would you keep residual sugar or pH in the model?

Note: Need Question 2 solution only

Attachment:- Research Methods and Statistics.rar

Reference no: EM133256623

Questions Cloud

Which personality traits : Which personality traits are most important to employers: conscientiousness followed by agreeableness.
Describe at least one limitation of trait theory : Describe at least one limitation of trait theory when it comes to characterizing a person or their behavior.
Benefits of having introverted or extroverted managers : Describe the benefits of having introverted or extroverted managers or teachers. Your response should be sentences in length.
European concept of honor in colonial Latin America : Which of the following was true regarding the European concept of "honor" in colonial Latin America?
Perform an appropriate hypothesis test : Perform an appropriate hypothesis test to determine whether there is a statistically significant linear relationship between wind and pressure
Test differently the next time you take test : Give me a narrative exploring how to address the weaknesses after taking a test and how will you approach the test differently the next time you take the test?
Adolescents with depression-suicide and trend : What specific connection(s) does adolescents with depression/suicide and a trend/issue related to adolescents' family or peer relationships have?
Conditioned to respond in fear to furry objects : In which Little Albert was conditioned to respond in fear to furry objects.What ethical standards, by today's standards do you think were violated by experiment
Does relationship need to be negotiated from start : Does the relationship need to be negotiated from the start? How might this differ or not in same sex relationships?

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Consider the random process

Consider the random process Z(t) = Acos(pi t), where A is a random variable that follows the standard normal Gaussian.

  Write a matlab function

Write a Matlab function [P,L,U] = ColumnCroutLU(A) to perform the column- wise Crout method given by equations (3) and (4), overwriting the matrix

  Write MATLAB code for thermal stresses fem

Prepare MATLAB coding for attached paper. Paper - Finite difference approach for non-homogeneous problem of thermal stresses in cartesian domain

  Design and computations - digital signal processing

Compute the time dependent Fourier transform of the complex digital signal. Plot it as a 2- dimensional function of true analog frequency (Hz) on the y-axis and time (sec) on the x-axis between 0 to 10 sec.

  Write a matlab program to confirm that the ni versus t curve

Write a Matlab program to confirm that the ni versus T curve for Cie and Si graphed in Figure 220 can be generated by employing the empirical fit relationships below.

  Define the steady state error for control systems

Explain the differences between the outputs of the initial and the modified system and Define the steady state error for control systems.

  Simple distributed mimo system

Linear combiner and precoder in this system, try both MRT/MRC and ZF. Add some AWGN to the received signals, as you feel is appropriate

  Develop your own matlab function for the fixed-point method

Develop your own Matlab function for the Fixed-point method. Use the approximate relative error as your stopping criterion. The first line of your function should be function [root,froot,ea,iter] = fixedpoint(func,xr,es,maxit)

  Find all the roots of a quartic equation

You need the program to find all the roots of a quartic equation without using built-in functions fzero, roots, eig, and eigs.

  The power input p to a centrifugal pump is assumed to be a

the power input p to a centrifugal pump is assumed to be a function of the volume flow rate q impeller diameter d

  Write MATLAB code for simple interest calculation

Write MATLAB code - In simple interest calculation, the interest (R) is added to the principal amount (P) each year

  Create a loop for each parameter in the magnitude vector

Create a loop for each parameter in the magnitude vector and You can do this with another for loop, but that is a bad way to do it. MATLAB is a matrix based programming language and all of its commands are written to work on matrices.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd