Question

·Write a Cl Calculator in MATLAB (function name ci_calc.m). Your function should take four input arguments: σ, x,n, p% Confidence Interval Calculator σ (Std Dev) Sample mean Sample size Confidence level 577.4 37.4556 100 90% Numeric input Numeric input Numeric input Numeric input Lower limit of Cl -57.52 Numeric output Upper limit of Cl 132.43 Numeric output

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB Code:

function [lCI, uCI] = ci_calc (stdDev, mean, sampleSize, cl)
% Confidence Interval Calculator

% Vector that hold different confidence level percentages
confLevel = [80, 85, 90, 95, 99, 99.5, 99.99];

% Vector that holds Z values
ZVals = [1.282, 1.440, 1.645, 1.960, 2.576, 2.807, 3.291];

% Finding Z Value
Z = ZVals(find(confLevel==cl));

% Calculating lower confidence interval
lCI = mean - ( Z * (stdDev / sqrt(sampleSize)) );

% Calculating upper confidence interval
uCI = mean + ( Z * (stdDev / sqrt(sampleSize)) );

end

_______________________________________________________________________________________________

Sample Run:

calc (577.4, 37.4556, 100, 90) >> [ICI, uC1] = ci 1CI-57.527 uC1 132 . 44 7 -

Add a comment
Know the answer?
Add Answer to:
·Write a Cl Calculator in MATLAB (function name ci_calc.m). Your function should take four input arguments:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four...

    USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four inputs, a number called mass (in kg), a number called fuel (in joules of energy), a number called orbit (in meters), and a number called engine (in newtons). It should return an output structure called spacecraft containing each of those values. Please ensure that both the function name, AND the names of variables within the spacecraft structure are exactly as instructed

  • What price do farmers get for their watermelon crops? In the third week of July, a...

    What price do farmers get for their watermelon crops? In the third week of July, a random sample of 42 farming regions gave a sample mean of x = $6.88 per 100 pounds of watermelon. Assume that σ is known to be $2.00 per 100 pounds. (a) Find a 90% confidence interval for the population mean price (per 100 pounds) that farmers in this region get for their watermelon crop. What is the margin of error? (Round your answers to...

  • Allen's hummingbird (Selasphorus sasin) has been studied by zoologist Bill Alther.† Suppose a small group of...

    Allen's hummingbird (Selasphorus sasin) has been studied by zoologist Bill Alther.† Suppose a small group of 18 Allen's hummingbirds has been under study in Arizona. The average weight for these birds is x = 3.15 grams. Based on previous studies, we can assume that the weights of Allen's hummingbirds have a normal distribution, with σ = 0.36 gram. (a) Find an 80% confidence interval for the average weights of Allen's hummingbirds in the study region. What is the margin of...

  • What price do farmers get for their watermelon crops? In the third week of July, a...

    What price do farmers get for their watermelon crops? In the third week of July, a random sample of 45 farming regions gave a sample mean of = $6.88 per 100 pounds of watermelon. Assume that σ is known to be $1.94 per 100 pounds. (a) Find a 90% confidence interval for the population mean price (per 100 pounds) that farmers in this region get for their watermelon crop (in dollars). What is the margin of error (in dollars)? (For...

  • Matlab Objectives Write a function that accepts variable number of arguments Write a function that returns...

    Matlab Objectives Write a function that accepts variable number of arguments Write a function that returns multiple arguments Use fprintf (or sprintf) for formated output to the screen Review physics of a projectile trajectory with no air resistance Instructions Write a Matlab function called work09.m that computes the maximum horizontal and vertical distance of a projectile and the total travel time, given the firing angle and initial velocity. Also, accept a third optional parameter that adjusts the gravitational constant (g...

  • Below are numerical and graphical summaries of Price. Use these to complete Questions 7 and 8....

    Below are numerical and graphical summaries of Price. Use these to complete Questions 7 and 8. Descriptives Statistic Std. Error price Mean 80.7500 4.98105 95% Confidence Interval Lower Bound 70.8355 for Mean Upper Bound 90.6645 Median 73.9750 Variance 1984.867 Std. Deviation 44.55184 Minimum 9.99 Maximum 249.00 Range 239.01 Interquartile Range 47.29 Frequency 25 50 75 175 200 225 250 100 125 150 price 7. Consider the variable Price. A. Complete the table below. Mean Median Standard deviation Sample size B....

  • Answers to the following questions should be calculated in Matlab and given to 4 decimal places. ...

    Answers to the following questions should be calculated in Matlab and given to 4 decimal places. Be careful not to introduce errors by rounding in any intermediate calculations as this may lead to an incorrect final answer. A confidence interval is desired for the true average load loss u (watts) for a certain type of induction motor when the line current is held at 10 amps for a speed of 1500 rpm. A random sample of 49 motors were tested...

  • What price do farmers get for their watermelon crops? In the third week of July, a...

    What price do farmers get for their watermelon crops? In the third week of July, a random sample of 43 farming regions gave a sample mean of x = $6.88 per 100 pounds of watermelon. Assume that o is known to be $1.96 per 100 pounds. (a) Find a 90% confidence interval for the population mean price (per 100 pounds) that farmers in this region get for their watermelon crop (in dollars). What is the margin of error (in dollars)?...

  • Problem 1: Write a function ProcessiClicker to take any sized table as an input with at...

    Problem 1: Write a function ProcessiClicker to take any sized table as an input with at least two string column variables LastName and Firstname, and removes any leading and trailing whitespace from variables in LastName and Firstname, and combines the resulting two columns variables into one column named StudentName, with only comma between the last name and the first names. For example, if one record entry in Lastname and Firstname contains " Jones " and " Adam", the final result...

  • 1) A) The student union wants to negotiate a subsidized bus pass with your school's administration....

    1) A) The student union wants to negotiate a subsidized bus pass with your school's administration. They have polled 270 students as to whether they support this proposal, which would add a small fee to their tuition since both the college and the students would share the cost. The union found that opinions were evenly split: 50% of students were in favor of the proposal, and the rest were opposed. The margin of error for their finding at the 90%...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT