Creating an AI Assistant for SAS Viya in 5 steps (@sassoftware/viya-assistantjs) - Part I
Recent Library Articles
Recently in the SAS Community Library: SAS' @kumardeva debunks the myth that developing AI assistants is too hard. He shows you how to use the @sassoftware/viya-assistantjs library to jump start your development.
Hello,
I used the codes at below to estimate the propensity score and logistic regression for inverse probability weighting.
How can I test the balance of the standardised mean differences before and after adjustment?
How to obtain the synthetic n values derived from weights?
Thanks
/***CREATING PROPENSITY SCORES********/
proc sort data=tab_imput; by _imputation_;run;
proc logistic data=tab_imput desc;
class var1 var2 var3 var4 var5 var6 var7 var8 var9 ;
model mut= var var1 var2 var3 var4 var5 var6 var7 var8 var9/link=logit rsquare ;
output out=denom p=d;
by _imputation_;
run;
proc logistic data=tab_imput desc;
model mut=;
output out=num p=n;
by _imputation_;
run;
proc sort data=tab_imput ;
by anonymat;run;
proc sort data=denom;
by anonymat;run;
proc sort data=num;
by anonymat;run;
data tab_imput_pscore;
merge tab_imput denom num;
by anonymat;
if mut=1 then uw=1/d; else if mut=0 then uw=1/(1-d);
if mut=1 then sw=n/d; else if mut=0 then sw=(1-n)/(1-d);
run;
proc sort data=tab_imput_pscore; by _imputation_;run;
/***PROPENSITY SCORE WEIGHTED OUTCOME MODEL****/
ods graphics on;
proc logistic data=tab_imput_pscore desc;
class mut(ref='no') / param=reference ;
model vif (event='no') = mut/ rsquare clodds=wald lackfit ;
weight sw ;
by _imputation_;
oddsratio mut;
ods output parameterEstimates = ipw_mut ;
run;
ods graphics off;
proc mianalyze parms=ipw_mut ;
modeleffects mut;
ods output parameterEstimates = ipw_mut1;
run;
data ipw_mut2; set ipw_mut1;
OR_est=EXP(ESTIMATE);
LCI_OR=OR_est*EXP(-1.96*STDERR);
UCI_OR=OR_est*EXP(+1.96*STDERR);
run;
proc print data=ipw_mut2;
var Parm OR_est LCI_OR UCI_OR Probt ;
run;
... View more
Dear SAS Community,
When I opened the project, I saw this problem, Maybe who found this problem, could you help me, I can't find a backup file.
... View more
Hi, I am trying to achieve a specific sort order using custom sort for the variables Names and Codes. I have a sample variable with this order below: Names Codes Boys 2795 2796 2900 PHA Total Girls 2795 2796 2900 PHA Total Dads 2795 2796 2900 PHA Total Moms 2795 2796 2900 PHA Total This is the order I wanted Names Codes Dads PHA 2795 2796 2900 Total Moms PHA 2795 2796 2900 Total Boys PHA 2795 2796 2900 Total Girls PHA 2795 2796 2900 Total
... View more
Hello SAS Community, Our team recently transitioned from Base SAS 9.4 to SAS Studio using Viya 4. We're encountering some challenges adapting our existing program that converts .dat files into SAS datasets for further analysis. These .dat files, received quarterly from IT, act as snapshots of our database on specific dates. We use them to generate numerous datasets used across various departments. Previously, in Base SAS 9.4, we successfully used the following code %let tm = sp124; /*update term*/ filename extract "X:\ircensus\scf extracts from ISC\&tm\_syra600ro_cron_gr.dat"; data bgx&tm; attrib bstuid informat=$char9. /* spriden_id */ SEXAPPL informat=$char1. /* spbpers_sex */ ethnic informat=$char33. /* combination of spbpers_ethn_cde & gorprac_race_cde */ byrtmapp informat=$char6. /* saradap_term_code_entry */ bapplnum informat=$char2. /* saradap_appl_num */ RELCODE1 informat=$char2. /* spbpers_lgcy_code=Y */ bhonors informat=$char4. /* saraatt_atts_code=HNRE */ natnbirth informat= $char3. /* sabsupl_natn_code_birth */ firstgen informat =$char1. /* first gen from ug admissions */ . . . . ; infile extract length=linelen delimiter='^' lrecl=1000 ls=1200 firstobs=2 missover; format bstupidm 8. JUNORGPA 5.2 satverb satmath satm satr 3. bbirthdt bdtaprec bdtapent bstactdt badactdt date9. ; input bstuid SEXAPPL ethnic byrtmapp bapplnum. . . . . . ; label bstuid = 'spriden_id' bstutype = 'saradap_styp_code' SEXAPPL = 'spbpers_sex' ethnic = 'spbpers_ethn_cde=NH,2=H,gorprac_race_cde=W,2=B,3=H,4=A,5=N,6=U' satm = 'sortest_test_score, sortest_tesc_code=SATM, SAT Math 2016' satr = 'sortest_test_score, sortest_tesc_code=SATR, SAT Reading 2016' . . . ; run; We'd greatly appreciate any guidance on replicating this functionality or converting the code for use within SAS Studio. Any insights or suggestions would be immensely helpful! Best Regards, Bhaskar
... View more
I get the error: ERROR: The SAS/ACCESS Interface to ORACLE cannot be loaded. ERROR: Image SASORA found but not loadable.. Please make sure Oracle environment is set correctly. Look in the install/Config doc for additional info for your platform. Works fine interactively, but no longer when submitted as a batch file. Worked fine this morning (and for years), but then installed MS Visual Studio and Python. That seems to have changed some path variable SAS version 9.4 TS 1M6, Windows 10 Enterprise In interactive mode (where it continues to work): %sysget(TNS_ADMIN) returns the correct network location. ORACLE_HOME, LD_LIBRARY_PATH not defined as system variables. I've uninstalled Python, MS Visual Studio, and reinstalled SAS. Same errors. First time posting here. Looked at related posts, but couldn't figure it out. Much appreciate any help.
... View more