Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the intrinsic R functions sd() and mean() to define a CV() function. Give your function the default parameter name=coefficient of variation, and provide for

  1. Use the intrinsic R functions sd() and mean() to define a CV() function. Give your function the default parameter name="coefficient of variation", and provide for ellipsis parameters. Test your function against data with a known outcome, e.g simulated exponential data
CV(rexp(1000, rate=2), name="is this value close to 1.0?")

  1. Test the function with a canned dataset, e.g.LakeHuron or sunspot.month. Use the name parameter to label each estimate with a meaningful name (Use the R ? help feature to get descriptions.)

Put It to Work

Compare the CV's for two uniform random samples, runif(1000, min=0, max=1) and runif(1000, min=0, max=10). Are they markedly different? If so, how?

Compare the CV's for two Gaussian random samples rnorm(1000, mean=10, sd=2) and rnorm(1000, mean=5, sd=2). Are they markedly different? If so, how?

Compare the CV's for two gamma random samples, rgamma(1000, shape=3, rate=1) and rgamma(1000, shape=6, rate=1). Are they markedly different? If so, how?

Knit it up, convert to PDF, and send it in.

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

Geometry

Authors: David A Brannan, Matthew F Esplen, Jeremy J Gray

1st Edition

1107299292, 9781107299290

More Books

Students also viewed these Mathematics questions

Question

Explain how CVP analysis can be used for mana gerial planning. LO1

Answered: 1 week ago