Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. R problem: We will use the painters data frame in the MASS package for the following exercises. To use the painters data frame, you

image text in transcribed
image text in transcribed
5. R problem: We will use the painters data frame in the MASS package for the following exercises. To use the painters data frame, you need to use the library function to call the MASS package. The first 6 observations of the painters data frame are listed below. > library (MASS) > head (painters) Composition Drawing Colour Expression School Da Udine 10 8 16 3 Da Vinci 15 16 4 14 Del Piombo 8 13 16 7 Del Sarto 12 16 9 8 Fr. Penni 0 15 8 0 Guilio Romano 15 16 14 Write a function called mean.sd to calculate the mean and standard deviation of a numeric variable. The first argument, dat, is the name of the data frame. . The second argument, varname, is the name of the numeric variable. Note that the mean.sd function returns a numeric vector of length of 2. The first component of the returned vector is the calculated mean; the second component is the calculated standard deviation. For example, here're the results if you call the mean.so function. > mean . sd (painters, "Composition") [1] 11. 555556 4.087102 >mean . sd (painters, "Drawing") [1] 12 . 462963 3. 457084

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

Calculus Single Variable

Authors: Deborah Hughes Hallett, Deborah Hughes Hallet, Andrew M Gleason, William G McCallum, Daniel E Flath, Patti Frazer Lock, David O Lomen, David Lovelock,

6th Edition

1118748611, 9781118748619

More Books

Students also viewed these Mathematics questions

Question

2. Ask questions, listen rather than attempt to persuade.

Answered: 1 week ago