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.
Suppose I sample 30 widgets from a manufacturing line over the course of a 24 hour day. The sampling times are not necessarily random or evenly distributed. Each widget is inspected and either passes or fails. So I have data like:
data have ;
input time time5. fail ;
format time time5. ;
cards ;
00:45 0
01:00 1
02:45 0
03:15 1
03:45 1
05:30 1
05:45 0
06:00 1
06:30 0
06:45 1
07:00 0
09:00 1
10:15 1
12:30 1
14:00 0
16:00 0
17:15 0
17:30 0
17:45 0
19:00 0
20:45 0
21:30 0
21:45 0
22:00 0
22:15 0
22:30 0
22:45 0
23:00 0
23:15 0
23:30 0
;
run ;
If I plot the data I get:
And looking at the plot, I see two clusters. There was a high failure rate between 0:00 and 12:30, and after 14:00 the failure rate was zero. Of course usually the pattern isn't as clear. I could have data like:
At first it looks like there may be three clusters, with a low failure rate clusters between 10:00 and 16:00. But then when you think about it there are only four data points in that period. If the failure rate was constant during the day (.3), it would not be unusual to have four consecutive successes (.7**4=.24). So maybe the correct interpretation is that there are no clusters in that data. Or maybe there are two clusters: 00:00-09:30 with a high failure rate and 10:00-24:00 with a lower failure rate.
I think what I'm looking for is a way to group the data into clusters (by time) where consecutive clusters have a failure rate significantly different than the failure rate of neighboring clusters.
Or maybe another thing I might want is to identify any clusters (by time) where I can conclude that the failure rate is, say, <.1 (with 95% confidence).
Would appreciate any thoughts/suggestions. I realize this is not a well-framed question. I feel like I want some sort of cluster analysis? ChatGPT recommended looking into "temporal scan" methods which apparently create different time window sizes and then compare them. But I didn't find much on that approach that seemed helpful.
... View more
Hi , I have SAS jobs in SAS EG. For each job, I would like to have related output tables (after Table Loader Step). E.g. I have a JOB_A with two output (TABLE_A & TABLE_B) I would like to have something like: JOB_A | TABLE_A JOB_A | TABLE_B I don't know how to perform this with SAS code? Can you help with this? 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 Everyone,
Can you please help me to achieve output without any decimal, I have many data , so mainly I need output without decimal.
Input :
17.921
7.83
379.48
1.040.855
0
1.09
237.703
1.11
4.387
Output
17921
783
37948
1040855
0
109
237703
111
4387
... View more
Hello, I want to create just Xbar chart for LOS(hours) quartely with 8 subgroups using SAS.,
I used XSCHART , it will give me both both X-bar and S charts together. Same for XR chart.
but I only want to have X-bar chart.
I also cannot use only xchart in my SAS code as xchart is used for individual data not for subgroup data.
How can I adjust my SAS code to see only the X-bar chart in my output?
proc shewhart data=MIS; xSchart LOS*AdmitYYQ / Markers outtable=outtable ; run;
Attached is the output to see both are in the same frame.
Thanks
... View more