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.
I have an admit date variable (admitdt) that needs to be brought in to define a few month and week variables but these have to be done in a separate step. Is there a way to create a macro in one data step that can be used in several? Do I just do a LET statement The admitdt format is mmddyy10.
... View more
Hi: I am working on a study. It has been planned to do multiple imputation for missing values related to the primary endpoint by an agency's requirements. I have read many materials online and have some ideas. But, I am still not sure. Study information: The study's indication is Epilepsy. Each patient is given a diary and they are supposed to record how many seizures they expeirenced each day during the study period (DB period is ~ 85 days). As you can image, some patients may forget to record their seizures on some days and some patients may discontinue from the study before the Day 85. So there are missing values for seizure counts on some days for some subjects. My questions: 1. Our missing type is considered as 'missing as random' and so this procedure(Proc MI) can be used, correct? 2. Since our missing data is only in one variable, i.e., seizure count, so I think I should NOT use the methods in SAS documentation (Imputation Methods, Table 5) with 'monotone', correct? 3. Since our data is 'seizure count', which should follow poission distribution (correct?), not normal, I should NOT use methods with 'MCMC' since MCMC method is based on the assumption of multivariate normal distribution (MVN) for variables, correct? 4. Then I thought I should use FCS, fcs reg, or fcs regpmm. I read SAS documentation, it has "The predictive mean matching method ensures that imputed values are plausible; it might be more appropriate than the regression method if the normality assumption is violated (Horton and Lipsitz 2001, p. 246)." So I thought I should use 'fcs regpmm'. I also tried 'fcs reg', the imputed values gives non-integer, a number with decimal. It seems it does not fit my case. Our seizure is an count; so it should be an interger. If I use 'fcs regpmm', the imputed values are integers. 5. If using 'fcs regpmm' is correct for my case, what number of 'k' (SAS option with 'fcs regpmm' option) should I pick? Here is the code I use. proc mi data = post nimpute = 25 out = post_mi seed = 54321 noprint; by subjid; var qsdy count;' fcs regpmm (/k = 5); run; Note: 'qsdy' is the study Day variable; it is from Day 1 till Day 85. 'count' is seizure count for each day. There are missings in this variable. Note: since the imputation is by subjid, so covariates such as age, treatment, etc, are not needed (no change for an individual), correct? If any detailed information is needed for this discussion, please ask me. Thanks a lot in advance. Xiaoshu
... View more
Hi all - I have a specific report format that I am trying to achieve using PROC REPORT, and I'm getting pretty close, but there's a column subtotal element that I cannot figure out.
I have sales data, summarized by Client, Quarter, and Week. Each quarter contains an arbitrary number of weeks, up to around 13.
I would like to list Client information down the side, with:
Quarters listed across the top,
each Quarter's corresponding Weeks nested underneath,
the table populated with Sales for each Client-Week,
and Grand Totals on the far right and bottom. I've gotten this far on my own just fine.
Where I'm getting stuck is that I'd also like to show Quarterly subtotal columns, at the end of each Quarter. I have tried different variations of "break after" and the like, but I'm just not getting there.
Does anyone in the community have any suggestions? Below is some sample code that represents the progress I've made so far. I've also attached an image showing what I currently "have" versus what I "want." I greatly appreciate any and all help - cheers!
data one; input client_rank client $9. client_id quarter $ weekending sales; datalines; 1 Apple 12345 Q1 20240106 1000 1 Apple 12345 Q1 20240113 2000 1 Apple 12345 Q1 20240127 5000 1 Apple 12345 Q2 20240413 3000 1 Apple 12345 Q2 20240420 4000 1 Apple 12345 Q2 20240427 2000 2 Microsoft 67890 Q1 20240106 3000 2 Microsoft 67890 Q1 20240113 1000 2 Microsoft 67890 Q1 20240127 2500 2 Microsoft 67890 Q2 20240413 4000 2 Microsoft 67890 Q2 20240420 500 2 Microsoft 67890 Q2 20240427 1500 ; run;
proc report data = one nowd; column client_rank client client_id quarter, weekending, sales ("Total" sales=tot); define client_rank / noprint group; define client / "Client" group; define client_id / "Client ID" group; define quarter / " " across; define weekending / " " across nozero; define sales / "Sales" analysis sum format=comma12.0; define tot / "Sales" analysis sum format=comma12.0;
rbreak after / summarize; compute after; client = "Total"; endcomp; define client_rank / order group; run;
... View more
In this article, we will look at creating custom SAS Viya deployment topologies, realizing your workload placement plan. In doing this we will look at a couple of examples as a way of sharing some configuration specifics of using custom labels and taints.
... View more
Hi, How do I fill color under density curves? Here are my sample data and sgpanel procedure. TIA! /* Sample data */ data mydata; input group $ value; datalines; A 10 A 12 A 13 B 9 B 11 B 14 C 8 C 10 C 11 ; run; /* Creating the panelled density plot */ proc sgpanel data=mydata; panelby group / layout=rowlattice columns=1 novarname; density value; run;
... View more