Question: Use R program Problem 1. [10 points] Define a function named loan_offer to admit or reject loan applications, based on the decision tree below. Please
Use R program
![Use R program Problem 1. [10 points] Define a function named loan_offer](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39261a400a_75266f39260f2c5e.jpg)
Problem 1. [10 points] Define a function named loan_offer to admit or reject loan applications, based on the decision tree below. Please note that the income range of $40K$80K contains its bounds (\$40K and $80K ). The loan_offer function needs to satisfy the following requirements: - Arguments: - A numeric variable that shows the applicant's income. - A logical variable, which indicates whether an applicant has a criminal record (i.e., c_record = TRUE) or not (i.e., c_record = FALSE). - A numeric variable that shows number of years in present job. - Output: Return a categorical value of "Admit" or "Reject". - Validate your function for the following applicant: Your function must return "Reject" for an applicant with $40K income, no criminal record, and 3 years in present job
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
