* Read in data; * Two level full profile conjoint analysis; /* * Make: domestic 0, Foreign 1 * MPG: 22 0, 28 1 * Door 2DR 0, 4DR 1 * Price $22000 0, $18000 1 */ data conjoint1; input rating make mpg door price; cards; 4 0 0 0 0 41 0 0 0 1 18 0 0 1 0 60 0 0 1 1 33 0 1 0 0 74 0 1 0 1 49 0 1 1 0 86 0 1 1 1 11 1 0 0 0 55 1 0 0 1 27 1 0 1 0 66 1 0 1 1 41 1 1 0 0 85 1 1 0 1 58 1 1 1 0 99 1 1 1 1 ; proc reg data=conjoint1; model rating = make price mpg door; run; quit; proc transreg data=conjoint1 utilities; model identity(rating) = class(make price mpg door); run; quit; * Multi level full profile conjoint analysis; * Read in data file - data part; proc import datafile="C:\SAS\Smartphone conjoint.xlsx" out = data dbms=xlsx replace; sheet = "Data"; getnames = yes; run; quit; * Read in data file - conjoint part; proc import datafile="C:\SAS\Smartphone conjoint.xlsx" out = conjexp dbms=xlsx replace; sheet = "Conjoint"; getnames = yes; run; quit; * Create column of ratings; data c1 (keep=ratings); set data (keep=Q1-Q30); array myvars _numeric_; do i=1 to dim(myvars); ratings = myvars(i); output; end; run; * Create matrix of conjoint descriptions; data cmat; set conjexp(keep=Brand Screen_size Memory Camera Price); run; %macro combine; data c0; set %do i = 1 %to 150; cmat %end; ; run; %mend; %combine; * Combine the matrix of conjoint with ratings of conjoint; data smartphone; set c0; set c1; run; * Now run the conjoint analysis!!; proc transreg data=smartphone utilities; model identity(ratings) = class(Brand Screen_size Memory Camera Price); run; quit; proc reg data=smartphone; model ratings = Brand Screen_size Memory Camera Price; run; quit;