04-14-2023
sandrube
Fluorite | Level 6
Member since
04-26-2019
- 35 Posts
- 0 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by sandrube
Subject Views Posted 670 04-13-2023 12:20 AM 822 06-10-2022 12:35 PM 860 06-10-2022 12:03 PM 1019 01-18-2022 12:08 PM 3657 01-05-2022 03:36 PM 783 01-03-2022 11:57 PM 901 12-22-2021 12:29 PM 916 12-22-2021 12:14 PM 939 12-22-2021 11:53 AM 886 08-31-2021 08:57 AM -
Activity Feed for sandrube
- Posted Using format on SAS Programming. 04-13-2023 12:20 AM
- Posted Re: Dropping observations with suffix "_A" on SAS Programming. 06-10-2022 12:35 PM
- Posted Dropping observations with suffix "_A" on SAS Programming. 06-10-2022 12:03 PM
- Got a Like for Transposing. 03-16-2022 02:03 PM
- Posted Propensity score matching on Statistical Procedures. 01-18-2022 12:08 PM
- Posted Line graph with 95% confidence interval on SAS Programming. 01-05-2022 03:36 PM
- Posted Transposing on SAS Programming. 01-03-2022 11:57 PM
- Posted Re: Transposing on SAS Programming. 12-22-2021 12:29 PM
- Posted Re: Transposing on SAS Programming. 12-22-2021 12:14 PM
- Posted Transposing on SAS Programming. 12-22-2021 11:53 AM
- Posted Re: Break in first row of forst plot on Graphics Programming. 08-31-2021 08:57 AM
- Posted Break in first row of forst plot on Graphics Programming. 08-29-2021 01:09 AM
- Posted Re: Question on PSMATCH on Statistical Procedures. 08-19-2021 08:06 PM
- Posted Question on PSMATCH on Statistical Procedures. 08-19-2021 04:27 PM
- Posted Using array to create a new variable on SAS Programming. 05-23-2021 10:47 AM
- Posted Re: Median number of observations and range per year, month, week and day on Statistical Procedures. 05-14-2021 04:48 PM
- Posted Median number of observations and range per year, month, week and day on Statistical Procedures. 05-14-2021 07:36 AM
- Posted Median survival (95% CI) with PROC LIFETEST on Statistical Procedures. 11-07-2020 05:13 PM
- Posted Re: Long to wide format on Statistical Procedures. 04-26-2020 01:21 PM
- Posted Re: Long to wide format on Statistical Procedures. 04-24-2020 08:27 AM
-
04-13-2023
12:20 AM
Hello friend, I was trying to incorporate formats into the data and used the following code: libname unos "E:\Data sets\UNOS data\SAS Dataset 202209\Thoracic"; data thoracic_data_1; set unos.thoracic_data; options fmtsearch=(unos.formats); run; formats.sas7bcat and thoracic_data.sas7bdat are in the above folder path. But it didn't work. Can someone guide me please? I appreciate your help! Rube
... View more
06-10-2022
12:03 PM
Hello friends, I am trying to drop observations ending in "_A" of the variable, "category". I used the following code and didn't work. Could you please help? If substr(category, - 1, 2)="_0" then delete; Thank you and all have a wonderful weekend! Rube
... View more
01-18-2022
12:08 PM
Hello friends, I am trying to do PSM with the following code: proc psmatch data=Data_1 region=treated; class frail age_cat sex race insurance diabetes hypertension; psmodel frail (Treated='1')=age_cat sex race insurance diabetes hypertension; match method=greedy(k=1) distance=lps caliper=0.25; assess ps var=(age_cat sex race insurance diabetes hypertension)/ plots=all weight=none; output out(obs=match)=matched matchid=_MatchID; run; However, in the matching, race and insurance were automatically excluded. Race and insurance has more than two categories. So, in PS MATCH, I can only add dichotomous variables? Thank you all! Rube
... View more
01-05-2022
03:36 PM
Hello friend, Happy New Year!I have the following data set and am trying to create a line graph with 95% CI. I used the proc sgplot (below). But it gives 95% CI as shade. Can anyone help me tell me how to do 95% CI as bar, not as shadow. data have; input Month_year $ frequency StdDev ColPercent ColStdErr ColLowerCL ColUpperCL positive negative; cards; Jan_2018 27580 729.40706 1.0132 0.0182 0.9776 1.0488 0.0356041171 0.0356041171 Feb_2018 25225 678.96555 1.0562 0.0195 1.0179 1.0944 0.0382764006 0.0382764006 Mar_2018 28230 746.38890 1.0956 0.0194 1.0576 1.1335 0.0379820518 0.0379820518 Apr_2018 26760 700.25026 1.0778 0.0188 1.0410 1.1146 0.0368349788 0.036834978 May_2018 27550 742.60845 1.0735 0.0195 1.0353 1.1118 0.0382656688 0.038265668 Jun_2018 25035 679.67669 1.0136 0.0187 0.9770 1.0502 0.0366360408 0.0366360408 Jul_2018 26160 716.09459 1.0352 0.0195 0.9970 1.0734 0.0381609915 0.0381609915 ; proc sgplot data=have; band x=Month_year lower=ColLowerCL upper=ColUpperCL / transparency=0.5; series x=Month_year y=ColPercent ; run; Thnaks Muni
... View more
01-03-2022
11:57 PM
Wish everyone a Happy and Prosperous New Year!!! I and trying to transpose the following data based on date. data have; input ID $ Vit_D CRP date :mmddyy10.; format date mmddyy10.; cards; 00-01 12 5.5 09/05/2021 00-01 15 1.6 10/12/2021 00-03 18 3.9 10/17/2021 00-03 26 3.8 09/16/2021 00-05 36 1.5 09/01/2021 00-05 30 0.8 10/20/2021 00-06 43 10.3 09/24/2021 00-06 52 0.8 10/25/2021 ; The outcome I am trying to get is following. data have_1; input ID $ Vit_D_1 CRP_1 date_1 :mmddyy10. Vit_D_2 CRP_2 date_2 :mmddyy10.; format date_1 mmddyy10. date_2 mmddyy10.; cards; 00-01 12 5.5 09/05/2021 15 1.6 10/12/2021 00-03 18 3.9 10/17/2021 26 3.8 09/16/2021 00-05 36 1.5 09/01/2021 30 0.8 10/20/2021 00-06 43 10.3 09/24/2021 52 0.8 10/25/2021 ; I am struggling because I am trying to do it based on dates. Could anyone help. Thanks you very much! Rube
... View more
12-22-2021
12:14 PM
Ok for removing "run;" Thank you very much for the explanation. Rube
... View more
12-22-2021
11:53 AM
1 Like
Hello dear friend,
Wish you all Happy Holidays and Happy New Year!
I have the following data:
data new;
infile cards missover;
format FEMALE 12. YEAR 12. RACE 12. pcnt $ 32.;
input FEMALE YEAR RACE pcnt;
cards;
0 2018 . 12900762(42.6%)
0 2019 . 12978685(43.0%)
1 2018 . 17356510(57.4%)
1 2019 . 17236228(57.0%)
. 2018 1 19747204(66.9%)
. 2019 1 19851043(67.2%)
. 2018 2 4453586(15.1%)
. 2019 2 4519150(15.3%)
. 2018 3 3394854(11.5%)
. 2019 3 3262700(11.1%)
. 2018 4 822329(2.8%)
. 2019 4 826270(2.8%)
. 2018 5 191580(0.6%)
. 2019 5 201155(0.7%)
. 2018 6 893325(3.0%)
. 2019 6 858436(2.9%)
;
I am trying to transpose it to following:
data new;
infile cards missover;
format Variable $ 32. Y_2018 $ 32. Y_2019 $ 32.;
input Variable Y_2018 Y_2019;
cards;
FEMALE_0 12900762(42.6%) 12978685(43.0%)
FEMALE_1 17356510(57.4%) 17236228(57.0%)
RACE_1 19747204(66.9%) 19851043(67.2%)
RACE_2 4453586(15.1%) 4519150(15.3%)
RACE_3 3394854(11.5%) 3262700(11.1%)
RACE_4 822329(2.8%) 826270(2.8%)
RACE_5 191580(0.6%) 201155(0.7%)
RACE_6 893325(3.0%) 858436(2.9%)
;
I am struggling with creating the "Variable" and transpose. Could you please guide or help me.
Thanks
Rube
... View more
08-29-2021
01:09 AM
Hello friends, I am in the process of creating forest plot with PROC SGPLOT using the below code. However, the first line is only half visible. Could you please help me fix it. Thank you very much for your help! Rube data forest; length subgroup $ 25; length orci $ 15; input subgroup $ OR LCI RCI p_value orci $ indentwt level obsid text $ xl $ yl $ ref2 $ id F15 $ F16 $ F17 $ F18 $; datalines; Non-Hodgkin_lymphoma '' '' '' '' . 0 2 1 . . . . 1 . . . . In-hospital_death 4.04 2.11 7.76 0.001 4.06(2.11-7.76) 1 1 2 . . . . 2 . . . . Prolonged_los 2.32 1.56 3.46 0.001 2.32(1.56-3.46) 1 1 3 . . . . 2 . . . . Hodgkin_lymphoma '' '' '' '' . 0 2 4 . . . . 1 . . . . In-hospital_death 1.82 1.43 2.76 0.001 1.82(1.43-2.76) 1 1 5 . . . . 2 . . . . Prolonged_los 1.55 1.34 2.84 0.001 1.55(1.34-2.84) 1 1 6 . . . . 2 . . . . Multiple_myeloma '' '' '' '' . 0 2 7 . . . . 1 . . . . In-hospital_death 4.28 2.16 8.48 0.001 4.28(2.16-8.48) 1 1 8 . . . . 2 . . . . Prolonged_los 3 2 4.51 0.001 3.00(2.00-4.51) 1 1 9 . . . . 2 . . . . ; run; data forest_1; set forest; label orci='aOR (95% CI)'; label subgroup='Variables'; RUN; proc format; value $txt "T" = "More Adverse Events (*ESC*){Unicode '2192'x}" "P" = "(*ESC*){Unicode '2190'x} Fewer Adverse Events"; run; /*--Attribute maps for Subgroup Test attributes--*/ data attrmap; length textweight $10; id='text'; value='1'; textcolor='Black'; textsize=7; textweight='bold'; output; id='text'; value='2'; textcolor='Black'; textsize=5; textweight='normal'; output; run; %let gpath='C:\Users\15129\Desktop\New folder'; %let dpi=200; ods html close; ods _all_ close; ods listing gpath=&gpath image_dpi=&dpi; /*--Forest Plot--*/ options missing=' '; ods listing style=HTMLBLUE; /*title j=c h=12pt "Top 10 primary diagnosis associated with cancer hospitalizations";*/ /*title2 j=c h=10pt 'Odds Ratio and 95% CI';*/ ods graphics on / reset width=5in height=3in imagefmt=tiff imagename='Forest_plot'; proc sgplot data=forest_1 nowall nocycleattrs dattrmap=attrmap noautolegend; format text $txt.; styleattrs axisextent=data; refline ref2 / lineattrs=(thickness=25 color=cxf0f0f7); highlow y=obsid low=lci high=rci / type=line lineattrs=(color=red); scatter y=obsid x=or / markerattrs=(color=green size=10 symbol=squarefilled); scatter y=obsid x=or / markerattrs=(size=0) x2axis; refline 1 10 / axis=x; /* text x=xl y=obsid text=text / position=bottom contributeoffsets=none strip;*/ yaxistable subgroup / location=inside position=left textgroup=id labelattrs=(size=7) textgroupid=text indentweight=indentWt; yaxistable orci / location=inside position=left labelattrs=(size=7) valueattrs=(size=7); yaxis reverse display=none colorbands=odd colorbandsattrs=(transparency=1) offsetmin=0.0; /* xaxis display=(nolabel) values=(0.0 0.5 1.0 5.0 10.0 15.0) ;*/ xaxis offsetmin=0 offsetmax=0.03 min=0 max=10 minor display=(nolabel); x2axis label=' ' display=(noline noticks novalues) labelattrs=(size=12); run;
... View more
08-19-2021
08:06 PM
Below is the log: 1 The SAS System 20:02 Thursday, August 19, 2021 1 ;*';*";*/;quit;run; 2 OPTIONS PAGENO=MIN; 3 %LET _CLIENTTASKLABEL='2. PS Match.sas'; 4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project'; 5 %LET _CLIENTPROJECTPATH=''; 6 %LET _CLIENTPROJECTPATHHOST=''; 7 %LET _CLIENTPROJECTNAME=''; 8 %LET _SASPROGRAMFILE='E:\_Papers\NIS - Obesity and pregnancy\SAS codes\2. PS Match.sas'; 9 %LET _SASPROGRAMFILEHOST='DESKTOP-6962RGI'; 10 11 ODS _ALL_ CLOSE; 12 OPTIONS DEV=SVG; 13 GOPTIONS XPIXELS=0 YPIXELS=0; 14 %macro HTML5AccessibleGraphSupported; 15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH; 16 %mend; 17 FILENAME EGHTML TEMP; 18 ODS HTML5(ID=EGHTML) FILE=EGHTML 19 OPTIONS(BITMAP_MODE='INLINE') 20 %HTML5AccessibleGraphSupported 21 ENCODING='utf-8' 22 STYLE=HTMLBlue 23 NOGTITLE 24 NOGFOOTNOTE 25 GPATH=&sasworklocation 26 ; NOTE: Writing HTML5(EGHTML) Body file: EGHTML 27 28 proc psmatch data=nis region=treated; 29 30 class obese race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression Abuse Psychiatric 30 ! CM_LIVER CM_CHRNLUNG 31 HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH; 32 33 psmodel obese (Treated='1')= age race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression 33 ! Abuse Psychiatric CM_LIVER CM_CHRNLUNG 34 HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH; 35 36 match method=greedy(k=1) distance=lps caliper=0.5; 37 38 assess ps var=(age race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression Abuse Psychiatric 38 ! CM_LIVER CM_CHRNLUNG 39 HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH)/ plots=all weight=none; 40 41 output out(obs=match)=NIS_1 matchid=_MatchID; 42 43 run; WARNING: You must enable ODS graphics before requesting plots. WARNING: The classification variable RACE in the VAR= option in the ASSESS statement is not a binary variable. The variable is not used in the ASSESS statement. WARNING: The classification variable PAY1 in the VAR= option in the ASSESS statement is not a binary variable. The variable is not used in the ASSESS statement. WARNING: The classification variable ZIPINC_QRTL in the VAR= option in the ASSESS statement is not a binary variable. The variable is not used in the ASSESS statement. WARNING: The classification variable HOSP_REGION in the VAR= option in the ASSESS statement is not a binary variable. The variable is not used in the ASSESS statement. WARNING: The classification variable HOSP_BEDSIZE in the VAR= option in the ASSESS statement is not a binary variable. The variable 2 The SAS System 20:02 Thursday, August 19, 2021 is not used in the ASSESS statement. NOTE: The data set WORK.NIS_1 has 128074 observations and 83 variables. NOTE: PROCEDURE PSMATCH used (Total process time): real time 2:26.72 cpu time 1:57.29 44 45 %LET _CLIENTTASKLABEL=; 46 %LET _CLIENTPROCESSFLOWNAME=; 47 %LET _CLIENTPROJECTPATH=; 48 %LET _CLIENTPROJECTPATHHOST=; 49 %LET _CLIENTPROJECTNAME=; 50 %LET _SASPROGRAMFILE=; 51 %LET _SASPROGRAMFILEHOST=; 52 53 ;*';*";*/;quit;run; 54 ODS _ALL_ CLOSE; 55 56 57 QUIT; RUN; 58
... View more
08-19-2021
04:27 PM
Hello friends, I am trying to propensity score matching and when I run it, 'Standardized Mean Differences (Treated - Control)' table has some variables omitted. What could be the reason? I don't have missing data. proc psmatch data=nis_1 region=treated; class obese age race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression Abuse Psychiatric CM_LIVER CM_CHRNLUNG HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH; psmodel obese (Treated='1')=age race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression Abuse Psychiatric CM_LIVER CM_CHRNLUNG HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH; match method=greedy(k=1) distance=lps caliper=0.5; assess ps var=(age race pay1 ZIPINC_QRTL ELECTIVE MultipleBirths PreviousCS PreDM CRD PreHTN Depression Abuse Psychiatric CM_LIVER CM_CHRNLUNG HOSP_REGION HOSP_LOCATION HOSP_BEDSIZE HOSP_TEACH)/ weight=none; output out(obs=match)=matched matchid=_MatchID; run; Thank you very much for your helo! Rubens
... View more
05-23-2021
10:47 AM
Hello friends, I have the following data set. I'm trying to create a variable 'nccs', which is first number between 11-45 among the variables DXCCS1-DXCCS5. That way, 'nccs' would be similar to variable 'Result'. data data; input ID DCCS1 DXCCS2 DXCCS3 DXCCS4 DXCCS5 Result; datalines; 1 67 73 43 1 34 43 2 2 87 67 62 92 . 3 9 32 . 5 2 32 4 34 6 90 93 88 34 5 5 53 84 68 4 . 6 55 76 67 56 29 . 7 12 82 . . 11 12 8 10 49 76 67 99 . 9 78 24 56 93 11 24 10 3 1 2 82 99 . run; I used the following code: data data_1; set data; array DXCCS DXCCS1-DXCCS5; do h=1 to dim(DXCCS); if DXCCS(h) ne . then do; if nccs_CCS = . and (DXCCS(h)>11 and DXCCS(h)<45) then nccs = DXCCS(h); end; end; run; Can someone help me fix it. Thank you and have a wonderful weekend! Rube
... View more
05-14-2021
04:48 PM
Thank you very much for the help! Completed the home assignment! year4. Have a wonderful weekend! Rube
... View more