0
$\begingroup$

I am working on my first linear regression project in SAS and I wanted to ask some advice.

My dataset consists of a sample of 428 automotive vehicles from the same production year that was collected in order to understand the relationship between the price (as measured by the MSRP) and descriptive variables for each vehicle. The variables in the data set provided are as follows:

Response Variables:

  • Manufacturer’s Suggested Retail Price (MSRP) – this is the response of interest
  • Dealer Cost – an alternative response that is not of interest

Predictor or Independent Variables:

  • Engine Size – measured in liters

  • Numbers of Cylinders in the engine

  • Horsepower of the engine

  • Miles per gallon for city driving (MPG – City)

  • Miles per gallon for highway driving (MPG – Hwy)

  • Vehicle Weight

  • Wheelbase of vehicle

  • Vehicle Length

  • Vehicle Width

  • Drive Wheels of each vehicle

  • Vehicle Type.

From a first exploration of the data I saw that there are some missing values in the continuous variables, and so I wanted to proceed as follows: divide the vehicles by type (sedan, sports car, SUV, wagon, minivan, pickup), and then replace the missing values with the mean of that value for the cars of that same type (for example, if I'm missing "vehicle weight" for a sedan, then I would compute the averge weight of all the other sedan and replace the missing value with the obtained mean).

The question is: can anybody help me with the SAS code? My dataset in .xlsx format and I am importing it in the following way.

proc import datafile='/folders/myfolders/xlsx datasets/Property.xlsx' dbms=xlsx out=property replace; getnames=yes;

$\endgroup$
1
  • $\begingroup$ What you are suggesting is a type of "regression imputation", and it's generally discouraged (stefvanbuuren.name/fimd/sec-simplesolutions.html#sec:regimp). Is there a reason you're choosing this instead of multiple imputation? Are there only very few missing values? Have you examined the relationship between missingness and other variables to see if there is a significant relationship? $\endgroup$ May 5 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.