1. To find the sample mean, simply take the average of all the data given, this means that you should add them all up and divide by 8. So the mean is given by:
m = (197 + 203 + 194 + 196 + 196 + 197 + 198 + 206)/8 = 198.375
To find the variance simply take the differences of each data point from the mean, square them and divide by the number of data points we have. So the variance is given by:
s = [(197 - 198.375)2 + (203 - 198.375)2 + (194 - 198.375)2 + (196 - 198.375)2 + (196 - 198.375)2 + (197 - 198.375)2 + (198 - 198.375)2 + (206 - 198.375)2]/8 = (1.8906 + 21.3906 + 19.1406 + 5.6406 + 5.6406 + 1.8906 + 0.1406 + 58.1406)/8 = 14.2343
To do this in matlab simply create a list as follows:
>> sample = [197, 203, 194, 196, 196, 197, 198, 206]
And then use mean(sample) and var(sample) respectively
2. The test goes as follows:
Null hypothesis: vs Alternative hypothesis:
We need to perform a t test to prove or disprove the Null hypothesis. So we must find the standard error given by:
SE = s/sqrt(n) = 14.2343/sqrt(8) = 5.0325
The t-statistic is then given by
tc = (m - μ) / SE = (198.375 - 200)/5.0325 = -0.3229
The degrees of freedom of this statistic are given by n-1 = 7 using a t table we see that the t-statistic for two tailed hypotheses with 95% confidence and 7 degrees of freedom is 2.365. This means that our calculated tcshould be greater than 2.365 or less than -2.365 to reject the null hypothesis, since this is not the case we can conclude that with 95% confidence the mean is 200.
3. The confidence interval is simply given by the formula:
Where z0.025means the value on the z table where we find P(z > Z) = 0.025. So the confidence interval is given by
198.375 ± 1.96(5.0325)
Clearly 200 is included in this interval so it supports the results of the previous question.
4. To do this question, using the list we defined earlier, run the command:
>> ttest(sample, 200)
This tests whether the mean of the sample data is 200. It returns 0 if we keep the null hypothesis (mean is 200) and 1 if we reject the null hypothesis (mean is not 200).
5. Recall that the confidence interval is given by . And SE depends on the number of observations. If we were to double the sample size and keep the same sample mean and sample variance we would be left with
SE = 14.2343/sqrt(16) = 3.5585
And a 95% confidence interval of
198.375 ± 1.96(3.5585)
Meaning that the interval got smaller.
the codes should be done in matlab and please answer all questions. Part B (Based off week 11 workshop content) An e...
Please use MATLAB. Part B (Based off week 11 workshop content) An engineering company has ordered steel to be used for a rail construction project. Before using the steel, they want to test it to ensure the material properties from the supplier are correct A random sample of the ordered steel is tested for its Yield Strength. The results are shown below. Yield Strength (MPa) 197203194196196197198205 1. Calculate the sample mean and sample variance by hand, then verify your answers...
Part B (Based off week 11 workshop content) An engineering company has ordered steel to be used for a rail construction project. Before using the steel, they want to test it to ensure the material properties from the supplier are correct. A random sample of the ordered steel is tested for its Yield Strength. The results are shown below. Yield Strength (MPa) 197 203 194 196 196 197 198 205 1. Calculate the sample mean and sample variance by hand,...
Part A (Based off week 10 workshop content) Receatly a study was performed on a Qareslad highaay regarding the quan- tity and speed of vehicles that use the road. It is your jo to determine the probabality of certain events with the use of probability distribations For each question, clearly state which probability distribution the random variable follows. You mast solve each peoblem by band and verify using a MATLAB function. 1. During the testing time, it was found that...
all the codes should be done in matlab Part C (Based off week 12 workshop content) Since the implementation of the CityCycle scheme in October 2010, the Bris- bane council has recorded the umber of City Cyele trips every month. The results are available in the CityCycleData.es file on Blackboard 1. Import the data into MATLAB using the csvread funetion, and then visualise the data with the scatter fnction Comment on whether a linear model would be appropriate to use....
all the codes should be done in matlab Part A (Based off week 10 workshop content) Recently a study was performed on a Queeislad highway regarding the quan tity and speed of vehicles that use the road. It is your job to determine the probability of certain eveuts with the use of probability distributions For each question, clearly state which probability distribution the random variable follows. You mast solve each problem by band and werify using a MATLAB function 1....
all the answers must be done please help and codes should be done in matlab Part C (Based off week 12 workshop content Sinee the implementation of the CityCyele scheme in October 2010, the Bris bane council has recorded the mamber of City Cycle trips every month The results are available in the CityCycleData.cov' fie on Blackboard 1. Import the data into MATLAB using the cavread fuaction, and the visualise the data with the scatter function Coenment on whether a...