Kick-start Your Data Exploration Journey with SAS Information Catalog
Recent Library Articles
Recently in the SAS Community Library: @smanoj introduces you to the SAS Information Catalog, which provides a powerful search engine to find needed data assets.
Hello, With this syntax: proc sgplot data=plot ;
vbox value / category=DV group=genre ;
run; SGPLOT produces a VBOX with different colors for the two groups defined in GROUP= See graphs below. Instead, I would like the two levels of groups (liteary and popular) to have different patterns (for instance, small dots for one and small x for the other). I have been looking into various options with ATTRMAP, but I do not seem to be able to get it. Suggestions?
... View more
I have data which has already been aggregated like this:
Category
Groups
People
A
23
235
B
45
754
C
12
89
And I want something like this (prefer Proc Report for the bells and whistles)
Category
Groups
Groups Percent
People
People Percent
A
23
28.8%
235
21.8%
B
45
56.3%
754
69.9%
C
12
15.0%
89
8.3%
Total
80
100.0%
1078
100.0%
All the examples I can find online seem to use dis-aggregated data.
... View more
Dear All, I am writing a custom objective function in the PROC IML environment where I want to estimate 56 parameters. Of these, I have 51 are week fixed effects and the rest 5 are parameters of interest. I want to conduct the estimation on a dataset with 4,037,641 rows. The code below works but takes very long; no output in over 16 hours. However, for a sub-sample of 23,809 rows, the code executes in 4:45.73 real-time and 1:38.68 CPU time. I would like your suggestions on ways to optimize this code. Thank you in advance. Best, Rakesh proc iml;
/************************/
/*Read relevant variables from the data into a matrix X*/
varNames = {"seq" "position" "usage_upto" "lag_mean_usage_after_p" "credits_left" "sl_fixed_effect" "pos_fixed_effect" "max_pos" "wk" "choice_p" "chosen" "week_fe_scroll"};
use scroll;
read all var varNames into x;
close scroll;
/************************/
b = uniqueby(x[,1],1)`; /*starting points in each session*/
u = unique(x[,1]);
b = b ||(nrow(x[,1])+1); /* trick: append (n+1) to end of b for taking care of the last session*/
param = {3.354 -0.097 -2.538 0.146 0.002 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0}; /*set initial parameter values for models with CHOSEN VARIABLE*/
start LogLik(param) global(x,b);
s = j(1, ncol(b)-1,.); /*Create an empty matrix to store probability of each session*/
do i = 1 to ncol(b)-1;
idx = b[1,i]:(b[1,i+1]-1);
/*Extract unique session Ids in vector u*/
pos = x[idx,2]`;
sess_usage_upto = x[idx,3]`;
lag_use = x[idx,4]`;
sess_credits = max(x[idx,5]`);
sl_fe_scroll = max(x[idx,6]`);
sl_pos_scroll = max(x[idx,7]`);
max_pos = max(max(x[idx,8]`),3);
wk = max(x[idx,9]`);
choice_p = x[idx,10]`;
chosen = x[idx,11]`;
wk_fe_scroll = x[idx,12]`;
/************************/
/*Create a vector for transaction probability at all positions. Create the probability of observing the choice at each position (choice_mult)*/
choice_mult = (choice_p##chosen) # ((1-choice_p)##(1-chosen));
/************************/
/*Create a vector for probability of scrolling further at all positions
The seller always scrolls further from the first two positions*/
if wk = 52 then k = 0; else do; z = wk + 5; k = param[z]; end;
sc = logistic(param[1] + param[2]*pos + param[3]*(sess_usage_upto/pos) + param[4]*lag_use + param[5]*sess_credits + k);
sc[1,1] = 1; sc[1,2] = 1;
choice_mult_sc = choice_mult # sc; /*multiply choice prob and scrolling prob at each position*/
/************************/
/************************/
/*Create a vector for probability of ending at all positions greater then the maximum position
Up to the maximum position, the probability of ending is 0*/
ed = 1 - sc;
ed[1, 1:max_pos-1] = 0;
choice_mult_ed = choice_mult # ed; /*multiply choice prob and scrolling prob at each position*/
/************************/
/************************/
/*Compute the probability of a sample path for all possible end points in a session. Store each probability in a vector called LL*/
lag_prod_sc = lag(cuprod(choice_mult_sc))`;
lag_prod_sc[1,1] = 1;
LL = lag_prod_sc # choice_mult_ed;
if LL < 1/(2**500) then LL = 1/(2**500);
/************************/
s[i] = log(10*sum(LL)); /*Probability of aN OBSERVED session is the sum of all sample paths */
end;
return sum(s);
finish;
/************************/
/*Maximize sum(s)*/
optn = {1, /* 3. find max of function, and */ 2}; /* print moderate amount of output */
con = {. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .};
call nlpnra(rc, xres, "LogLik", param, optn, con);
/************************/
quit;
... View more
Hi, over the weekend we did some OS security updates where our Viya install resides (linux environment). After patching was complete, the services did not fully restart. Basic troubleshooting of bringing the services down and back up led to a majority of them being "down" or "not ready", so we rolled back to a VSphere snapshot taken about 16~ hours before (prior to any changes taking place). Reviewing logs, found some certificate errors. 2024-06-16 20:48:49.144 ERROR 16999 --- [ main] c.s.c.rest.boot.vault.CertificateUtil : service [VAULT_CERTIFICATE_REQUEST_ERROR] Vault PKI back end failed to issue certificate. 2024-06-16 20:47:29.064 INFO 16999 --- [ main] c.s.c.rest.boot.vault.CertificateUtil : service [VAULT_CERTIFICATE_REQUEST] Requesting SSL certificate from Vault PKI back end for: cawina06.cyphersystems.com 2024-06-16 20:47:29.079 WARN 16999 --- [ main] c.s.c.rest.boot.vault.CertificateUtil : service Encountered exception issuing certificate from Vault. org.springframework.vault.VaultException: Status 400: cannot satisfy request, as TTL is beyond the expiration of the CA certificate We are considering running the playbook renew-security-artifacts.yml but we are unsure of what the side effects of this would be and if we could make matters worse doing so. -Eric
... View more
I am using the SAS elarning courses in my institution course, and assigning as homework the Virtual lab-based demos and/or activities. I want the students to be able to save their final product work of an activity/demo and upload it in the dropbox of the brightspace D2L LMS.
Are there options that enable the user to do so? if so, what is the best/easiest option? Thanks.
Kaddour
... View more