Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use R as coding language Question 8 Imputation is the process of replacing missing values by estimated values. The simplest (far from preferred) method to

image text in transcribed

use R as coding language

image text in transcribed
Question 8 Imputation is the process of replacing missing values by estimated values. The simplest (far from preferred) method to impute values is to replace missing values by the most typical (or "average") value. Write a function called impute () that will impute missing values from a specified column in a matrix or data frame. The impute ( ) function should have one required argument x that specifies the input matrix or data frame and three optional arguments: . The col argument specifies the column or columns in which to impute values. col is optional with no default. If col is not specified, the function should impute values for all numeric columns. . The center argument specifies what function to use for imputation. Your function should work for any function which returns a single summary statistic for a vector, such as mean, median, or max. This argument should be optional with a default of mean. . The margin argument specifies one of two ways to input values: - Impute the missing values using the center of the observed (non-missing) values in the column. - Impute the missing values using the center of the observed values in the row. - margin should be optional with a default of 2. Note: center should only be computed on the numeric values in the column or row

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

2nd Edition

1139200658, 9781139200653

More Books

Students also viewed these Mathematics questions

Question

Identify the primary goal of psychodynamic psychotherapy.

Answered: 1 week ago