12-01-2021
FrustratedBio
Calcite | Level 5
Member since
02-25-2021
- 27 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by FrustratedBio
Subject Views Posted 391 12-01-2021 05:21 PM 460 09-29-2021 10:29 PM 2584 07-19-2021 03:15 PM 2586 07-19-2021 03:13 PM 2747 07-16-2021 04:46 PM 1642 06-24-2021 03:58 PM 1647 06-24-2021 03:55 PM 1648 06-24-2021 03:54 PM 1650 06-24-2021 03:53 PM 1654 06-24-2021 03:51 PM -
Activity Feed for FrustratedBio
- Posted What codes are available that could help me adjust the y-axis in proc lifetest? on SAS Programming. 12-01-2021 05:21 PM
- Posted How do I interpret a global proportionality test using Proc PH Reg on Statistical Procedures. 09-29-2021 10:29 PM
- Posted Re: How to Export to Excel while keeping formats? on SAS Programming. 07-19-2021 03:15 PM
- Posted Re: How to Export to Excel while keeping formats? on SAS Programming. 07-19-2021 03:13 PM
- Posted How to Export to Excel while keeping formats? on SAS Programming. 07-16-2021 04:46 PM
- Posted Re: Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:58 PM
- Posted Re: Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:55 PM
- Posted Re: Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:54 PM
- Posted Re: Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:53 PM
- Posted Re: Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:51 PM
- Posted Trouble with SAS on demand. on SAS Programming. 06-24-2021 03:44 PM
- Posted Re: How do I parse through a string? on SAS Programming. 05-04-2021 08:56 AM
- Posted How do I parse through a string? on SAS Programming. 05-04-2021 01:12 AM
- Posted Re: What would be the command to break this data up from long to wide (array). on SAS Programming. 04-18-2021 06:46 PM
- Posted What would be the command to break this data up from long to wide (array). on SAS Programming. 04-18-2021 05:48 PM
- Posted Re: Creating an array from datalines. on SAS Programming. 04-18-2021 03:44 PM
- Posted Re: Creating an array from datalines. on SAS Programming. 04-18-2021 03:43 PM
- Posted Creating an array from datalines. on SAS Programming. 04-18-2021 01:40 PM
- Posted Re: What is a statement to get rid of missing values in array output? on SAS Programming. 04-16-2021 12:47 AM
- Posted Re: Could somebody translate the meaning of the array subscript range? on SAS Programming. 04-16-2021 12:31 AM
12-01-2021
05:49 PM
2 Likes
Hello,
You can output the survival estimates to a data set and make your own plot using PROC SGPLOT.
But maybe below references contain a viable solution as well (?) :
Kaplan-Meier Survival Plotting Macro %NEWSURV Posted 07-20-2018 12:33 AM | by JeffMeyers https://communities.sas.com/t5/SAS-Communities-Library/Kaplan-Meier-Survival-Plotting-Macro-NEWSURV/ta-p/479747
SAS/STAT® 15.2 User's Guide Customizing the Kaplan-Meier Survival Plot https://go.documentation.sas.com/doc/en/statug/15.2/statug_kaplan_toc.htm
Creating and customizing the Kaplan-Meier Survival Plot in PROC LIFETEST https://video.sas.com/detail/video/2918155168001/creating-and-customizing-the-kaplan-meier-survival-plot-in-proc-lifetest
Paper 427-2013 Creating and Customizing the Kaplan-Meier Survival Plot in PROC LIFETEST Warren F. Kuhfeld and Ying So, SAS Institute Inc. https://support.sas.com/resources/papers/proceedings13/427-2013.pdf
Koen
... View more
10-05-2021
05:38 AM
Do you have the syntax for the SAS procedure that was used to create the table? If so, please post it. By knowing the procedure, options, and model, it will be easier to interpret the results.
... View more
07-20-2021
11:38 AM
Hi:
One of your issues is with the value for the FILE= option in your ODS statement:
The C: part of the path is highlighted in pink because SAS OnDemand for Academics is a Linux/Unix box and does NOT have a C: drive. So this reference to C: will generate an error, as you showed:
So, when the OnDemand server went to look for c:/home... location, it didn't find it and so it looked in the default working folder on the server, didn't find it and issued an error message.
If you are using SAS OnDemand for Academics, you should always start your paths with /home or else with a ~ (tilde). For example, if I wanted to create an ODS result file for ODS EXCEL on my SAS OnDemand account, I would write the output to my RESULTS folder (that I created under Files (Home) top node. And so my ODS EXCEL statement would look like this:
ods excel file='/home/<myuserID>/RESULTS/example1.xlsx'; or ods excel file='~/RESULTS/example2.xlsx';
My tendency is not to write files to my SASUSER folder on the OnDemand server because I prefer to create my own folders under Files (Home) top node in which to store my output. Under my Files (Home) location, I have a folder for Programming 1 (EPG1V2), folders for other classes, a folder for PROGRAMS, and a folder for RESULTS.
You can always find the correct path to a folder on the OnDemand server, by clicking on Server Files and Folders, then clicking to expand the Files (Home) top node. Make a folder to hold your results. Maybe call it RESULTS. Right click on that folder and choose Properties. The Location field in the Properties window will show you the path you need to use for that folder. For a FILE= option, you'd only need to add your filename and extension to the back end of the path from the Properties window.
You are getting a WARNING on the WEIGHT variable because you don't have a COLUMN statement in PROC REPORT. It's generally a best practice to use a COLUMN statement so you can control the order of the variables and statistics that you want to place on the report.
Until you have a working program, you will not be able to tell whether your format is working or not. I notice that you are trying to format WEIGHT as a string. Just remember that Excel can be very picky about numbers formatted as text, so even if you use TAGATTR, you may still see the "number stored as text" warning when you open the result file in Excel.
This user group paper https://support.sas.com/resources/papers/proceedings11/266-2011.pdf discussed the use of TAGATTR in the context of TAGSETS.EXCELXP, but the concepts also apply to ODS EXCEL. You will definitely want to use the TAGATTR if you want to send a Microsoft format for your number from SAS to Excel.
Cynthia
... View more
06-24-2021
04:08 PM
Go to your autoexec. Add this line of code, save the file and then restart & re-run everything. Or put it at the top of your program to try it first. options validvarname=v7;
... View more
05-04-2021
10:57 AM
@FrustratedBio wrote:
I am attempting to run the code below in an attempt to recreate variables n1-n5 from the array. The problem is, it is not currenlty working and I can't figure out why.
Data STRING; Input STRING $10. X 1-2 Y 3 N1 6 N2 7 N3 8 N4 9 N5 10; State= Upcase (substr(STRING, 4,2)); Array N[5] $5 N1-N5; DO I= 1 to 5; N [I]= scan(String, I,.); end; Drop I; Datalines; 123nj76543 892NY10203 876pA83745 ;
One of the main problems you are having is that your read values into variables N1 through N5 as numeric values and then try to force use as character values, the $5 in the Array and Scan function.
Once a variable is created, and the input statement is implicitly creating everything except String as numeric, the type cannot change.
Is this what you expected:
Data STRING;
Input STRING $10.
X 1-2
Y 3
N1 6
N2 7
N3 8
N4 9
N5 10;
State= Upcase (substr(STRING, 4,2));
Datalines;
123nj76543
892NY10203
876pA83745
;
or maybe
Data STRING;
Input STRING $10.
X 1-2
Y 3
N1 $ 6
N2 $ 7
N3 $ 8
N4 $ 9
N5 $ 10;
State= Upcase (substr(STRING, 4,2));
Datalines;
123nj76543
892NY10203
876pA83745
;
or maybe
Data STRING;
Input STRING $10.
X 1-2
Y 3
N1 6
N2 7
N3 8
N4 9
N5 10;
State= Upcase (substr(STRING, 4,2));
Array Z[5] $5 Z1-Z5;
DO I= 1 to 5;
Z[I]= substr(String,i+5,1);
end;
Drop I;
Datalines;
123nj76543
892NY10203
876pA83745
;
Read you logs. Your first code shows these messages
258 Data STRING;
259 Input STRING $10.
260 X 1-2
261 Y 3
262 N1 6
263 N2 7
264 N3 8
265 N4 9
266 N5 10;
267 State= Upcase (substr(STRING, 4,2));
268 Array N[5] $5 N1-N5;
269 DO I= 1 to 5;
270 N [I]= scan(String, I,.);
271 end;
272 Drop I;
273 Datalines;
NOTE: Numeric values have been converted to character values at the places given by:
(Line):(Column).
270:23
NOTE: Character values have been converted to numeric values at the places given by:
(Line):(Column).
270:1
NOTE: Invalid numeric data, '123nj76543' , at line 270 column 8.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
274 123nj76543
STRING=123nj76543 X=12 Y=3 N1=. N2=. N3=. N4=. N5=. State=NJ I=6 _ERROR_=1 _N_=1
NOTE: Invalid numeric data, '892NY10203' , at line 270 column 8.
275 892NY10203
STRING=892NY10203 X=89 Y=2 N1=. N2=. N3=. N4=. N5=. State=NY I=6 _ERROR_=1 _N_=2
NOTE: Invalid numeric data, '876pA83745' , at line 270 column 8.
276 876pA83745
STRING=876pA83745 X=87 Y=6 N1=. N2=. N3=. N4=. N5=. State=PA I=6 _ERROR_=1 _N_=3
NOTE: The data set WORK.STRING has 3 observations and 9 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
The invalid data on line 270 is from the SCAN function. The dot in your scan is not a valid SCAN function third parameter. It has to hold a character value either as a variable or a quoted string such as ".". But there is no obvious delimiter or separator in the value of String so you need a different approach to get values out of it with character functions.
... View more
04-18-2021
06:46 PM
Well, the purpose of our assignment is to use the array, its actually in the chapter question. Thank a bunch for pointing that out. I actually just neglected the time variable.......again its been one of those weekends. Thanks a bunch.
... View more
04-16-2021
12:47 AM
Thanks a bunch! I was doing that but I realized that it doesn't work unless I put it BEFORE the statement end.
... View more
04-16-2021
12:31 AM
Such an easy fix. Good thing I ain't majoring in this. Thanks!
... View more
02-26-2021
05:15 AM
Please do ALWAYS
(as in ALWAYS)
use the indicated button for posting logs, otherwise the horizontal formatting is destroyed and the log becomes mostly useless.
Similarly, you can open the file with a text editor (like Windows Editor or Notepad++, NOT a word processor like MS Word) and copy/paste a few lines into a window opened with the same button. Or you change the filename extension to .txt and attach the file to your next post.
I suspect that the positions in the code do not match the positions in the file. But I can only tell for sure once I see the data as it is.
... View more