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.
Can you tell me what is wrong with this code?
*OTHER NEUROLOGICAL DISEASES; array xx $ icdx1 icdx2 icdx3; label ond="Oth neurological"; ond=0; do over xx; if xx in: ("B90", "D48", "G04", "G09", "G10", "G11", "G12", "G13", "G24", "G25", "G26", "G32", "G37", "G51", "G52", "G53", "G70", "G71", "G72", "G73", "G80", "G81", "G82", "G83", "G90", "G91", "G93", "G95", "G99", "M47", "Q00", "Q01", "Q02", "Q03", "Q04", "Q05", "Q06", "Q07", "Q76") then ond = 1; *Doing exclusions in this way does not work; if xx in: ("G130", "G131", "G251", "G254", "G256", "G510", "G732", "G733", "G734", "G838") then ond=0; end;
The first part works fine. But then when I add in the line of code under *Doing exclusions in this way does not work; I get the following error messages:
*Doing the exclusions in this way does not work; 509 if xx in: ("G130", "G131", "G251", "G254", "G256", "G510", "G732", _ 22 202 509 ! "G733", "G734", "G838") then ond=0; ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, iterator, (.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
510 end;
Please help! Thanks!
... View more
I have generated person-time at risk for my population. The %lexis macro has given me the person-years at risk for each of the age categories. (not going to post the whole macro here. it is available below: Author: Bendix Carstensen, 1999-2002
Update: Paul Dickman, BxC, November 2003
Bug-fix: BxC, December 2007:
If the origin= argument had missing values erroneous output would
be generated (too much risk time). Now remedied so that
observations with missing values of origin are excluded.
This macro is in: http://www.biostat.ku.dk/~bxc/Lexis/Lexis.sas
Example program: http://www.biostat.ku.dk/~bxc/Lexis/xLexis.sas data lexis_out2; ENTERED EXITED AGE_BAND AGE_ENTRY_OLD RISK 15-Sep-76 16-Aug-80 35-40 36.08196721 3.917864 16-Aug-80 16-Aug-85 40-45 40 5 16-Aug-85 16-Aug-90 45-50 44.99896699 5 16-Aug-90 22-Dec-92 50-55 49.99896699 2.350445 However, I want the person-years at risk for each year the individual is in the study. For this individual, it is 1976-1992. Here is an example of the desired output: YEAR AGE_BAND RISK 1976 35-40 0.4 1977 35-40 1 1978 35-40 1 1979 35-40 1 1980 35-40 0.67 1980 40-45 0.33 1981 40-45 1 1982 40-45 1 1983 40-45 1 1984 40-45 1 1985 40-45 0.67 1985 45-50 0.23 1986 45-50 1 1987 45-50 1 1988 45-50 1 1989 45-50 1 1990 45-50 0.67 1990 50-55 0.23 1991 50-55 1 1992 50-55 0.98 Below is additional coding for the %lexis macro - /*the LEXIS macro written by Bendix Carstensen for splitting person-time*/
%Lexis(
data=trypt,
out=work.lexis_out,
entry=entered,
exit=exited,
fail=status,
origin=born,
left=age_from,
right=age_to,
scale=365.25,
breaks=%str(17,20,25,30,35,40,45,50,55,60,65,70,75,80,85,9999)
);
data lexis_out2;
attrib
id label="ID"
born label="Born" format=date7.
entered label="Entered" format=date7.
exited label="Exited" format=date7.
age_band label="Age-at-risk band" format=$5.
age_entry label="Age-at-entry"
age_exit label="Age-at-exit"
time_entry label="Time at entry"
time_exit label="Time at exit"
fu_yrs label="Follow-up length (years)"
status label="Death";*/;
set lexis_out;
rename age_entry=age_entry_old risk=fu_yrs;
drop age_exit fu_years lrisk;
time_entry = yrdif(born,entered,'act/act') - age_entry_old;
time_exit = time_entry + fu_yrs;
age_entry = yrdif(born,entered,'act/act');
age_exit = yrdif(born,exited,'act/act');
age_band = put(age_from, 2.0)||'-'||put(age_to-0.1, 2.0);
drop age_entry_old age_from age_to;
run;
... View more
when use proc logistic procedure to set up default model in bank risk analysis, for the current customer, there are 4 kinds of results after application for the loan, accept, refuse , cancel or nouse. when set up model, to analysis if new customer will default or could approve their application of loan, we will use the current customer loan history. refused=1, accept=0 but how to deal with cancel and nouse, i think nouse looked as accepted, but for cancel, how to deal with it?
... View more
A new update is available for SAS Environment Manager , version 2.5_M4 : Hot Fix: J9V015 - Published 20MAY2024 , Download link for J9V015 Component name: SAS Environment Manager Related SAS release: 9.4 Issues addressed in J9V015 This list of notes might be incomplete. For a complete list of issues addressed by this hot fix, visit the hot fix page for J9V015 Note: A comprehensive list of all SAS hot fixes is available from support.sas.com. You can use the SAS Hot Fix Analysis, Download, and Deployment (SASHFADD) tool to manage your SAS hot fixes.
... View more
hello. I am a SAS beginner. I have an experimental group, and I need to build a control group. A control group must be created by matching control group subjects 1:1 based on two variables: age and sex of the experimental group. Matching should be done using only those two variables, not the propensity score. Should I use proc psmatch or inner join? I would appreciate it if you could provide detailed code.
... View more