Yes. That is correct. Alternative way is using PROC UNIVARIATE. proc univariate data=base_post ; by trt01pn; var cat3; run;    
Yes, the BLC parameter is optional, and you opted to specify it by using the CON argument. But the CON argument is not the correct format. If you don't want a constrained optimization, then omit the ... See more...
Yes, the BLC parameter is optional, and you opted to specify it by using the CON argument. But the CON argument is not the correct format. If you don't want a constrained optimization, then omit the CON argument. Otherwise, specify it correctly.   I don't know what distribution you are trying to fit, but I want to point out that your input data set only has three unique pieces of information: When (x1,x2)=(0,0), the value P(x1,x2)=2.259E-6 When (x1,x2)=(1,1), the value P(x1,x2)=0.999 When (x1,x2)=(1,0) or (0,1), the value P(x1,x2)=0.00033 I also do not think you can perform an optimization in this function because it is unbounded. For example, look at the cross section for theta1=3 as you let theta2 vary: /* visualize the LL when theta1=3 */ theta1 = 3; theta2 = T( do(0,8,0.1) ); LL = j(nrow(theta2), 1); do i = 1 to nrow(theta2); LL[i] = LogLik( theta1 || theta2[i] ); end; title "LL(3, theta2)"; call series(theta2, LL) grid={x y}; As you can see, the objective function does not have a maximum. I suggest you check the computations that you used to construct the LogLik function.    
Here are my findings. In the sasdeployment.yaml it is indeed possible to add ordinary users. This file is used at the time of deployment. However once authentication from the authentication provid... See more...
Here are my findings. In the sasdeployment.yaml it is indeed possible to add ordinary users. This file is used at the time of deployment. However once authentication from the authentication provider (LDAP) is configured then, any user so added above will not have access.
cas mycas; libname casuser cas caslib=casuser; proc casutil; load data=sashelp.cars outcaslib="casuser" casOut="cars" replace; load data=sashelp.class outcaslib="casuser" cas... See more...
cas mycas; libname casuser cas caslib=casuser; proc casutil; load data=sashelp.cars outcaslib="casuser" casOut="cars" replace; load data=sashelp.class outcaslib="casuser" casOut="class" replace; load data=sashelp.baseball outcaslib="casuser" casOut="baseball" replace; run; proc cas; table.tableinfo result=rc /caslib="casuser"; fragment=';'; do table over rc["TableInfo"][,"Name"]; table.tabledetails result=result/name=table caslib="casuser"; saveresult result caslib="casuser" casout=table; code="data casuser.allResults"||fragment|| "set casuser."||table||";length Data varchar(100);Data='"||table||"';run;"; datastep.runcode/code=code; fragment='(append=yes);'; end; quit; Give this a try
Your code would work if c_EFF_DT was an actual SAS date value. But it is not a SAS date, it is a SAS date/time value. How do I know? Because it has been assigned a date/time format.   So to do th... See more...
Your code would work if c_EFF_DT was an actual SAS date value. But it is not a SAS date, it is a SAS date/time value. How do I know? Because it has been assigned a date/time format.   So to do the filtering, you have to use date/time values   where "01Mar2024:00:00:00"dt <= c_EFF_DT <= "31Mar2024:00:00:00"dt;     or even simpler, convert c_eff_dt to a date value   where "01Mar2024"d <= datepart(c_EFF_DT) <= "31Mar2024"d;     or if you are going to be doing this repeatedly for future months, and you don't want to have to figure out what the last day of each month is and then type that into the program   where month(datepart(c_eff_dt))=3 and year(datepart(c_eff_dt))=2024;   or   where '01MAR2024'd <= datepart(c_eff_dt) < '01APR2024'd Note the change from <= to <  I like the last one best, less typing, no need to mentally figure out what the last day of the month is
I think you want to apply the NMISS function to the five values foodinsc1, ..., foodinsc5 in each observation: /* Create sample data for demonstration */ data have; array foodinsc[5] (. 7 . 0 .);... See more...
I think you want to apply the NMISS function to the five values foodinsc1, ..., foodinsc5 in each observation: /* Create sample data for demonstration */ data have; array foodinsc[5] (. 7 . 0 .); foodinsc_scr=.; run; /* Count missing values of foodinsc1, ..., foodinsc5 in each observation */ data want; set have; nm=nmiss(of foodinsc1-foodinsc5); run; /* Obtain frequency distribution */ proc freq data=want; tables nm; run;
You need to pair this PIPE output with a DATA step, something like:   data WANT; infile oscmd pad; input LINE 256.; /* parse the line into fields */ FNAME=substr(X,..); run;
This summarizes the results of the original code and responses received as of this date when executed against this table: Data Set Name LIBA.HAVE Observations 500000 Member Ty... See more...
This summarizes the results of the original code and responses received as of this date when executed against this table: Data Set Name LIBA.HAVE Observations 500000 Member Type DATA Variables 50 Engine V9 Indexes 1 Created 04/29/2024 09:02:45 Observation Length 400 Last Modified 04/29/2024 09:02:45 Deleted Observations 0 Protection   Compressed NO Data Set Type   Sorted NO Label       Data Representation WINDOWS_64     Encoding utf-8 Unicode (UTF-8)     Original Code: proc sql; update liba.have set country1='', country3='', pop1=., pop2=., pop1_date=.; quit; Results: NOTE: PROCEDURE SQL used (Total process time): real time 0.61 seconds cpu time 0.23 seconds So, .61 seconds was the time to beat! @Tom's solution data liba.have(index=(ID)); set liba.have; call missing(of country1 country3 pop1 pop2 pop1_date); run; and @Ksharp's solution proc sql; alter table have drop country1, country3,pop1,pop2,pop1_date add country1 char(20), country3 char(3),pop1 num,pop2 num,pop1_date num; quit; tied for first place  real time 0.40 seconds cpu time 0.20 seconds With my solution: data liba.have ; modify liba.have; call missing(country1, country3,pop1,pop2,pop1_date); run; coming in third, real time 0.44 seconds cpu time 0.32 seconds and data_null__'s solution: data liba.have (index=(ID)); if 0 then set liba.have; set liba.have (drop=country1 country3 pop1 pop2 pop1_date); run; still beating the original post: real time 0.58 seconds cpu time 0.26 seconds Of course, your mileage may vary depending on the size of your data.     
Seems simple enough.  First let's convert your existing (HAVE) data listing and expected (EXPECT) data listings into datasets.  Then you just need to select the observations where recorded_time is le... See more...
Seems simple enough.  First let's convert your existing (HAVE) data listing and expected (EXPECT) data listings into datasets.  Then you just need to select the observations where recorded_time is less than or equal to last_visit. data have; input DMRN $ last_visit :date. UI recorded_time :date.; format last_visit recorded_time date9.; cards; 31 26AUG2021 0 06APR2018 31 26AUG2021 0 16JAN2020 31 26AUG2021 1 4MAY2021 31 26AUG2021 1 26MAY2022 33 24MAY2022 0 02MAR2020 33 24MAY2022 0 24MAY2022 35 01DEC2014 0 25MAR2013 35 01DEC2014 1 05JAN2015 ; data expect; input DMRN $ last_visit :date. UI recorded_time :date.; format last_visit recorded_time date9.; cards; 31 26AUG2021 0 06APR2018 31 26AUG2021 0 16JAN2020 31 26AUG2021 1 4MAY2021 33 24MAY2022 0 02MAR2020 33 24MAY2022 0 24MAY2022 35 01DEC2014 0 25MAR2013 ; data want ; set have; where recorded_time <= last_visit; run; proc compare data=want compare=expect; run;  
There is no way your expression     std(south and north) as sd_south_north can produce 8.4825  (or 18.4715998224301).        That's because the expression "south and north" is a logic... See more...
There is no way your expression     std(south and north) as sd_south_north can produce 8.4825  (or 18.4715998224301).        That's because the expression "south and north" is a logical expression yielding either a zero or one.  So std(south and north) would be getting the STD of a collection of 1's and 0's.    Please provide the code (and data) you used to produce the unexpected results you show.  
I already showed you how to do that.  You have to put those two "columns" of North and South into one "column" so that you can then use the MEAN() (or as it is commonly called in many SQL dialects AV... See more...
I already showed you how to do that.  You have to put those two "columns" of North and South into one "column" so that you can then use the MEAN() (or as it is commonly called in many SQL dialects AVERAGE()) aggregate function.  If your SQL dialect supports it you could also use a STD() aggregate function (by whatever name your SQL dialect chooses to use for it).   You could try crafting your own logic for generating statistics. The mean is just the sum over the count. So that is simple. (sum(south) + sum(north))/(count(south)+count(north)) as mean_south_north But the formula for the standard deviation is much more complicated.  You would need to remerge the mean back onto every observation, find the difference, etc. etc.   Also why the heck do you want the same value repeated onto every observation. Where are you going with this? Also how did you end up with that input data structured where you have the values for a single variable split into two variables?  It would be much easier in SQL if the data was structured with three variables (ID, DIRECTION, COUNT) and 16 observations instead of 5 variables and 4 observations.        
Data ds; infile datalines; input name $40.; call scan(name,1,p1,l1,' '); call scan(name,-1,p2,l2,' '); first=scan(name,1,' '); middle=substrn(name,p1+l1,p2-p1-l1); last=scan(name,-1,' '); drop p1 p2... See more...
Data ds; infile datalines; input name $40.; call scan(name,1,p1,l1,' '); call scan(name,-1,p2,l2,' '); first=scan(name,1,' '); middle=substrn(name,p1+l1,p2-p1-l1); last=scan(name,-1,' '); drop p1 p2 l1 l2; datalines; Virat Kohli Surya Kumar Yadav Rohit Sharma Dhoni Chetandra Pratap Singh Chauhan ; run;
Your use of the IN operator is incorrect - you can only compare constants using IN, not columns. You could do something like this to avoid a lot of typing: where cats(smq01sc, smq02sc, smq03sc, sm... See more...
Your use of the IN operator is incorrect - you can only compare constants using IN, not columns. You could do something like this to avoid a lot of typing: where cats(smq01sc, smq02sc, smq03sc, smq04sc, smq05sc, smq06sc,smq07sc, smq08sc,smq09sc, smq10sc) contains 'Broad' That assumes one or more of the columns contains 'Broad'.
Hello @vijnad,   If all else fails, you can at least avoid the occurrence of the text "The SGRender Procedure" anywhere in the graph by post-processing the SVG file (which is a text file luckily)... See more...
Hello @vijnad,   If all else fails, you can at least avoid the occurrence of the text "The SGRender Procedure" anywhere in the graph by post-processing the SVG file (which is a text file luckily). In the example below I remove the text in a new SVG file named with the suffix "_clean", but you can replace the text by something more descriptive in the third argument of the TRANSTRN function as well. data _null_; infile "&figout/%sysfunc(tranwrd(&tlfname,-,_)).svg"; file "&figout/%sysfunc(tranwrd(&tlfname,-,_))_clean.svg"; input; _infile_=transtrn(_infile_,'The SGRender Procedure',trimn('')); put _infile_; run; If this still leaves unwanted elements in the graph (it did not in my tests), you can remove the corresponding SVG code by adding similar calls to the TRANSTRN function with a different second argument.
300 binary covariates most likely will take an extremely long time to fit such a model. I don't think there's any way around that. Even with an HP PROC. But there are optimization options and toleran... See more...
300 binary covariates most likely will take an extremely long time to fit such a model. I don't think there's any way around that. Even with an HP PROC. But there are optimization options and tolerance options for PROC HPGENSELECT, you could try those and see if anything helps (I'm guessing they would)   As far as what else to try, you could see which of the binary predictors are highly correlated with the binary response using a Chi-squared test (two way table in PROC FREQ with the CHISQ option will get you there) and just pick a few of the best binary predictors to use in the model.   Thinking out of the box, another approach is to use logistic Partial Least Squares with all 300 binary predictors. I have no doubt that even with 300 binary predictors it would finish much more quickly, and I would be surprised if it even took an hour. However, the only software to do this that I know of is in R (https://cran.r-project.org/web/packages/plsRglm/plsRglm.pdf)
If they are all of the same type (numeric or character does not matter) then a simple data step should do the job. data _null_; if 0 then set have; array __xx col: ; call symputx('colnum',di... See more...
If they are all of the same type (numeric or character does not matter) then a simple data step should do the job. data _null_; if 0 then set have; array __xx col: ; call symputx('colnum',dim(__xx)); stop; run; Otherwise you could try using the SAS dictionary metadata view/table to check. proc sql noprint; select count(*) format=32. into :colnum trimmed from dictionary.columns where libname='WORK' and memname='HAVE' and upcase(name) eqt 'COL' ; quit;
You did not include any ARRAY statements in your data step.  Read the documentation on how arrays work. So perhaps something like this: data ds; input id _den1-_den3 _num1-_num3; datalines; 1 ... See more...
You did not include any ARRAY statements in your data step.  Read the documentation on how arrays work. So perhaps something like this: data ds; input id _den1-_den3 _num1-_num3; datalines; 1 4 7 6 0 3 2 2 4 7 6 1 0 3 3 4 7 6 0 2 1 4 4 7 6 2 1 0 ; data want; set ds; array _den _den1-_den3; array _num _num1-_num3; array _low _low1-_low3; array _high _high1-_high3; array result $15 result1-result3; do i=1 to dim(_den); _pi = round((_num[i]/_den[i]),.0001); if _pi=0 then _low[i]=0; else _low[i]=round((1-betainv(.975,(_den[i]-_num[i]+1),_num[i])),.0001)*100; if _pi=1 then _high[i]=100; else _high[i]=round((1-betainv(.025,(_den[i]-_num[i]),_num[i]+1)),.0001)*100; result[i] = cats('[',put(_low[i], 5.1),',',put(_high[i], 5.1),']'); end; drop i _pi ; run; Result  
hours = intck("hour",start_date_time,end_date_time,"c");
Once a variable is numeric, it is always numeric.   Once a variable is character, it is always character.    This line defines the variable A as character: a = '2016-09-01'; While the n... See more...
Once a variable is numeric, it is always numeric.   Once a variable is character, it is always character.    This line defines the variable A as character: a = '2016-09-01'; While the next statement works and the INPUT function generates a number, SAS now has to store that number in a character variable.  So the result of the INPUT function gets converted back to character.  There should be a note on your log about numeric to character conversion taking place at that point.    
If I was right, you are unable to use option "displaystats=" when you have option "group=", Check its DOC. And you could try add SEX into PANELBY statement. proc sgpanel; PANELBY yearsincetx_grp... See more...
If I was right, you are unable to use option "displaystats=" when you have option "group=", Check its DOC. And you could try add SEX into PANELBY statement. proc sgpanel; PANELBY yearsincetx_grp sex/layout=lattice;