A Human Generated Introduction to Generative AI, Part 1: Synthetic Data Generation
Recent Library Articles
Recently in the SAS Community Library: In the first of two posts on applications of generative AI, SAS' @JThompson reveals the role of generating synthetic data.
I am to simple calculate ema of a variable within dataset with a ByGroup. In addition, a simple twist is applied[averaged-back-n-values to smooth out further].
The full code is below. Somehow the lag values always has issue. Anyone can help?!
data _temp;
do grp=1 to 4;
do i=1 to 100;
x=sin(i/10.0); output;
end;
end;
run;quit;
%macro ema_fs_by(ds, var, byvar, long, avgback);
%let alpha1=(2.0/(&long.+1));
data temp;
do i=1 to &avgback.;
lagline_long="lag"||COMPRESS(put(i,$4.))||"(&var._fs&avgback._long)";
output;
end;
run;quit;
proc sql noprint;
select lagline_long into: avgbackline_long separated by ","
from temp where i<=&avgback.;
quit;
%put "avgbackline=&avgbackline_long.";
data &ds.;
set &ds.(where=(missing(&var.)=0));
by &byvar.;
retain _ind_ &var._fs&avgback._long ;
if first.&byvar. then do;
_ind_=1; &var._fs&avgback._long= &var.;
end;
else _ind_=_ind_+1;
if _ind_<=&avgback. then do;
&var._fs&avgback._long= &var.;
end;
else do;
&var._fs&avgback._long= (&alpha1.)*&var.+(1-&alpha1.)* (mean(&avgbackline_long.));
end;
run;quit;
%mend;
%let avgback=2;
%ema_fs_by(_temp, x, grp, 0.1,&avgback.);
title "ema_fs_x outcome";
ods layout gridded columns=2 rows=2 advance=table;
ods graphics /width=480px height=300px;
proc sgplot data=_temp;
by grp;
series x=_ind_ y=x/ lineattrs=( color=blue thickness=2 pattern=solid);
series x=_ind_ y=x_fs&avgback._long/ y2axis lineattrs=( color=red thickness=2 pattern=solid);
run;quit;
ods layout end;
... View more
I am trying to connect to work SAS server from R, to extract datasets for further processing/analysis in R. Due to corporate constraints, the only solution available is SAS JDBC type of connection, using IOM server subprotocol. I have been trying to make this work with our IT and SAS support on and off for months now. I had them install the SAS JDBC drivers on my machine, and via trial and error arrived at the below piece of R code to establish the connection: r library(RJDBC)
library(rJava)
.jinit()
driver <- JDBC(driverClass = "com.sas.rio.MVADriver")
conn <- dbConnect(
driver,
"jdbc:sasiom://xxx.xxx.xxx:12345",
"user",
"pwd"
)
running the above code I am able to create the driver object running JDBC() function, however, dbConnect throws the below exception: r Error in dbConnect(driver, "jdbc:sasiom://xxx.xxx.xxx:12345", :
Unable to connect JDBC to jdbc:sasiom://xxx.xxx.xxx:12345
JDBC ERROR: com/sas/util/ChainedExceptionInterface Interestingly, using the dbConnect function with a modified connection string, r conn <- dbConnect(
driver,
"jdbc:sasiom://xxx.xxx.xxx:12345?user=user&password=pwd"
)
gives a different error: r Error in dbConnect(driver, "jdbc:sasiom://xxx") :
Unable to connect JDBC to jdbc:sasiom://xxx
JDBC ERROR: com/sas/util/RBBase Unfortunately neither of the error messages don't give too much to work with. We have tried experimenting with different Java versions, and I have tripple checked that all required JAR files are accessible via CLASSPATH. I have extensively researched the internet and asked LLMs to no avail, and so now my last hope is the community hivemind power.. java version "1.8.0_60" SAS version 9.4 Grid M8 JDBC drivers 9.4
... View more
SAS Customer Intelligence 360 (CI 360) allows marketers to define target segments based on varied selection criteria. For example, if they are part of a specific age group, household or hold a certain type of bank account. Contact and response events record interactions at the primary subject level (typically Customer). So, if another subject level (e.g. household or account level) was used to define the segment, then this information won’t automatically be available to downstream tasks.
Adding the context (that is, which information made this customer eligible for this offer) makes it possible to better understand how or why a customer was targeted. That information can then be used in campaign performance analysis and contact policy rules.
... View more
Hi, I am trying to calculate the Hosmer-Lemeshow p-value using proc logistic with lackfit option but the expected proportion given by SAS are not mine. How to put the expected proportion in the model? Please find my code: proc logistic data=noduleData; model GT_finding(event='1')= report_score/ lackfit (DF=8 NGROUPS=13034 321 338 77 80 151 109 86 73 36 ) ; run; Thank you
... View more
Hello
I run code that create data sets in following order.
Why the data sets appear in different order then order they were created?
%let h1=2508; /**YYMM structure**/
%let h2=2507;
%let h3=2506;
%let h4=2505;
%let h5=2504;
%let h6=2503;
%macro Help_Macro_a;
%do j=2 %to 6;
proc sql;
create table _L_CS_&&h&j. as
select b.lakoach_y as lakoach_Y&h1.,a.*
from L_CS_&&h&j.(Rename=(lakoach_y=lakoach_y_&&h&j.)) as a
inner join L_CS_&h1. as b
on a.lakoach=b.lakoach
;
quit;
%end;
%mend Help_Macro_a;
%Help_Macro_a
... View more
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!