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.
when use proc logistic procedure to set up default model in bank risk analysis, for the current customer, there are 4 kinds of results after application for the loan, accept, refuse , cancel or nouse. when set up model, to analysis if new customer will default or could approve their application of loan, we will use the current customer loan history. refused=1, accept=0 but how to deal with cancel and nouse, i think nouse looked as accepted, but for cancel, how to deal with it?
... View more
Hi there, I am running into issues with the lag function. I am able to use lag(variable), if recalling only the observation immediately prior, however I am not able to use lag2(variable), lag3(variable), etc.. As soon as I enter a numerical value (n) next to the lag function, it is no longer highlighted in blue or recognized as a SAS function. Checking my data shows it is not picking up the function, beyond the first lag(variable), with no 'n' specified. Has anyone experienced this? I am using SAS Studio.
... View more
Happy Mother's Day, all!
* Fun w/SAS ODS Graphics: Mom Bracelet;
data beads; * Create "beads" for Mom bracelet;
retain size 1; * All beads same size;
pi=constant("pi"); * 3.414...;
do i=1 to 20; * Plot 20 points around circle (see blogs.sas.com/content/graphicallyspeaking/2018/11/01/text-plot-can-do-that/);
angle=90-i*18;
x=cos(angle*pi/180);
y=sin(angle*pi/180);
angle=angle+90; * Add 90 to angle to rotate letter labels at bottom back upright;
if i in (9, 11) then txt="M"; * Add letters 'M' in beads 9 and 11 for 'MOM' (counting from top and going clockwise);
if i=10 then yH=y; * Need a point to plot a heart in bead 10 (instead of the 'O' in 'MOM');
output;
yh=.; txt=""; * Reset variables;
end;
* Let's plot the bracelet! (Ellipse + Bubble + Text Plots);
ods graphics / width=5.5in height=5.5in antialias noborder;
proc sgplot data=beads noautolegend noborder pad=0 aspect=1 nowall subpixel noborder pad=0;
styleattrs backcolor=cxfff9ff; * Very light pink background;
symbolimage name=heart image='/home/ted.conway/heart.png'; * Use white heart image for the 'O' in 'MOM';
ellipseparm semimajor=1 semiminor=1 / slope=0 xorigin=0 yorigin=0 outline lineattrs=(color=vipk thickness=3pt); * 'Elastic' to string beads;
bubble x=x y=y size=size / fill fillattrs=(color=stpk) nooutline bradiusmin=30 bradiusmax=31 dataskin=gloss; * Beads;
text x=x y=y text=txt / rotate=angle contributeoffsets=none strip textattrs=(color=white size=26pt weight=bold); * Plot 'M' letters in 'MOM' at an angle;
scatter x=x y=yH / markerattrs=(symbol=heart size=32pt); * Plot heart image (takes place of 'O' in 'MOM');
xaxis display=none offsetmin=0 offsetmax=0 values=(-1.3 1.3); * Suppress labels/ticks on axes, set bounds;
yaxis display=none offsetmin=0 offsetmax=0 values=(-1.3 1.3);
run;
... View more
Hi all,
Please help me to code this. This is the dataset below-
I have 2 drugs being used for each ID i.e., SGA and DM. I have multiple start date and end dates for each ID and drug. I want to see if the DM_start falls into any of the SGA_start and SGA_end under each id. That is DM_start of period 3 can fall in the SGA_start and SGA_end of period1.
And also calculate the number of overlapping days for each time period. I want to know the no. of days for each orange period.
Thank you all in advance,
Any help would be appreciated.
... View more
I am trying to analyze a dataset that has two dichotomous variables (placstat and hiv) predicting a continuous variable (lplacwbc). The data are unbalanced. I am interested in seeing a matrix for pairwise comparisons, with p values, for all possible comparisons. The following code yields the output provided (not showing the model output, only lsmeans output). I may be missing something simple here, but I cannot figure it out! proc glm; class placstat hiv; model lplacwbc=placstat hiv placstat*hiv/ ss1 ss2 ss3 ss4; lsmeans placstat hiv/pdiff=all adjust=tukey; run;
... View more