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:
- 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)
Wheelbase of vehicle
Drive Wheels of each vehicle
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;