Creating an AI Assistant for SAS Viya in 5 steps (@sassoftware/viya-assistantjs) - Part I
Recent Library Articles
Recently in the SAS Community Library: SAS' @kumardeva debunks the myth that developing AI assistants is too hard. He shows you how to use the @sassoftware/viya-assistantjs library to jump start your development.
Hello, I have a variable in my dataset. The categories for this variable are alphanumeric and in character format. For example, they are: A00 to A99, B60 to B89, and so on. Now, I want to list some of them in my SAS syntax: Data want;
set have;
If myvariable in A20 to A45 then myfavourite = 1;
else myfavourite = 0;
run;
Any help would be much appreciated. Thanks.
... View more
Hi, I am running the following macro %macro geomeans (data=, outcome=);
%let total_vars = %sysfunc (countw (&outcome) );
%do i = 1 %to &total_vars;
%let selected_var=%scan (&outcome, &i);
ods output estimates=geomeans&i;
proc genmod data=&data;
class brinda15 / param = glm;
model &outcome = brinda15 / type3 dist=normal ;
estimate "Overall estimate &outcome brinda15 =0" intercept 1 brinda15 1 0 /exp;
estimate "Overall estimate &outcome brinda15 =1 " intercept 1 brinda15 0 1 /exp;
run;
ods output close; I call the macro with the following code: %geomeans (data=db, outcome=var1 var2 var3) It works only for the first variable (it doesn't matter which one it is), but for the other variables I the error message below In case it matters, my outcomes are continuous and ln transformed. Any tips of how to fix this are welcome! Thank you
... View more
Hi,
If I have a program like this that runs every month.
DATA HAVE;
INPUT CATEGORY$ TYPE MONTH ;
CARDS;
A 100 1
B 200 2
B 100 3
B 200 1
A 100 2
A 200 1
B 200 1
A 100 1
A 200 2
A 200 3
A 100 5
A 200 9
B 200 10
A 100 1
A 200 11
A 200 11
;
RUN;
PROC SQL;
CREATE TABLE INVENTORY AS
SELECT CATEGORY,
TYPE,
COUNT (CASE WHEN MONTH = 1 THEN TYPE END) AS JANUARY,
COUNT (CASE WHEN MONTH = 2 THEN TYPE END) AS FEBRUARY,
COUNT (CASE WHEN MONTH = 3 THEN TYPE END) AS MARCH,
COUNT (CASE WHEN MONTH = 4 THEN TYPE END) AS APRIL,
COUNT (CASE WHEN MONTH = 5 THEN TYPE END) AS MAY,
COUNT (CASE WHEN MONTH = 6 THEN TYPE END) AS JUNE,
COUNT (CASE WHEN MONTH = 7 THEN TYPE END) AS JULY,
COUNT (CASE WHEN MONTH = 8 THEN TYPE END) AS AUGUST,
COUNT (CASE WHEN MONTH = 9 THEN TYPE END) AS SEPTEMBER,
COUNT (CASE WHEN MONTH = 10 THEN TYPE END) AS OCTOBER,
COUNT (CASE WHEN MONTH = 11 THEN TYPE END) AS NOVEMBER,
COUNT (CASE WHEN MONTH = 12 THEN TYPE END) AS DECEMBER
FROM HAVE
GROUP BY CATEGORY, TYPE;
RUN;
But I don't want months without data to appear in the report. I want to get this:
How should I proceed ?
... View more
is it possible to output predicted individual-level slopes from proc mixed? Here is my current code. Thanks!
proc mixed data=all covtest cl;
class ptID;
model value=visitYr / s residual outp=pred;
random int visitYr / type=un subject=ptID g gcorr v;
ods output CovParms=covout solutionr=slopes;;
run;
... View more
I have not been on this site for a bit. I was visiting today and have a few questions: 1. I have a friend who is new to sas programming but he is not getting challenged at his sas job. He asked me today for advice on how gain better programming experiences. He's a statistical programmer and has aspiration to be a biostatistical programmer eventually. He works for a Contract Research Organization (CRO). Initially, I thought SAS had programming challenges but I couldn't find them. I think I personally attended one once during a sas forum a few years ago. Does SAS have plans for quarterly programming challenges for the community? 2. Also, He wanted to search the SAS papers for programming tips but I couldn't find a place with everything. Also, I need to find any papers related to Digital Twins. Any help for these two questions? Thanks in advance.
... View more