Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
Watch this Ask the Expert session to learn how to use the DEEPPRICE procedure in SAS Econometrics to achieve personalized pricing.
Watch the Webinar
You will learn:
To adapt ideas from machine learning for econometrics in order to answer what-if questions.
How the DEEPPRICE procedure in SAS Econometrics enables you to apply machine learning.
How PROC DEEPPRICE accounts for individual variability among customers for personalized pricing and revenue optimization.
The questions from the Q&A segment held at the end of the webinar are listed below and the slides from the webinar are attached.
Q&A
Does each of the three example value functions represent what DEEPPRICE can accomplish or is that only for one of the three rows?
Value function is a function of policy rule (or treatment). Our aim is to choose the policy rule that maximizes this function. We specify the value function based on the problem that we seek to solve. For example, if treatment is binary, and if the positive treatment effect is preferred, then anyone whose
should be assigned the treatment (see the second row of the table on slide 17). If the outcome is revenue, there is a fixed cost for each treatment, and the final goal is to maximize profit (a portion of the revenue) then, the optimal policy rule should be to assign the treatment if
and not assign it otherwise, where
is the fixed cost of a treatment and
is the profit margin (see the third row of the table on slide 17). In the case study that I covered, the treatment is the price, the outcome is the demand, and the final goal is to maximize the revenue, then the optimal policy rule, i.e., the price, should be set to
(see the fourth row of the table on slide 17).
The first two specifications of the value function do not really apply to DEEPPRICE as they are for a model with a binary treatment variable.
What about the cannibalization effect? Intraction between products? Example: price of product A leads less sales of product B. Are those procs useful for measuring cannibalization?
PROC DEEPPRICE does not take into account any cross-price effects.
Can you please explain the Simpson's paradox slide one more time?
The first plot (the plot on the left on slide 3) is the plot of the amount of exercise individuals had (throughout their lives) against their cholesterol levels. In this plot, you see a positive relationship between exercise and cholesterol, suggesting that more exercise is correlated with more cholesterol. However, if you stratify the observations with respect to age and plot it, as in the plot on the right, then you can clearly see the expected relationship between the amount of exercise and the cholesterol level. Age, here is a confounding factor, and when not accounted for, it can mix up the results so badly that it can even invert the relationship. People often do not recognize the confounders, especially when they work with observational data.
Is instrumental variable supported in DEEPCAUSAL procedure?
Yes. When the treatment variable is endogenous, i.e., there is a confounders or a factor that has impact on both outcome and treatment and is not observed; an instrumental variable should be used.
You can use an instrumental variable for the unobserved confounder in the DEEPPRICE procedure.
Recommended Resources
SAS Econometrics page
The DEEPPRICE Procedure documentation
SAS Econometrics documentation
SAS Econometrics blogs
Please see additional resources in the attached slide deck.
Want more tips? Be sure to subscribe to the Ask the Expert board to receive follow up Q&A, slides and recordings from other SAS Ask the Expert webinars.
... View more
Hello, I produced a histogram for a single continuous variable (minimum value=0, mean=31, SD=14) using PROC SGPLOT. I included a normal density curve for the distribution, as well as a normal density curve for the same continuous variable from a standard population for comparison (lowest possible value=0, mean=43, SD=26.0). Given the lowest possible value is 0, I am not sure why the left tail of my normal curves extend past 0, and do not intersect at 0. Any insight would be very much appreciated! Thank you:)
... View more
Hello! I have a table that I have to export to excel using a proc report, where subtotals rows are computed for certain numeric columns. My problem is that in the table(so before the proc report) I also created a check variable (like if col A + col B = col C then "true" else "false") that need to be calculated only for the subtotal rows. Is ther a way to write this in a proc report
... View more
Hello! Using a macro, I am producing a series of crosstabs using several demographic variables (sex, age, income, etc.). Some of these variables have formats I created using PROC FORMAT. When I use PROC SURVEYFREQ, the ods output provides a table with a column that contains the values (say sex contains values 1 or 2) and another column with the formatted value (say F_sex contains Male or Female). I use the formatted columns and rename them Demographic. I then append the files created with ods output and I obtain a column named Demographic that contains the formatted values (ex. Male, Female, 18 to 30, 31 to 40, et.). However, when I do the same with PROC SURVEYMEANS, the ods output does not include columns with formatted values only columns with the actual values such as 0 and 2 and not Male and Female). Is there a way to force ods output to include the formatted values? Thanks in advance for your help! * Both PROC steps are part of a macro and &DemoVar contains the demographic variable ;
proc surveyfreq data=Mydataset VARHEADER=LABEL ;
tables year * &DemoVar * fg_use_choose
year * &DemoVar * fg_use_amt
year * &DemoVar * fg_use_assess
year * &DemoVar * fg_use_plan
year * &DemoVar * fg_use_wt
year * &DemoVar * fg_use_away / nostd row ;
weight wght ;
format income_adeq_G income_adeq_G_F.
fg_use_choose
fg_use_amt
fg_use_assess
fg_use_plan
fg_use_wt
fg_use_away yesno_F. ;
ods output CrossTabs=Results_Info ;
run ;
***********************************************;
proc surveymeans data=Mydataset mean VARHEADER=LABEL plots = none ;
var FG_trust ;
domain year * &DemoVar year ;
weight wght ;
format income_adeq_G income_adeq_G_F. ;
ods output Domain=Results_Trust ;
run ;
Erik
... View more
Hi all, I have successfully created an annotated state map from geocoded address info using the states map. However, when I try to use the county map data set, it appears that the geocoding output does not match what information in the county map dataset. Here is a small program to illustrate the difficulty. Code doesn't get past proc gproject. It seems that the length of x and y of the map do not match the length of x and y in the geocoded output. thanks! Phil : libname lookup "D:\Documents\desi2023\frlanalyses\geocodedata__2006__ZIP4_Geocode_Data\data"; data zips; input c zip; anno_flag=1l cards; 1 65203 2 65211 3 65201 ; proc geocode /* Invoke geocoding procedure */ method=plus4 /* Specify geocoding method */ lookup=lookup.zip4 /* Lookup data from MapsOnline */ data=zips /* Input data set to geocode */ out=geocodedzips; /* Specify name of Output data set of locations */ run; data mocounties;set maps.counties;if state=29; data mocounties;set mocounties geocodedzips;run; proc gproject data=mocounties out=MOCountiesP; id state ; run; data my_map locations; set mocountiesP; if anno_flag=1 then output locations; else output my_map; run; data anno_locations; set locations; if c=1 then color="red"; if c=2 then color="bib"; if c=3 then color="viyg"; if c=4 then color="bippk"; xsys='2'; ysys='2'; hsys='3'; when='a'; function='pie'; rotate=360; size=.5; style='psolid'; output; length html $300; html='title='||quote(trim(left(citystate))||'0d'x||trim(left(put(zip,z5.)))); style='pempty'; color='deb'; output; run; pattern1 v=e; proc gmap data=mymap map=mymap anno=anno_locations; id county; choro segment / coutline=black levels=1 nolegend coutline=gray99;run;
... View more