Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Data Mining for Business Applications: Using R programming in R Studio: Please help with parts a-c. thank you! (Screenshot of the hint under part c

Data Mining for Business Applications:
Using R programming in R Studio:
Please help with parts a-c. thank you! (Screenshot of the hint under part c is in the comments)
image text in transcribed
Problem 3 ( Points) In this problem, we will be working with the following data frame. Before attemping to answer the questions below, make sure to execute the code below to make the data frame available in your R session. patient data data.franegender c( ale ale""Fesale""Fesale Fenale""ale age e(20, 54, 68, 34. 45, 42. cholesterol c10, 180, 173. 132, stress teat-eigh"Lou", "Mediun"Lou" 3, 38, S0, 25) 40. 120. 134, 140, 190, 95), Very Rig"Med1umLow Bigh"Very High""Mediu (a) 1 Point Create an indicator variable in the patient_data data frame called high stress This should be a numeric variable that is 1 if stress_test is either High or Very High" and 0 otherwise The resulting data frame should look like this when you are done patient data gender age cholesterol stress test big stress Hale 20 Male 5 3 Fesale 68 Fesale 34 5 l 45 6 Fele 42 > 7 Fesale 43 >8 Male 38 9 Fenale 50 10 Male 25 110 173 140 Very Righ 120 Medin 90 Very Righ (b) 1 Poin Create a categorical variable called cholest_cat from the cholesterol variable in patient data that has the following values: "Less than 140. 140-160.and "161 or greater The resulting data frame should look like this when you are done patient data > gender age cholesterol tress-test high.stress Hale 20 2 Male 54 > 3 Female 68 Fesale 34 5 ale 45 6 Fele 42 s 7 Female 43 8ale 38 9 Female 50 10 Male 25 cbolest.cat Less than 140 0 161 or greater 161 or greater 0 Less than 140 140 160 Let# than 140 0 Less than 140 110 173 140 VeryRigh 120 190 Very Righ 161 or greater Lets than 140 (c) 3 Points Write R code that uses map_df to replace the age and cholesterol variable values with their absolute mean-deviated values. If we name our transformed vector w then each element of w is caculated with the following formula, wherei and aen, are the minimum, manimum, and average values in the numerit vector x a

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

What is Accounting?

Answered: 1 week ago

Question

1. Explain how new technologies are influencing training.

Answered: 1 week ago