libname dieldata "G:\Teaching\ECN410\DielmanData"; /* libname xptfile xport 'G:\Teaching\ECN410\DielmanData\meddicorp4.xpt' access=readonly; proc copy inlib=xptfile outlib=dieldata; run; */ /* proc export data=dieldata.meddicor outfile='G:\Teaching\ECN410\DielmanData\meddicor.xlsx' dbms = xlsx replace; run; */ proc contents data=dieldata.meddicor; run; proc means data=dieldata.meddicor; run; /*reproduce results shown in Dielman (2005) 4e, pages 135-138*/ /* variables are (see Dielman 4e): SALES: Meddicorp's sales in $1,000s in each territory for 2003 ADV: amount Meddicorp spent on advertising in each territory in $100s in 2003 BONUS: total amount of bonuses paid in each territory in $100s in 2003 MKTSHR: market share currently held by Meddicorp in each territoty COMPET: largest competitor's sales in each territory */ proc reg data=dieldata.meddicor; /* basic regression command */ model sales = adv bonus; /* sales is the dependent variable*/ *ES: TEST bonus=.8; output out=meddicor_p p=sales_hat; /* this creates a new data set named meddicor_p and will have the predicted values sales_hat */ run; proc reg data=dieldata.meddicor; model sales = adv bonus mktshr compet; /* in this version we have added two more independent variables*/ PF: TEST mktshr, compet; /* This line gives a partial F-test result, compare the ANOVA tables to see how this works*/ run; QUIT; /* for additional notes from SAS on the TEST option visit the SAS documentation page below: https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_reg_sect022.htm */