Manipulating Data in Base SAS® Part 3 – Deduplicate
Recent Library Articles
Recently in the SAS Community Library: Duplicates in data can badly skew the results of an analysis. @SASJedi demonstrates data deduplication using PROC SORT with the NODUPKEY, OUT=, and DUPOUT= options and PROC SQL and PROC FedSQL
Thanks to a little math help from StackExchange, here's a SAS ODS Graphics Happy Father's Day greeting!
* Fun w/SAS ODS Graphics: Happy Father's Day! (Scatter + Polygon + Text Plots)
Star vertices algorithm from math.stackexchange.com/questions/3582342/coordinates-of-the-vertices-of-a-five-pointed-star;
data star; * Generate points for stars;
retain id 0 r1 6 r2 2.5 dad "DAD" xT 0 yT 0; * Star outer radius is 6, inner radius is 2.5;
pi=constant("pi");
do pt=1 to 600; * Points for 600 little Unicode stars;
xS=-6.25+12.5*ranuni(123); yS=-5.75+12.5*ranuni(456); output;
end;
xS=.; yS=.;
do k=0 to 4; * Points for 1 big polygon star;
x=r1*cos(2*pi*k/5+pi/2); y=r1*sin(2*pi*k/5+pi/2); output;
x=r2*cos(2*pi*k/5+pi/2+2*pi/10); y=r2*sin(2*pi*k/5+pi/2+2*pi/10); output;
end;
ods graphics / reset width=5in height=5in noborder; * Make Dad a star!;
proc sgplot noautolegend aspect=1 noborder nowall pad=0;
styleattrs backcolor=navy;
symbolchar name=uniStar char='2605'x; * Unicode value for 5-pointed star;
scatter x=xS y=yS / markerattrs=(symbol=unistar color=White size=24pt); * Plot little unicode stars;
polygon x=x y=y id=id / fill fillattrs=(color=cxd9d9d9) dataskin=crisp; * Plot big polygon star;
text x=xT y=yT text=dad / contributeoffsets=none textattrs=(size=48pt color=navy weight=bold) contributeoffsets=none; * "DAD";
xaxis display=none values=(-6.25 6.25) offsetmin=.01 offsetmax=.01; * Hide axes;
yaxis display=none values=(-5.75 6.75) offsetmin=.01 offsetmax=.01;
run;
... View more
Dear all, I am investigating subjective stress levels during a psychosocial stress test. I ran into problems with a more complex model, and started with simplifying my model to figure out the source of the issues. I am already running into trouble by adding a quadratic term of time. My code is as follows: proc mixed data=MAST_long_VAS; class PPID Time; model BC_stress = Time Time*Time / solution residual influence; repeated Time / subject=PPID type=ar(1); run; This model runs without any problems or warnings, but does not give me the output for the fixed effect of Time*Time (only the fixed effect of Time). I tried removing "Time" from the class statement, but then I get the warning that only class variables are allowed in the repeated statement. Can anyone help me with this? Thanks in advance!
... View more
Hi Everyone,
I am getting below error message when trying to run below code with ENCODING=WLATIN1 from SAS Studio. Can you please suggest on it.
Note : The same code is running fine with ENCODING=UTF-8
DATA T1; var1="aábcčdď"; run;
... View more
Hello, I am interested in taking the SAS Statistical Business Analyst exam. In the FAQs section it states that a base programming certification is required for advanced programming exams. Do I need to take the base exam prior to taking the Statistical Business Analyst exam? Or are there any other prerequisites? Thank you
... View more
When we created the manual AML/CDD alert we debugged the JSON response and did not find enrichment fields, Hence we cannot separate manual alerts
for employees and non-employees (Enrichment field.employee_ind).
... View more