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.
Hello community,
I am struggling finding the components for a normal distribution function using the parameter class, where should I find for each category the parameters to write my probability function.
My first step was to fit my function to my data like that:
ods graphics on /height=900 width=1600;
ods select DensityPlot;
proc hpfmm data=casuser.ds_11_15 gconv=0 plots=density(bins=90);
class reg_clim_num;
bayes MUPRIORPARMS((0, 2E12 ) (-40000, .) ) ;
model dk_cons =/ dist=normal k=2 /*parms(23000000 ., 34000000 ., 120000000 . )*/;
ods output PostIntervals=PostIntervals;
ods output PostSummaries=PostSummaries;
run;
Then I would like to define the parameters by my category variable reg_clim
ods graphics on /height=900 width=1600;
ods select DensityPlot;
proc hpfmm data=casuser.ds_11_15 gconv=0 plots=density(bins=90);
class reg_clim;
bayes MUPRIORPARMS((0, 2E12 ) (-40000, .) ) ;
model dk_cons = reg_clim/ dist=normal k=2 /*parms(23000000 ., 34000000 ., 120000000 . )*/;
ods output PostIntervals=PostIntervals;
ods output PostSummaries=PostSummaries;
run;
WARNING: Output 'DensityPlot' was not created. Make sure that the output object name, label, or path is spelled correctly. Also,
verify that the appropriate procedure options are used to produce the requested output object. For example, verify that
the NOPRINT option is not used.
I got this warning with no plot distribution and with these outputs
I don't know how to interpret them. The mean has strange values and the reg_clim 15 has missing parameters.
Do you have any advice, thank you 🙂
I will upload my data and my output.
... View more
Hi, I am trying to convert a six-digit number or string to a date with yyyymm format, then create two (or potentially) more new date variables, one is 12 months prior to that date, and another is 24 months prior to that date. Below is the example. Let's say I have a pre-define date in yyyymm format (i.e 202312 for December 2023), I want to 1) convert this 202312 to a date. Since at this time I am not 100% sure if data will flow in from upstream process as a string or a numeric value, I tried to convert to both numeric and character (using input and put function, respectively) 2) create two more new fields. dt12 is 12 months prior to 202312, which would be 202301. dt24 is 24 months prior to 202312, which would be 202201 3) these new fields will be used as a filter in the where statement to extract subset of data within specific time period. I was not able to create dt12 and dt24, any advice or guidance will be greatly appreciated. %let yyyymm_character='202312';
%let yyyymm_numeric=202312;
data test;
dt_numeric = input(&yyyymm_numeric,YYMMNw.);
dt_character = put(&yyyymm_numeric,YYMMNw.);
dt12 = intnx('month',dt_numeric,-12,'e');
dt24 = intnx('month',dt_numeric,-24,'e');
run;
... View more
Hey SAS-C,
Just FYI.
Bart
SAS Packages Framework, version 20240529
Available as usual at: https://github.com/yabwon/SAS_PACKAGES
Changes
aesthetic changes in log when running %generatePackage() macro,
reshaped format of an automatic documentation header,
and little bug fix for automatic documentation generation (in code for excluding files from documentation the IN operator should be used instead IN: ).
Packages
BasePlus, version 1.39.0
Changes:
new parameter DSout= added in %downloadFilesTo() macro,
file SHA256: F*3C3A2050E3FF46E1FC0F936634A66FC3F294A3531EFE0A7DC9CE74F2EF17C687 for this version.
... View more
I have the following data, How I can create the multiple records based on the horizontal data , depening on the time variables. thank you for your help.
Assumptions:
1. if all four time vairables avaialble then need two records with startdate time and stopdate time depending the on the time
Example first and second rows. only difference between first and second row is column D and E have same time
2. when "restarttime" missing consider the "intermediatestopTime as "restarttime"( and vice versa) and create two records.
3. when "intermediatestoptime" and "restartime" missing then create one record for "stopdatetime" and "startdatetime".
data have;
format date date9. starttime time8. intermediatestoptime time8. restarttime time8. finalstoptime time8.;
do i = 1 to 4;
usubjid = "00-01";
date = '01OCT2024'd;
/* Generate different times for each record */
starttime = '12:20:00't + (i-1)*600; /* Increment start time by 10 minutes each iteration */
intermediatestoptime = starttime + 600; /* Intermediate stop time is 10 minutes after start time */
restarttime = intermediatestoptime + 600; /* Restart time is 10 minutes after intermediate stop time */
finalstoptime = restarttime + 600; /* Final stop time is 10 minutes after restart time */
output;
end;
drop i;
run;
data have1;
set have;
if _n_ =2 then restarttime = '12:40:00't;
if _n_ =3 then restarttime = '';
if _n_ =4 then do; restarttime = '';intermediatestoptime='';end;
run;
... View more
Hi, I am new to SAS. I want to create a geo-map displaying frequency of occurrences of something. but it should be able to access countries, states and cities in the map. I tried with geo-hierarchy. But after creating the geo map, it was not drillable to states and cities. Only displaying country info on the map. Help me if you know how to do this. Appreciate your help.
... View more