I am (SUPER NEW) using SAS Studio ODA, 9.4,
I have a data set that I have cleaned and reduced from 5000 obs to 445, and now have the following variables: Branch AVGLoanAmt AVGPrice MedCreditScore
Within the Branch variable I have 5 values (1-5).(sorted by desc Branch)
I need to calc each Branch by the Count, AVGLoanAmt,AVGPrice, and MedCreditScore. PER Branch
**(Branch has Labels Branch(1=LIV924, 2=STV408, 3=SLO805, 4=GLN626, 5=COR760)
I have not used the Labels to create new variables, I have only tried PROC FREQ, PROC MEANS and PROC PRINT to break the data set up in order to do the various calcs for one table.)**
Here is the exact question asked and my last code:
Create a table that calculates the count, mean loan amount, mean home price, and median credit score, by branch
Everything I have tried is still giving me multiple rows of data with each Branch. And I have to do a PP Presentation for each step, as well, so I know there are possibly more steps than necessary.
DATA want;
SET have;
KEEP Branch LoanAmt Price CreditScore LoanApproved PercentDown;
WHERE PercentDown < 0.05;RUN;
DATA want;
SET have;
WHERE LoanApproved = 1; IF LoanApproved = 0 THEN DELETE;
RUN;
DATA want;
SET have;
AVGLoanAmt = Mean(LoanAmt);
AVGPrice = Mean(Price);
MedCreditScore = Median(CreditScore);
Format AVGLoanAmt AVGPrice Dollar16.2;
FORMAT MedCreditScore 3.;
KEEP Branch AVGLoanAmt AVGPrice MedCreditScore;
RUN;
PROC SORT data=have OUT= Want;
By DESCENDING Branch descending AVGLoanAmt descending AVGPrice descending MedCreditScore;
RUN;
Then I get stuck.
I really just need to see how to separate and then calculate per branch (Branch1-Branch5) per argument.
ANY HELP WOULD BE SO VERY APPRECIATED!