03-05-2024
PaalNavestad
Pyrite | Level 9
Member since
03-23-2015
- 138 Posts
- 22 Likes Given
- 3 Solutions
- 31 Likes Received
-
Latest posts by PaalNavestad
Subject Views Posted 1669 08-22-2022 02:58 AM 382 08-01-2022 03:05 AM 710 07-28-2022 10:02 AM 744 07-28-2022 08:53 AM 2636 05-20-2022 10:16 AM 2666 05-20-2022 02:20 AM 2726 05-19-2022 04:52 AM 2737 05-19-2022 02:48 AM 2804 05-18-2022 04:57 AM 951 01-13-2022 02:09 AM -
Activity Feed for PaalNavestad
- Got a Like for Re: FedSQL and Passing Dates in Filter. 12-26-2024 02:49 PM
- Posted Re: Cumulative sum, moving average,... with CAS actions only on Developers. 08-22-2022 02:58 AM
- Posted CumulativePeriod aggregation, can't get this to filter properly on SAS Visual Analytics. 08-01-2022 03:05 AM
- Posted Re: Is the SUM function different in VIYA and 9.4 on SAS Programming. 07-28-2022 10:02 AM
- Posted Is the SUM function different in VIYA and 9.4 on SAS Programming. 07-28-2022 08:53 AM
- Liked Re: %include statement in VIYA for Tom. 06-17-2022 07:39 AM
- Liked Re: Outlier method in CAS. The calculation of percentiles did not converge for taiphe. 05-23-2022 01:52 AM
- Liked Re: Outlier method in CAS. The calculation of percentiles did not converge for taiphe. 05-23-2022 01:52 AM
- Liked Re: Outlier method in CAS. The calculation of percentiles did not converge for acordes. 05-23-2022 01:51 AM
- Posted Re: Outlier method in CAS. The calculation of percentiles did not converge on SAS Data Science. 05-20-2022 10:16 AM
- Posted Re: Outlier method in CAS. The calculation of percentiles did not converge on SAS Data Science. 05-20-2022 02:20 AM
- Posted Re: Outlier method in CAS. The calculation of percentiles did not converge on SAS Data Science. 05-19-2022 04:52 AM
- Posted Re: Outlier method in CAS. The calculation of percentiles did not converge on SAS Data Science. 05-19-2022 02:48 AM
- Posted Outlier method in CAS. The calculation of percentiles did not converge on SAS Data Science. 05-18-2022 04:57 AM
- Posted Re: Write missing as '' instead of . in ODS Excel using proc print on SAS Programming. 01-13-2022 02:09 AM
- Posted Re: Write missing as '' instead of . in ODS Excel using proc print on SAS Programming. 01-13-2022 02:08 AM
- Posted Write missing as '' instead of . in ODS Excel using proc print on SAS Programming. 01-13-2022 01:55 AM
- Posted Re: Calculate Median, P10 and P90 in CAS on SAS Programming. 11-24-2021 06:33 AM
- Liked CAS answers to 4 common data manipulation tasks – Part 4 – AGGREGATE for NicolasRobert. 11-24-2021 05:54 AM
- Posted Calculate Median, P10 and P90 in CAS on SAS Programming. 11-24-2021 02:50 AM
-
Posts I Liked
Subject Likes Author Latest Post 4 1 1 1 4 -
My Liked Posts
Subject Likes Posted 1 11-19-2021 04:34 AM 1 09-22-2021 09:11 AM 2 09-07-2021 09:33 AM 6 04-27-2021 03:54 AM 2 03-29-2021 02:10 AM -
My Library Contributions
Subject Likes Author Latest Post 2
06-22-2017
09:05 AM
Thanks a million works like a dream. Easy to forget these nice functions that have been around since forever, Here is the revised code. %let avg_mnth=15;
data WORK.CUM_PROB;
infile datalines dsd truncover;
input Proportion:BEST10.9 hrs_draw:32. cum:32.;
datalines4;
0.51818182,6,0.5181818182
0.05909091,7,0.5772727273
0.21363636,10,0.7909090909
0.20909091,18,1
;;;;
run;
data to_fmt;
set cum_prob;
retain start end;
prev=lag(proportion);
if _n_=1 then do;
start=0;
end=proportion;
SEXCL='N';
end;
else do;
start=end;
end=start+proportion;
sexcl='Y';
end;
label=put(hrs_draw,best.);
type='I';
fmtname='hrsval';
run;
proc format cntlin=to_fmt;
run;
Data events;
prob_by_day=30/&avg_mnth;
do i=0 to 5000 by 1;
date = intnx('day','01jul2017'd,i);
p=rand('POISSON',1/prob_by_day);
if p > 0 then do;
do j=1 to p by 1;
draw=rand('UNIFORM');
hrs=input(draw,hrsval.);
c=1;
output;
end;
end;
else do;
draw =.;
hrs=.;
c=0;
output;
end;
end;
drop j;
format date date9.;
run;
... View more
06-22-2017
07:24 AM
Hi I'm trying to simulate descrete events forward in time and the simulate a different value for each of these events. In real life this is to create a schedule and take in consideration events that have not been detected yet. The inline code works but is a bit hard to make completly robust. E.g. i have hardcoded 4 groups of values, but in real life it might be more or less. This can be done in a macro but might be hard to debug. Another solution is to join in the from to values for the univarite drawing, test if it is between and then dropping the lines where it is not between. Howvwer this will expand the data and can lead to other errors. Does anybody have a more elegent method. I was thinking about reading the proportion, hrs_darw into an array but do not get it to run. I do not have IML avalialable %let avg_mnth=10;
data WORK.CUM_PROB;
infile datalines dsd truncover;
input Proportion:BEST10.9 hrs_draw:32. cum:32.;
datalines4;
0.51818182,6,0.5181818182
0.05909091,7,0.5772727273
0.21363636,10,0.7909090909
0.20909091,18,1
;;;;
run;
data cum_prob;
set cum_prob;
prop_name='prop'||put(_n_,z2.);
hrs_name='hrs'||put(_n_,z2.);
call symput(prop_name,cum);
call symput(hrs_name,hrs_draw);
keep proportion cum hrs_draw ;
run;
%put pr1= &prop01 hrs=&hrs01;
%put pr1= &prop04 hrs=&hrs04;
Data events;
prob_by_day=30/&avg_mnth;
do i=0 to 5000 by 1;
date = intnx('day','01jul2017'd,i);
p=rand('POISSON',1/prob_by_day);
if p > 0 then do;
do j=1 to p by 1;
draw=rand('UNIFORM');
if draw =< &prop01 then hrs=&hrs01;
else if draw =< &prop02 then hrs=&hrs02;
else if draw =< &prop03 then hrs=&hrs03;
else if draw =< &prop04 then hrs= &hrs04;
c=1;
output;
end;
end;
else do;
draw =.;
hrs=.;
c=0;
output;
end;
end;
drop j;
format date date9.;
run;
... View more
06-15-2017
02:06 AM
Thanks Casey, I will look at the metadata setup (but have to get to the adminstartors first)
... View more
06-13-2017
12:36 PM
Thanks, yes I will try that at some point. Wanted to check the effectiveness of the Community as well
... View more
06-13-2017
12:34 PM
Hi Casey thanks, here are my answers: 1. 7.13 HF5 (7.100.3.5486) (64-bit) 2. Release: 3.5 (Enterprise Edition) 3. Yes I can use SAS Studio from the same machine 4. No Overall SAs version is 9.4 M3
... View more
06-13-2017
02:08 AM
Hi Damo, we have the Enteprise Edition. The problem is not running SAS Stduio, but being able to use SAS Studio tasks in EG.
... View more
06-12-2017
01:55 AM
Hi all, I recently learned that you can include SAS Studio Tasks in EG. However in our installation with all SAS installed on a Linux Cluster I do not find the settings to get the SAS Studio Tasks from the Server. Does anybody know how you get the right URL or other methods to use tasks from the server?
... View more
04-07-2017
02:17 AM
Has anybody ever read a .MEM file into SAS?. Any tips and trick would be appreciated.
... View more
01-17-2017
07:56 AM
2 Likes
It sounds as if you have some Character variables that is set to a very long length. Even one or two of this that gets to 32000 and no compression can give a humongous data set.
... View more
12-20-2016
10:53 AM
Yes, tried Sgpanel, but did not understand that uniscale was where you controlled this. SGPanel with standard attributes does what you like in creating uniform axis which is what you want in 95 % of the cases I guess. In this case we looked for how to turn it off but did not understand. Your example helps a lot,
... View more
12-20-2016
10:40 AM
Thanks a lot. Did not understand the uniscale I think.
... View more
12-20-2016
10:33 AM
Thanks, we will try tomorrow
... View more
12-20-2016
05:37 AM
Hi, thanks, Yes we have discussed this. It will work but needs a lot of custom format writing and generally doing a coding in a different way. I really want SAS to provide an option or find a way using SGPanel. I agree that the Grahically Speaking blog is great.
... View more
12-20-2016
05:33 AM
The folowing code produces the nearly the same results but the gradlegend is completly misleading in the first graph. Can somebody please explain and suggest a solution when uing discrete variable to produce the gradlegend? data class;
set sashelp.class;
if weight < 85 then wn=0;
else wn=1;
run;
data weightdisc;
retain id "wdisc";
length min $ 5 max $ 5;
input min $ max $ color $ altcolor $;
datalines;
0 0 Bio Bio
1 1 bro bro
;
run;
ods graphics on/width=800 px height=600 px;
proc sgplot data=class rattrmap=weightdisc;
vbar name/ response=Weight colorresponse=wn rattrid=wdisc ;
run;
data weightrange;
retain id "wrange";
length min $ 5 max $ 5;
input min $ max $ color $ altcolor $;
datalines;
0 85 Bio Bio
85 150 bro bro
;
run;
proc sgplot data=class rattrmap=weightrange;
vbar name/ response=Weight colorresponse=weight rattrid=wrange ;
run; The first result look like this. As can be seen the gradlegend is completly wrong Second option look like this As can be seen the legend is logical. The second option can not be used in all cases where you have a process in determing this. There are solutions to the problem using attribute map instead. However that usually means using a dummy group variable for vbar and cannot be used for scatter plots.
... View more
- « Previous
- Next »