Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MatLab question, Why is the code not working? Determining Quartiles In this lab you will use specific functions to determine the quartiles of a set

MatLab question, Why is the code not working?

image text in transcribed

Determining Quartiles In this lab you will use specific functions to determine the quartiles of a set of data. Quartiles of a set is defined as the 25%, 50% and 75% values of the dataset. We can intepret this to mean the following: In a sorted data set, the 25% value separates the lowest 25% of the set from the upper 75% of the set. The 50% value separates the lowest 50% of the set from the upper 50% of the set (often called the median). The 75% value separates the lower 75% from the upper 25% of the set. If we think about how to calculate quartiles we could: 1. Find the median of the set 2. Separate out the set into two smaller sets 3. Find the medians of the smaller two sets Load the Data Your first task is to load a dataset from the file "mayoralpayroll.mat". Inside this file is a 177x5 array named payinfo containing salaries (among other things) of all the people working in the Mayor of LA's office (including the mayor). In the fourth column is the annual salary of all the employees. NOTE: The annual salaries are already sorted in ascending order Your job is to determine the quartiles of the annual salary and store it in a vector named salaryQuartiles Find the Median Using whatever method you'd like, find the median of the annual salaries. Since the dataset is 177 elements long, we know the median is the value in the middle. This is the 50% value. Split the Set Once you find the median value, split the data set into two separate data sets that do not include the median value. Again, use whatever method you'd like to find the median of the two data sets. This represents the 25% value (median of the lower set) and the 75% value (the median of the upper set). Merge the Results Store all the final values into a single vector named salaryQuartiles NOTE: You may not use the quantiles(), prctile(), or iqr() functions Determining Quartiles In this lab you will use specific functions to determine the quartiles of a set of data. Quartiles of a set is defined as the 25%, 50% and 75% values of the dataset. We can intepret this to mean the following: In a sorted data set, the 25% value separates the lowest 25% of the set from the upper 75% of the set. The 50% value separates the lowest 50% of the set from the upper 50% of the set (often called the median). The 75% value separates the lower 75% from the upper 25% of the set. If we think about how to calculate quartiles we could: 1. Find the median of the set 2. Separate out the set into two smaller sets 3. Find the medians of the smaller two sets Load the Data Your first task is to load a dataset from the file "mayoralpayroll.mat". Inside this file is a 177x5 array named payinfo containing salaries (among other things) of all the people working in the Mayor of LA's office (including the mayor). In the fourth column is the annual salary of all the employees. NOTE: The annual salaries are already sorted in ascending order Your job is to determine the quartiles of the annual salary and store it in a vector named salaryQuartiles Find the Median Using whatever method you'd like, find the median of the annual salaries. Since the dataset is 177 elements long, we know the median is the value in the middle. This is the 50% value. Split the Set Once you find the median value, split the data set into two separate data sets that do not include the median value. Again, use whatever method you'd like to find the median of the two data sets. This represents the 25% value (median of the lower set) and the 75% value (the median of the upper set). Merge the Results Store all the final values into a single vector named salaryQuartiles NOTE: You may not use the quantiles(), prctile(), or iqr() functions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago