Question: 5 Create a logistic regression predicting whether or not an animal is a carnivore or herbivore based on sleep total. - You'll need to filter
5 Create a logistic regression predicting whether or not an animal is a carnivore or herbivore based on sleep total. - You'll need to filter out omnivores and insectivores: ``` r filter(vore != "omni" & vore != "insecti") ``` - You will need to use the following code to create the variable you are predicting: ``` r mutate(vorebin = ifelse(vore == 'carni', 0, 1)) ``` - Do not round these values. - Do not use \$ notation to reference the variables in the `glm()` function call, instead use the `data=` parameter. - Assign the model to Q5. Your output should look something like this: ``` Coefficients: (Intercept) sleep_total [value] [value] Degrees of Freedom: [value] Total (i.e. Null); [value] Residual Null Deviance: [value] Residual Deviance: [value] AIC: [value]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
