Define the following function and save it in confid.m (We are taking the confidence level as input and hence are not just restricting to calculating for 95%) . (If your version of matlab allows including the functions in scripts, then no need to create a function file)
Call the above function in the following code
get the following output
All code in text format
---- The function ---
%function to find the confidence interval
%The function takes the following inputs
%inputs
% x - Vector of Measurements
% CL - confidence level of the required confidence interval (in
%)
%outputs
% mv - mean value
% uc - upper confidence limit
% lc - Lower confidence limit
function [mv,uc,lc]= confid(x,CL)
%find the number of observations N in the vectro x
N=length(x);
% find the sample mean
xbar=1/N*sum(x);
% find the sample standard deviation
S=sqrt(1/(N-1)*sum((x-xbar).^2));
%find the alpha for confidence level conf.level
a=1-CL/100;
%calculate the degrees of freedom
df=N-1;
%find the critical value of t
tcrit=tinv(1-a/2,df);
%calculate the lower (1-alpha) confidence limit
lc=xbar-tcrit*S/sqrt(N);
%calculate the upper (1-alpha) confidence limit
uc=xbar+tcrit*S/sqrt(N);
% assign xbar to mv, to output the mean value
mv=xbar;
end
%---The main ----
%set the measurement vector
x=[19.1 22.2 16.9 19.4 20.2 18.0 21.1];
% assign the confidence level
cl=95;
% call the function to get the confidence interval
[mv,uc,lc]= confid(x,cl);
%print the results
fprintf(' The mean value is %.2f, and %d%% confidence interval for
mean is [%.3f,%.3f] ',mv,cl,lc,uc);
Please comment code with steps Solution of the Example Calculate Mean: Standard Deviation: S-- Σ(xi-x) Find...
Confidence Interval about a Population Standard Deviation 3) Consider the same information as in Example 2 on page 336, section 7.3, but use a confidence level of 90% instead of 95% Write your solution just like in the example. Show all work and use the formulas (do not use any technology here!) Note that the solution shown in the example is quite detailed. Your solution could be shorter, start where it says Using Table A-4 on page 337, and continue...
Scores on Professor Combs Statistics Final Exams have a long term history of being normally distributed with a mean of μ=70 and a standard deviation of σ=8 a.) Find the probability that a single student will score above a 75 on the Final exam. b.) Find the probability that a single student will score between a 65 and 75 on the Final exam. c.) Find the probability that an entire class of 20 students will have a class average above a 75 on...
In this preliminary study at a level of significance of α-001 wa below 185 on the average? The deviation is, s 26.3. Assume the data is normally 5) after e mean cholesterol after the study is x=1689 and the standard a (3 pts) what type of test will you conduct? In order to test if the total cholesterol has been lowe red to below 185 after 6 months state the null and alternative hypotheses. (6 pts) Calculate the t statistic...
1. A personnel officer found that the mean score of the company's overseas branches on a stress inventory was 44.6 with a standard deviation of 10 based on a random sample of 400 observations taken from the population. There is a 0.99 probability that the sample mean will provide a margin of error of (using a t-value) Select one: a. None of the other answers are correct b. .98 or less c. 4 or more d. 13.16 or less e....
please solve only for the set 1. 2. The thrust of a jet engine conditions and a sample of data points was collected. The process was repeated during 3 different data collection sessions. The resulting 3 sets of data are shown in the provided table a) For each data set separately, detemine the sample deviation, S; standard deviation of the mean, SF = s/VN and number of degrees of freedom b) For the data set separately, if one additional measurement...
Number 1:A. Suppose your section will participate in the field demonstration at the Sports festival in your school. This field demonstration must be consisting of 20 learners per section. Your adviser assigned you to organize a team that is willing to join in the said event. He also instructed you to collect information about your classmates’ height because he will need to buy a costume. Since your community is under the General Community Quarantine because of the recent pandemic, you...
Calculate the mean, median, and standard deviation for the total number of candies (per bag). Construct a histogram of the total number of candies (per bag). Use the z-score method to identify any potential outliers and outliers. Assume the total number of candies is normally distributed, calculate the probability that a randomly sampled bag has at least 55 candies in a bag. If a random sample of 50 bags is selected, find the probability that the mean number of candies...
Please explain thank you. 6. Confidence and prediction Interval estimates Aa Aa You are a starting pitcher in the major leagues. It's January 2008, and you are in the process of negotiating your salary for the 2008 season. You hire a statisticlan to help you with your negotiations. She specifies the folowing simple linear regression model: where y2008 salary (in millions of dollars), and x performance during the regular 2007 season Then she selects a random sample of 50 major...