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.
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
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,
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