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.
I have got the SAS re-installed in my personal laptop. Earlier when I used to open a new file whether it is a SAS data file or a SAS code, they used to open in separate windows. However, now when I open any kind of SAS files, all the files get clubbed under one window and within the process flow as shown in the attached screenshot. This makes it quite difficult to see these different files separately or at the same time. Could anyone please help me resolve this issue? Thanks
... View more
%macro sort (dname, new, svar) ;
proc sort data=&dname out=&new ;
by &svar;
run;
%Mend;
%sort(sashelp.class, demo1,sex);
data _null_;
if cexist("WORK.SORT") then
put "WORK.SORT exists";
else
put "WORK.SORT does not exist";
run;
Hi Experts,
here i am trying macro catolog exist or not but its giving wrong output please check where i did wrong
... View more
Dear SAS community, I am trying to run weighted models for nested data (a panel survey) using PROC GLIMMIX; however, I keep getting an error and a warning (please see the SAS code and log below). I modified the Glimmix code a bit (added points and specified GCONV), but the error and the warning are still the same. When I remove the "obsweight=HCNSWGTR" and use method=laplace, the code runs just fine. Do you have any suggestions on how to address this issue? I have also attached my data. Thanks. PROC GLIMMIX DATA = test1 METHOD=QUAD(FASTQUAD QPOINTS=100) plots=all;
CLASS RAHHIDPN STRATCLUS GENDER(REF='1') RACE_ETH(ref='1') MARITAL(ref='1');
MODEL MOBILITY = BSAGE_C BSAGE_C*BSAGE_C GENDER GENDER*BSAGE_C RACE_ETH RACE_ETH*BSAGE_C RACE_ETH*GENDER
TIME TIME*TIME TIME*BSAGE_C TIME*GENDER TIME*RACE_ETH/solution obsweight=HCNSWGTR ;/**LEVEL 1 VARIABLES**/
RANDOM INTERCEPT /subject=STRATCLUS type=VC ;
RANDOM INTERCEPT /subject=RAHHIDPN(STRATCLUS) type=VC ;
NLOPTIONS GCONV=0.00001;
COVTEST/WALD;
ODS OUTPUT parameterestimates=FIXED1 covparms=RAND1;
RUN; NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 24.92 seconds
cpu time 11.03 seconds
326 PROC GLIMMIX DATA = test1 METHOD=QUAD(FASTQUAD QPOINTS=100) plots=all;
327 CLASS RAHHIDPN STRATCLUS GENDER(REF='1') RACE_ETH(ref='1') MARITAL(ref='1');
328 MODEL MOBILITY = BSAGE_C BSAGE_C*BSAGE_C GENDER GENDER*BSAGE_C RACE_ETH RACE_ETH*BSAGE_C RACE_ETH*GENDER TIME TIME*TIME TIME*BSAGE_C TIME*GENDER TIME*RACE_ETH/solution obsweight=HCNSWGTR ;
330 RANDOM INTERCEPT /subject=STRATCLUS type=VC ;
331 RANDOM INTERCEPT /subject=RAHHIDPN(STRATCLUS) type=VC ;
332 NLOPTIONS GCONV=0.00001;
333 COVTEST/WALD;
334 ODS OUTPUT parameterestimates=FIXED1 covparms=RAND1;
335 RUN;
WARNING: Class levels for RAHHIDPN are not printed because of excessive size.
ERROR: QUANEW Optimization cannot be completed.
WARNING: The initial estimates did not yield a valid objective function.
NOTE: The data set WORK.RAND1 has 3 observations and 4 variables.
WARNING: Output 'parameterestimates' was not created. Make sure that the
output object name, label, or path is spelled correctly. Also,
verify that the appropriate procedure options are used to produce
the requested output object. For example, verify that the NOPRINT
option is not used.
NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 5:39.58
cpu time 2:48.00
... View more
Hi there,
I am trying to create a csv file that has both the variable names of the dataset and another line as the header. It should look like below.
I have tried proc export, ods csvall, and a data _null_ statement but can't seem to get it to work. Examples of my code below. Is there a way to add in the ndar_subject line header while keeping the variable names as the headers below? If I could get the variable names as a header in the data _null_ step that would be ideal, but I have not been able to figure this out.
%let header1 = %str(ndar_subject,1);
%put &header1; data _null_; file "R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv" dsd; set repdata.pedig;
if _n_ = 1 then do; put "&header1"; end;
put (_all_)(+0); run;
proc export data=repdata.pedig outfile='R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv' dbms=csv replace; run;
ods csvall file="R:\tsanche\REALM Data\Data\SAS Created Data\Data Repository\July 2024 CSV Upload Files\REALM Subject and Pedigree July 2024.csv"; proc report data=repdata.pedig; run; ods csvall close;
Thanks in advance!
... View more
I was hoping I could get some clarification on how SAS 9.4 handles the semivariance estimate for Lag 0 in the semivariogram model fitting process. A visual inspection of various fitted variogram curves for my data suggest that SAS is either ignoring or weighting down the importance of the Lag 0 semivariance estimates in fitting the semivariogram curves. Given that Lag 0 generally contains substantially fewer data points than the other lags under consideration, this seems reasonable, but I have been unable to find a description in the SAS User's Guide that details exactly how this process is handled. Am I interpreting The VARIOGRAM Procedure - Quality of Fit page correctly to mean that Lag 0 is ignored in the fitting process when it says: "the weights wi2 are taken at i = 1, . . . , k." or am I missing something in the documentation elsewhere? I am using this general code form for my model fitting: PROC VARIOGRAM DATA = LIB.DATA PLOTS(ONLY) = FIT;
COMPUTE AUTOCORRELATION
LAGD = x
MAXLAG = y
CL ROBUST
AUTOCORR(WEIGHTS = DISTANCE (NORMAL)
;
COORDINATES XC = X_CORD YC = Y_CORD;
MODEL FORM = AUTO (MLIST = (EXP, SPH, GAU, SHE) NEST = 1)
CL FIT = ROBUST
CHOOSE = (STATUS SSE);
VAR RESID;
RUN;
... View more