I am attempting to extract topics from a collection of customer comments. I would like to be able to parse common phrases. I read the documentation for the multi term parameters within the parse statement. However I am not getting it to work. How can I pass the phrases"I don't know", "improve training" or "everything is fine"?
... View more
I have long data and wrote code to track changes in 2 variables over time. However, the second entry for each userID is wrong. My data, code, and screenshot of results below. What is wrong with the code?
data fake_data;
input userID $ event_date date9. response $ code $;
format event_date date9.;
datalines;
1693 01Dec2014 Y V
1693 01Jan2015 Y V
1693 01Feb2015 Y V
1693 01Mar2015 M G
1693 01Apr2015 M G
1693 01May2015 M G
1129 01Feb2018 Y V
1129 01Mar2018 Y V
1129 01Apr2018 N R
1129 01May2018 N R
1129 01Jun2018 M R
1129 01Jul2018 M R
1345 01Aug2016 N R
1345 01Sep2016 N R
1345 01Oct2016 N R
1345 01Nov2016 N R
1345 01Dec2016 M R
1345 01Jan2017 M G
1345 01Feb2017 Y G
1345 01Mar2017 Y G
1345 01Apr2017 Y G
1345 01May2017 Y G
;
proc sort data = fake_data out=fake_data_nodupkey nodupkey; by userID event_date; run;
data flag_vars;
set fake_data_nodupkey;
by userID event_date;
if first.userID then do;
prev_response = response;
prev_code = code;
end;
else do;
prev_response = lag(response);
prev_code = lag(code);
end;
response_change = 0;
if response ne prev_response then response_change = 1;
code_change = 0;
if code ne prev_code then code_change = 1;
run;
proc print data=flag_vars;
run;
... View more
I have an interesting challenge with TEMPLATE. I am trying to create a lattice where each plot within the lattice is a panel of graphs. For a single panel of graphs, I can easily do this with SGPANEL, but I need to make a single figure with several different panels. The following TEMPLATE code works just fine to create a 1x4 panel of graphs (instead of using SGPANEL):
proc template;
define statgraph test12;
begingraph;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=y / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
endgraph;
end;
run;
I would like to wrap the equivalent of a "LAYOUT LATTICE" around this to have several rows, where each row is a panel of four (or whatever) graphs (with a different response variable for each row). I realize that LAYOUT LATTICE does not allow for DATAPANEL, so I am looking for a workaround. For instance, I would like to use something like:
proc template;
define statgraph test12;
begingraph;
layout lattice / columns=1 rows=3;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg limitlower=lclmarg ;
seriesplot x=year y=p / lineattrs=graphFit ;
scatterplot x=year y=y / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
layout datapanel classvars=(type _trt) / rows=1 columns=4;
layout prototype;
bandplot x=year limitupper=uclmarg2 limitlower=lclmarg2 ;
seriesplot x=year y=p2 / lineattrs=graphFit ;
scatterplot x=year y=y2 / markerattrs=(size=8px color=blue symbol=circlefilled) ;
endlayout;
endlayout;
....
endlayout;
endgraph;
end;
run;
Any recommendations on how to do this? Thanks.
LVM
... View more
Fala pessoal, tudo bem? Será que alguém poderia me ajudar ou me ensinar de como fazer, pois estou já há algumas horas nesse código. Estou usando o SAS Viya V.03.05. Eu tenho esse código que já conseguir meio que andar com ele: /* Realizar o Download do Arquivo GeoJSON do Github */
filename mapa temp;
proc http
url="https://raw.githubusercontent.com/tbrugz/geodata-br/master/geojson/geojs-32-mun.json"
method="GET"
out=mapa;
run;
/* Ler o Arquivo GeoJSON usando a Biblioteca JSON */
libname jsonlib json fileref=mapa;
/* Examinar a Estrutura do GeoJSON */
proc contents data=jsonlib._all_;
run; Até aqui, vai bem. O código cria as tabelas do GeoJSON separadas, porém, eu não faço ideia de como linkar isso em um mapa Polígono.. Eu também gostaria de uma ajuda para colocar isso no VA, qual tabela e o passo a passo de como eu poderia fazer.. Se possível é claro. https://prnt.sc/e2I_ecsENtu_
... View more
I have a setting file, the top two lines are below(it have 10+ lines).
Need to update the sinx_index value with a macro variable from SAS run.
How to do it?! Any convenient way, thanks,
[global]
sinx_index=100
... View more