Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
Proc export giving additional quotes to the quoted char values.and if u use data step for that it is giving a space or . To numeric values which is not required . Needs to change nothing.now it is , , but want ,, no space no .for missing numeric value.
... View more
I have a scenario as follows:
data have; input id var1 var2; datalines;
1 . 5 2 3 4 3 4 5 5 0 6 6 9 8 ; run;
%let nvar = 2;
%let v1 = 5; /*Condition for var1*/
%let v2 = 8; /*Condition for var2*/
When i run this array , i am getting error.
data want; set have; array var{2} var1 : var&nvar; array flag{2} flag1-flag&nvar; do i = 1 to 2; if var{i} >= 5 then flag{i} = 1; else flag{i} = 0; end; drop i; run;
This above code run correct but what i need is that instead of var{i} >= 5 i have to replace by var{i} >= &v{i} so i make
the condition to change as i changes.
However this modification does not work ,saying it can not resolve &v{i}.
Any suggestion ? Thank you.
... View more
Hi,
I’ve run a propensity score analysis with inverse probability of treatment weights (IPW) using SAS PROC CAUSALTRT.
I want to plot the logit of the propensity score after IPW, but can’t figure out how to weight the propensity scores in the code I’m using to generate the plot. Example code from SAS included below:
proc template;
define statgraph densityplot;
begingraph;
entrytitle "Highway Mileage Distribution by Origin";
layout overlay /
xaxisopts=(griddisplay=on
gridattrs=(color=lightgray pattern=dot))
yaxisopts=(griddisplay=on
gridattrs=(color=lightgray pattern=dot));
densityplot mpg_highway / name="densityplot" group=origin;
discretelegend "densityplot" / title="Origin:";
endlayout;
endgraph;
end;
run;
proc sgrender template=densityplot data=sashelp.cars;
run;
I have seen papers which use IPW and report the propensity score graphically before and after IPW. I assume these researchers have weighted the propensity score in the after plot, but I don't understand how to achieve this, or if this is the correct approach to generate the propensity score plot after IPW?
In my output, I have a propensity score variable and the IPW variable.
Any help/advice would be greatly appreciated,
Thank you
... View more
Hello, I want to create just Xbar chart for LOS(hours) quartely with 8 subgroups using SAS.,
I used XSCHART , it will give me both both X-bar and S charts together. Same for XR chart.
but I only want to have X-bar chart.
I also cannot use only xchart in my SAS code as xchart is used for individual data not for subgroup data.
How can I adjust my SAS code to see only the X-bar chart in my output?
proc shewhart data=MIS; xSchart LOS*AdmitYYQ / Markers outtable=outtable ; run;
Attached is the output to see both are in the same frame.
Thanks
... View more
Hello everyone, I am trying to select alternate columns from my dataset, starting from column number 1 and including every nth alternate column after that. For example, I want to select columns 1, 3, 5, 7, and so on up to column n. Is there a way to make this selection without having to manually specify the column names? Here are my column headers: FINAL_STATUS_01MAY24, FINAL_STATUS_02MAY24, and so on...
I would appreciate any help or advice. Thank you!
... View more