answer following in r studio #human and dolphin baby weights: months
Question:
answer following in r studio #human and dolphin baby weights: months <- c(0, 0, 1, 2, 3, 4, 5, 6, 6, 7, 8, 8) species <- c("human", "dolphin", "dolphin", "human", "dolphin", "human", "human", "dolphin", "dolphin", "human", "human", "dolphin") weight <- c(5.5, 20.4, 20.4, 13.5, 41.6, 12.5, 17.5, 45.9, 52.1, 32.5, 26.5, 59.6)
#a) Create a data frame of the data and call it weight.data
#b) Create the model
#c) Change species to factor and have human be reference level
#d) Recreate the model and observe the summary
#e) What is the equation of best fit line? Assume x1 is months and x2 is the #dolphin dummy variable
#2) A study was done to determine whether gender of the credit card holder was #an important factor in generating profit for a certain credit card company. #The variables considered were income and gender. Here is the data: profit <- c(157, -181, -253, 158, 75, 202, -451, 146, 89, -357, 522, 78, 5, -177, 123, 251, -56, 453, 288, -104) income <- c(45000, 55000, 45800, 38000, 75000, 99750, 28000, 39000, 54350, 32500, 36750, 42500, 34250, 36750, 24500, 27500, 18000, 24500, 88750, 19750) gender <- c("M", "M", "M", "M", "M", "M", "M", "M", "M", "M", "F", "F", "F", "F", "F", "F", "F", "F", "F", "F")
#a) create a data frame of the information
#b) Create a regression model that uses x1 for income and x2 if the customer is #female.
#c) Based on the fitted model, would you say the company prefer male or female #customers?