* project1.sas Christine Iodice 061209 Model Hunt; * Course project team: Christine Iodice, Prasad Satich, Saranne Warner, Daniel Brockman ; * Course X446 SAS Data Analysis. Jian-min Liu, Instructor. ; options ls=200 nocenter mlogic mprint symbolgen; *libname source 'C:\Documents and Settings\Christine\Desktop\SAS_Project'; libname source 'C:\b\SAS-X446\prj'; /* View Source Data*/ Title 'Original source data'; Proc print data=source.air; run; Proc contents data=source.air; run; title; /* Create temporary dataset w/ labels*/ Data source.air1 (Drop=AVS CSM); set source.air; *if CPM = 4.737 then delete; Seats = SPA*1000; Avgfilled = ALF*seats; *create variable for filled seats; AvgEmpty = (1-ALF)*seats; *create variable for empty seats; Fill_to_Empty = Avgfilled / AvgEmpty; LCPM = Log(CPM); LUTL = Log(UTL); LASL = Log(ASL); LSPA = Log(SPA); LALF = log(ALF); SUTL = UTL**2; SASL = ASL**2; SSPA = SPA**2; SALF = ALF**2; label CPM = 'CPM: Cost per Passenger Mile (cents)' UTL = 'UTL: Avg Hrs per Day in Use' ASL = 'ASL: Avg Length of nonstop legs (1000 miles)' SPA = 'SPA:Avg Nbr of Seats per Aircraft (per 1000 seats)' Seats = 'Seats:Actual Seats on aircraft' ALF = 'ALF: Avg Load Factor (% occupied)' Type = 'Type: Range (short or long)' AvgEmpty = 'Average Nbr of Empty Seats' Avgfilled = 'Average Nbr of Filled Seats' Fill_to_Empty = 'Ratio filled to Empty'; run; /*Very Cool Scatterplot matrix*/ %include 'C:\Documents and Settings\Christine\Desktop\SAS_Project\scattmat.sas'; %Scattmat(source.air1, CPM UTL ASL SPA ALF Fill_to_Empty) Proc contents data=source.air1; run; Proc Sort data=source.air1; by type ASL CPM; run; Title 'Listing of data = air1'; Proc Print data=source.air1 width=min label; Title 'sorted by Type, ASL, CMP'; run; Data source.AirShort source.airLong; set source.air1; if type = 0 then output source.airshort; If type = 1 then output source.airlong; run; Proc Reg data=source.air1; Model CPM = UTL ASL SPA ALF Type /selection=stepwise p r influence vif; Plot student.*(UTL ASL SPA ALF); Plot Student.*predicted. cookd.*obs.; Plot Npp.*Residual.; run; Quit; /* Log tranformation give Best R-Squared which is .59 */ Proc Reg data=source.air1; Model CPM = LUTL LASL LSPA LALF Type /selection=stepwise p r influence vif; Plot student.*(UTL ASL SPA ALF); Plot Student.*predicted. cookd.*obs.; Plot Npp.*Residual.; run; Quit; Proc Reg data=source.air1; Model CPM = UTL SUTL ASL SASL SPA ALF SALF Type /selection=stepwise p r influence vif; run; Quit;