Advertisement
alephnaught

Project Code

Nov 25th, 2020
1,798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 1.63 KB | None | 0 0
  1. FILENAME CSV "/folders/myfolders/USStatesCrime.csv" TERMSTR=CRLF;
  2. PROC IMPORT DATAFILE=CSV
  3.             OUT=WORK.MYCSV
  4.             DBMS=CSV
  5.             REPLACE;
  6. RUN;
  7. PROC PRINT DATA=WORK.MYCSV; RUN;
  8. FILENAME CSV;
  9.  
  10. proc corr data=work.mycsv;
  11. run;
  12.  
  13. proc corr data=work.mycsv plots=scatter (Ellipse = none Nwith=ALL);
  14. var total;
  15. with Violent_crime  Property_crime  Murder_Manslaughter Rape    Robbery Aggravated_assault  Burglary    Larceny_theft   Grand_Theft_Auto    Arson   Vandalism   Drug_Abuse  DUI Population_2016;
  16. run;
  17.  
  18. /*Total Violent_crime   Property_crime  Murder_Manslaughter Rape    Robbery Aggravated_assault  Burglary    Larceny_theft   Grand_Theft_Auto    Arson   Vandalism   Drug_Abuse  DUI Population_2016 */
  19. proc reg data=work.mycsv;
  20. model total = Violent_crime Property_crime  Murder_Manslaughter Rape    Robbery Aggravated_assault  Burglary    Larceny_theft   Grand_Theft_Auto    Arson   Vandalism   Drug_Abuse  DUI / selection = cp;
  21. run;
  22.  
  23. proc reg data = work.mycsv plots(unpack useall lable) = all;
  24. model Total = Aggravated_assault Larceny_theft Vandalism Drug_Abuse DUI / vif clm cli;
  25. run;
  26.  
  27. proc sgplot data = work.mycsv;
  28. reg x = total y = Aggravated_assault Larceny_theft Vandalism Drug_Abuse DUI;
  29. run;
  30.  
  31. proc reg data=work.mycsv;
  32. model total = Violent_crime Property_crime  Murder_Manslaughter Rape    Robbery Aggravated_assault  Burglary    Larceny_theft   Grand_Theft_Auto    Arson   Vandalism   Drug_Abuse  DUI / selection = stepwise sle= 0.15 sls = 0.15;
  33. run;
  34.  
  35. proc reg data = work.mycsv plots(lable) = all;
  36. model Total = Drug_Abuse property_crime vandalism robbery DUI / vif;
  37. run;
  38.  
  39. proc sgplot data = work.mycsv;
  40. reg x = total y = Drug_Abuse property_crime vandalism robbery DUI;
  41. run;
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement