I'm trying to strip some operators from a string, leaving behind variable names. I'm using the following code which doesn't work. Is there some quoting needed?
%let expression = vara / (varb + varc);
%macro stripsym(string);
%sysfunc(translate(&string,,+-*/()));
%mend stripsym;
%put Output: %stripsym(&expression);
%put Desired: vara varb varc;
... View more
Hi, How do I fill color under density curves? Here are my sample data and sgpanel procedure. TIA! /* Sample data */ data mydata; input group $ value; datalines; A 10 A 12 A 13 B 9 B 11 B 14 C 8 C 10 C 11 ; run; /* Creating the panelled density plot */ proc sgpanel data=mydata; panelby group / layout=rowlattice columns=1 novarname; density value; run;
... View more
Hi all - ¿How can I connect files from a web server to sas viya? I want to automatically capture the log files in .gz, and then process them (ex: domain.com-2024-04-11.gz).
... View more
Anyone can help with following question? Thanks. In the logistic regression model, b1 is the coefficient of natural log transformed variable x, it is not the coefficient of original scale of x. logit (p/(1-p)) = b0+ b1 In (x) If b1=0.1, What is the OR for one unit increase in the natural log of x (e^0.1)? What is the OR for one unit increase in original scale of X? What is the OR for 5-unit increase in natural log of x ( ? What is the OR for 5-unit increase in X?
... View more
I'm making a pChart using PROC SHEWHART, and my subgroups (lots) have varying sizes. I want to give each lot the same weight when calculating pbar, rather than let lots with larger sample sizes have more weight.
I assumed PROC SHEWHART would have a WEIGHT statement, but it does not. My next thought is to calculate pbar myself, and then pass the value to SHEWHART via the p0 option on the pchart statement. Does this seem like a reasonable approach?
As an example, given data like:
data have ;
input lot pfailed ntested ;
cards ;
1 .1 20
2 .2 20
3 .1 20
4 .2 20
5 .4 60
;
PROC SHEWHART will calculate pbar as a weighted mean of the proportions, giving lot 5 more weight than the other lots, and you get pbar=.26.
proc shewhart data=have ;
pchart pfailed*lot/subgroupn=ntested dataunit=proportion;
run ;
My thought is to calculate pbar myself as the unweighted mean, and you get pbar=.2, and pass that value to PROC SHEWHART:
proc sql noprint;
select mean(pfailed) into :pbar trimmed
from have
;
quit ;
%put &=pbar ;
proc shewhart data=have ;
pchart pfailed*lot/subgroupn=ntested dataunit=proportion p0=&pbar;
run ;
... View more