Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Write a function called crim, mean that computes the trimmed mean of a data vector. A trimmed mean is a mean computed after a

image text in transcribed
4. Write a function called crim, mean that computes the trimmed mean of a data vector. A trimmed mean is a mean computed after a certain number of observations are removed from both the low and high ends of the sorted data. Typically, the same number of observations are removed from both ends. For example, suppose we want the trimmed mean of the data shown below, after removing the lowest and highest values. 1 345 825 The trimmed mean would be 3+4+5+8 4 The inputs of your function should be a data vector and the number of observations that will be removed from both the low and high ends, with a default value of 1. The output of the function should be the trimmed mean. Use a pipe operator to apply your trim mean function to dat, trimming 5 observations from each end. Remember to comment your code with a description of what the trim meanfunction does and a list of the arguments with a description of each argument. (Hint: The otfunction will sort the values in a data vector from smallest to largest) 4. Write a function called crim, mean that computes the trimmed mean of a data vector. A trimmed mean is a mean computed after a certain number of observations are removed from both the low and high ends of the sorted data. Typically, the same number of observations are removed from both ends. For example, suppose we want the trimmed mean of the data shown below, after removing the lowest and highest values. 1 345 825 The trimmed mean would be 3+4+5+8 4 The inputs of your function should be a data vector and the number of observations that will be removed from both the low and high ends, with a default value of 1. The output of the function should be the trimmed mean. Use a pipe operator to apply your trim mean function to dat, trimming 5 observations from each end. Remember to comment your code with a description of what the trim meanfunction does and a list of the arguments with a description of each argument. (Hint: The otfunction will sort the values in a data vector from smallest to largest)

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions