Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

SAS Assignment #2

Problem: Predict how long a dog will be in the shelter before adoption (time_in_shelter_days).

Requirements: Complete the following steps, showing your approach in a slideshow (pptx).  You do not need to complete the steps separately or necessarily in this order… just do what makes sense.  Combining steps is totally fine… even encouraged.  Do not use Proc SQL!

1. Begin with the ‘aac_intakes_outcomes_MODIFIED’ dataset available on HuskyCT.

2. Import the data into a permanent library in SAS 9.4.

3. Filter the dataset to include only dogs and only animals who were eventually adopted (outcome_type = ‘Adoption’).  Also remove any outliers where ‘time_in_shelter_days’ is greater than 200.

4. Determine the baseline prediction (hint: you can use proc univariate)

5. Create some new variables to model on…

a. Topbreed is any record with a breed that contains the words ‘LAB’, ‘BULLDOG’, ‘TERRIER’, ‘SHEPHERD’, or ‘BEAGLE’.  Set to 1 if yes, 0 if no.  Careful, case sensitive!

b. OPTIMAL_COND_N is a numerical representation of OPTIMAL_COND that just has a 1 for ‘Y’ and 0 for ‘N’.

6. Use proc reg to create a linear model (see below for what my output looked like)

 

Using all variables that are eligible based on p-value (Pr > |t|) create a field called model_pred that predicts the days until adoption.  Manually enter this linear regression formula OR use a SAS procedure to score the dataset.

7. Create a field called baseline_pred that contains the baseline prediction.

8. Create two new fields to calculate the absolute deviation for your model prediction AND your baseline prediction (on each record).

9. Use proc univariate (or similar) to calculate the MAD for model predictions and baseline.

10. Does your model out-perform baseline??? Interpret results.

Submit a walkthrough of your code (with code screenshots) in a PowerPoint deck.  You may work in pairs or individually.