04-13-2016
RobF
Quartz | Level 8
Member since
06-14-2013
- 81 Posts
- 37 Likes Given
- 0 Solutions
- 8 Likes Received
-
Latest posts by RobF
Subject Views Posted 4874 04-12-2016 02:08 PM 4914 04-07-2016 05:13 PM 4924 04-07-2016 04:51 PM 5236 02-29-2016 02:51 PM 3730 01-14-2016 01:29 PM 3742 01-14-2016 10:17 AM 3777 01-13-2016 02:48 PM 7162 12-14-2015 01:09 PM 7172 12-14-2015 10:01 AM 2491 12-14-2015 09:54 AM -
Activity Feed for RobF
- Got a Like for Re: LASSO in Logistic regression. 10-29-2020 10:34 AM
- Got a Like for Re: LASSO in Logistic regression. 08-06-2020 11:43 AM
- Got a Like for How to output proc print to desktop from SAS EG Server?. 06-09-2016 04:46 AM
- Posted Re: How to output proc print to desktop from SAS EG Server? on SAS Enterprise Guide. 04-12-2016 02:08 PM
- Liked Re: How to output proc print to desktop from SAS EG Server? for BrunoMueller. 04-12-2016 02:07 PM
- Liked Re: How to output proc print to desktop from SAS EG Server? for Kurt_Bremser. 04-12-2016 02:07 PM
- Posted Re: How to output proc print to desktop from SAS EG Server? on SAS Enterprise Guide. 04-07-2016 05:13 PM
- Posted How to output proc print to desktop from SAS EG Server? on SAS Enterprise Guide. 04-07-2016 04:51 PM
- Posted Re: Does SAS have LASSO or LAR variable selection implemented for Logistic Regression? on Statistical Procedures. 02-29-2016 02:51 PM
- Liked Re: Comparing observed to expected values in 2x2 contingency tables for SteveDenham. 01-19-2016 10:12 AM
- Liked Re: Comparing observed to expected values in 2x2 contingency tables for Reeza. 01-19-2016 10:12 AM
- Posted Re: Comparing observed to expected values in 2x2 contingency tables on SAS Procedures. 01-14-2016 01:29 PM
- Liked Re: Comparing observed to expected values in 2x2 contingency tables for Rick_SAS. 01-14-2016 01:28 PM
- Posted Re: Comparing observed to expected values in 2x2 contingency tables on SAS Procedures. 01-14-2016 10:17 AM
- Posted Comparing observed to expected values in 2x2 contingency tables on SAS Procedures. 01-13-2016 02:48 PM
- Posted Re: reading values into array starting at index 0 instead of 1 on SAS Programming. 12-14-2015 01:09 PM
- Liked Re: reading values into array starting at index 0 instead of 1 for RW9. 12-14-2015 01:09 PM
- Posted Re: reading values into array starting at index 0 instead of 1 on SAS Programming. 12-14-2015 10:01 AM
- Posted Re: SAS documentation website broken? on Administration and Deployment. 12-14-2015 09:54 AM
- Posted Re: reading values into array starting at index 0 instead of 1 on SAS Programming. 12-13-2015 03:38 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 1 04-07-2016 04:51 PM 3 04-30-2015 10:10 AM 1 05-07-2015 10:21 AM 3 04-30-2015 10:19 AM
04-12-2016
02:08 PM
Thank you Bruno - this is the best workaround solution for now.
... View more
04-07-2016
05:13 PM
I tried writing to my H: drive, still no luck:
ERROR: Physical file does not exist, H:\HH_Providers.pdf.
The weird thing is that I *can* export datasets to my desktop from EG using the Export wizard. But not when using ods statements to output files from a procedure.
... View more
04-07-2016
04:51 PM
1 Like
I'm having trouble outputting a proc print table to my desktop. We have a SAS EG v6.1 license installed on a server.
I'm receiving the following error:
ERROR: Insufficient authorization to access C:\HH_Providers.pdf
when I run my code:
ods pdf file="C:\HH_Providers.pdf";
PROC PRINT DATA=WORK.SORTTempTableSorted style(header)={just=c}
NOOBS
LABEL
;
VAR SVC_QTR MEMBNO MEMB_NAME HH_NAME SVC_PROVIDER SVC_DATE DIAG_IND / style(data)={just=c};
BY SVC HH_NAME;
FORMAT
SVC_DATE MMDDYYS8.;
LABEL SVC_QTR="# of Qualifying Visits/Episodes"
MEMBNO="Member Number"
MEMB_NAME="Member Name"
HH_NAME="Home Health Provider"
SVC_PROVIDER="Healthcare Provider"
SVC_DATE="Visit/Episode Date"
DIAG_IND="Diagnosis Indicator";
RUN;
ods _all_ close;
... View more
02-29-2016
02:51 PM
Hi Salomon,
Here's the code for both the logistic regression and Poisson regression tested on the Diabetes dataset (available at http://www4.stat.ncsu.edu/~boos/var.select/diabetes.tab.txt).
Either ridge regression (alpha=0), lasso (alpha=1), or elastic net (0 < alpha < 1) may be run by inputing alpha and lambda parameters.
Please note that my code isn't quite complete: in order to decide on an optimal lambda value for the lasso, the standard approach is to use cross-validation to minimize prediciton errors across a range of specified lambda values. To do this, split your analysis dataset into k CV folds (typically k=5 or k=10). Run the program (including the standardization and parameter initialization code) on each of the k training datasets. Then score the validation datasets with coefficients generated from each run. Select the value of lambda with the lowest average prediction error. Another option is the “one-standard-error” rule: select the largest lambda value that is still within 1 stnd error of the lambda value with the minimal prediction error.
... View more
01-14-2016
01:29 PM
Ah - in that case maybe a better idea would be to conduct two binomial tests comparing the % Yes for X and Y between the Observed & Expected?
... View more
01-14-2016
10:17 AM
Thanks Reeza -
Does the "expected" option allow the user to manually enter in the expected null hypothesis values, or does "expected" only calculate the 2x2 table's row and column means through cross-multiplication?
... View more
01-13-2016
02:48 PM
I'm conducting a chi-squared goodness of fit test comparing the following observed cell counts to the expected count values.
Observed
X
Y
Total
No
209,916
1,191
211,107
Yes
7,645
461
8,106
Total
217,561
1,652
219,213
Expected
X
Y
Total
No
209,516.100
1,590.913
211,107
Yes
8,044.913
61.087
8,106
Total
217,561
1,652
219,213
Is it possible to find the chi-square p-value for 2x2 or larger multinomial tables with specified expected values using proc freq?
I ended up hand calculating the chi-square test statistic in the above example (= 2,739.234) and then ran the following code for chi-square dbn with 1 df:
data _null_;
pvalue = 1 - PROBCHI(2739.234, 1);
put pvalue;
run;
The resulting p-value was so small SAS rounded down to zero.
... View more
12-14-2015
01:09 PM
Thanks RW9, that's an interesting solution.
My code (which performs a lasso/ridge regression) reads the analysis dataset into an array & processes the data in a data _null_ data step to save processing time. Getting it to work was a minor miracle, but there are still a few bugs in my array code & I'm open to suggestions.
... View more
12-14-2015
10:01 AM
Right, normally I'm happy with the array index starting at 1.
In this case I'm refining a program that iteratively calculates regression coefficients p0, p1, p2, ..., p&numvar, and for convenience's sake I'd like the coefficient array to start at 0 (the intercept). One less thing to keep track of in my code if I don't have to subtract one from the array index when I'm printing out the final array values.
... View more
12-14-2015
09:54 AM
Thanks Shelley, I appreciate your help.
I'm not sure what's going on. I have no problems accessing the SAS documentation website on my home computer (operating on Windows 7). Maybe it's a security setting on my work PC.
... View more
12-13-2015
03:38 PM
Thanks Reeza!
I had a feeling there was a simple solution I'd overlooked.
... View more
12-13-2015
11:50 AM
I'm having problems reading macro variables into an array that starts at index 0.
Here's a much simplified example:
%let a0=0; %let a1=1; %let a2=2; %let a3=3;
data test (keep= a_0-a_3);
array a_(0:3) (&a0 &a1 &a2 &a3);
output test;
run;
When I run this code I receive the following error message in the log:
WARNING: Not all variables in the list a_0-a_3 were found.
NOTE: The data set WORK.TEST has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
and the values in the test dataset have been offset and are incomplete:
Obs a_1 a_2 a_3
1 0 1 2
I know SAS can handle arrays with indexes beginning at 0 rather than 1. What am I doing wrong here?
Thanks! in advance
Robert
... View more
12-07-2015
05:13 PM
Here's another solution to creating interaction variables that avoids macro programming.
Create a variable list of the main effects of interest from proc contents, then accumulate all of the interaction variable creation data step statements into one long macro variable.
For example, to create the interaction variables green_red_int, black_red_int, and white_red_int, run the following code:
data test;
input id green black white red;
cards;
1 2.1 10 20 30
2 3.2 40 50 60
3 4.3 70 80 90
;
proc contents data=test out=varlist(keep=varnum name) order=varnum;
run;
proc sort data=varlist;
by varnum;
run;
data varlist;
set varlist;
if varnum in(2:4);
run;
data _null_;
length allvars $90;
retain allvars;
set varlist end=eof;
allvars =trim(left(allvars))||' '||trim(name)||'_red_int = '||trim(name)||'*red;';
if eof then call symput('interactions', allvars);
run;
%put &interactions;
data test2;
set test;
&interactions;
run;
... View more
12-07-2015
11:10 AM
Sometimes scrolling down works - but at other times the page partially loads and the text is chopped off at the bottom.
... View more
12-07-2015
10:05 AM
Thanks PGStats, this works great!
There must still be a way to combine two macro variable names like "black" and "white" into a single varibale name "black_white_int", but getting the macro code syntax right with the ampersands and quotation marks has always been tricky for me.
... View more