02-16-2021
riyaaora275
Obsidian | Level 7
Member since
12-19-2017
- 22 Posts
- 5 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by riyaaora275
Subject Views Posted 1563 02-10-2021 03:18 PM 938 02-04-2021 12:57 PM 624 02-04-2021 12:53 PM 4490 02-02-2021 12:22 PM 621 10-01-2020 08:00 AM 936 08-05-2020 12:14 PM 991 08-05-2020 10:06 AM 1345 05-12-2020 03:40 AM 1010 05-07-2020 11:02 AM 1471 05-04-2020 09:20 AM -
Activity Feed for riyaaora275
- Posted proc glm : difference in dependent variable adjusted for covariates on Statistical Procedures. 02-10-2021 03:18 PM
- Posted Kaplan Meier plot , how to change the class legend on SAS Programming. 02-04-2021 12:57 PM
- Posted Kaplan meier plot offsetmin not working on SAS Programming. 02-04-2021 12:53 PM
- Posted Modify proc lifetest axis lables and titles on Statistical Procedures. 02-02-2021 12:22 PM
- Posted cox proportional model - interpretation on Statistical Procedures. 10-01-2020 08:00 AM
- Posted Re: Proc PS Match not using all the input data on Statistical Procedures. 08-05-2020 12:14 PM
- Posted Proc PS Match not using all the input data on Statistical Procedures. 08-05-2020 10:06 AM
- Posted Proc lIfetest : Different results from product-limit-estimate table and atrisk on Statistical Procedures. 05-12-2020 03:40 AM
- Posted Ods select: how to save result on ODS and Base Reporting. 05-07-2020 11:02 AM
- Posted Proc lifetest mean calculation on Statistical Procedures. 05-04-2020 09:20 AM
- Posted Re: Merge giving wrong result on SAS Programming. 01-18-2019 04:25 AM
- Posted Merge giving wrong result on SAS Programming. 01-18-2019 01:28 AM
- Posted Re: Merge statement giving wrong result on SAS Programming. 01-18-2019 12:21 AM
- Posted Re: Merge statement giving wrong result on SAS Programming. 01-18-2019 12:20 AM
- Posted Merge statement giving wrong result on SAS Programming. 01-16-2019 02:46 AM
- Posted creating a variable which is based on information given between first. and last. of other var on SAS Programming. 10-31-2018 07:21 AM
- Liked Re: Why do numerical values with a character format work as numbers when applying mathematical funct for RW9. 08-13-2018 04:32 AM
- Liked Re: Why do numerical values with a character format work as numbers when applying mathematical funct for art297. 08-10-2018 08:18 AM
- Liked Re: Why do numerical values with a character format work as numbers when applying mathematical funct for CalleJ. 08-10-2018 08:18 AM
- Posted Why do numerical values with a character format work as numbers when applying mathematical functions on SAS Programming. 08-10-2018 08:00 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1
02-10-2021
03:18 PM
I have a dependent variable - y
and independent vars -
cate has two levels - A and B
gender has two levels Male and female
adh has two levels - 0 and 1
proc glm data=change ;
class cate gender ;
model y= class sex age adh adh*class /solution;
lsmeans cate /pdiff e; lsmeans cate*adh / pdiff e;
estimate 'A vs B' cate 1 -1/e ;
run;
want :
1. Difference in y between class a and class b ( adjusted for sex and age adh )
2. Difference in y between class a and class b split by adh ( adjusted for sex and age)
which statement would give me these results ?
1. lsmeans ?
2. estimate statement ?
3. solution option - parameter estimates ?
... View more
02-04-2021
12:57 PM
The class variable has 1 and 2 in front of it , how do i remove it?
proc template ;
define statgraph Stat.Lifetest.Graphics.ProductLimitSurvival2;
dynamic NStrata xName plotAtRisk plotCensored plotCL plotHW plotEP labelCL labelHW labelEP maxTime xtickVals xtickValFitPol
rowWeights method StratumID classAtRisk plotTest GroupName Transparency SecondTitle TestName pValue _byline_ _bytitle_
_byfootnote_;
BeginGraph;
if (NSTRATA=1)
if (EXISTS(STRATUMID))
entrytitle &titletext1;
else
entrytitle &titletext0;
endif;
entrytitle "xyz2" / textattrs=GRAPHVALUETEXT;
layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
cell;
layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS
tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&yaxis" shortlabel="Survival" offsetmin=0 linearopts=(
viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
if (PLOTHW=1 AND PLOTEP=0)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="HW" legendlabel=LABELHW;
endif;
if (PLOTHW=0 AND PLOTEP=1)
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="EP" legendlabel=LABELEP;
endif;
if (PLOTHW=1 AND PLOTEP=1)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHDATA1 datatransparency=.55 name="HW" legendlabel=LABELHW;
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHDATA2 datatransparency=.55 name="EP" legendlabel=LABELEP;
endif;
if (PLOTCL=1)
if (PLOTHW=1 OR PLOTEP=1)
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" display=(
outline) outlineattrs=GRAPHPREDICTIONLIMITS name="CL" legendlabel=LABELCL;
else
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="CL" legendlabel=LABELCL;
endif;
endif;
stepplot y=SURVIVAL x=TIME / name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT) tiplabel=(_tip1="Number at Risk"
_tip2="Observed Events") tip=(x y _tip1 _tip2) legendlabel="Survival";
if (PLOTCENSORED=1)
scatterplot y=CENSORED x=TIME / markerattrs=(symbol=plus) tiplabel=(y="Survival Probability") name="Censored"
legendlabel="Censored";
endif;
if (PLOTCL=1 OR PLOTHW=1 OR PLOTEP=1)
discretelegend "Censored" "CL" "HW" "EP" / location=outside halign=center;
else
if (PLOTCENSORED=1)
discretelegend "Censored" / location=inside autoalign=(topright bottomleft);
endif;
endif;
endlayout;
endcell;
cell;
layout overlay / walldisplay=none xaxisopts=(display=none);
axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt);
drawtext 'Number at Risk' / x=3 y=20 width=9;
endlayout;
endcell;
endlayout;
else
entrytitle &titletext1;
if (EXISTS(SECONDTITLE))
entrytitle SECONDTITLE / textattrs=GRAPHVALUETEXT;
endif;
layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
cell;
layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS
tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&yaxis." shortlabel="Survival" offsetmin=0 linearopts=(
viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
if (PLOTHW=1)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
if (PLOTEP=1)
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
if (PLOTCL=1)
if (PLOTHW=1 OR PLOTEP=1)
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" display=(outline) outlineattrs=(pattern=ShortDash);
else
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
endif;
stepplot y=SURVIVAL x=TIME / group=STRATUM index=STRATUMNUM name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT)
tiplabel=(_tip1="Number at Risk" _tip2="Observed Events") tip=(x y _tip1 _tip2);
if (PLOTCENSORED=1)
scatterplot y=CENSORED x=TIME / group=STRATUM index=STRATUMNUM tiplabel=(y="Survival Probability") markerattrs
=(symbol=plus);
endif;
DiscreteLegend "Survival" / title=GROUPNAME location=outside ;
if (PLOTCENSORED=1)
if (PLOTTEST=1)
layout gridded / rows=2 autoalign=(TOPRIGHT ) border=false BackgroundColor=
GraphWalls:Color Opaque=true;
entry "+ Censored";
if (PVALUE < .0001)
entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
else
entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
endif;
endlayout;
else
layout gridded / rows=1 autoalign=(TOPRIGHT ) border=false BackgroundColor=
GraphWalls:Color Opaque=true;
entry "+ Censored";
endlayout;
endif;
else
if (PLOTTEST=1)
layout gridded / rows=1 autoalign=(TOPRIGHT BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=
GraphWalls:Color Opaque=true;
if (PVALUE < .0001)
entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
else
entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
endif;
endlayout;
endif;
endif;
endlayout;
endcell;
cell;
layout overlay / walldisplay=none xaxisopts=(display=none);
axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt) class=CLASSATRISK colorgroup=CLASSATRISK ;
drawtext 'Number at Risk' / x=3 y=55 width=9 rotate= 90;
endlayout;
endcell;
endlayout;
endif;
if (_BYTITLE_)
entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
else
if (_BYFOOTNOTE_)
entryfootnote halign=left _BYLINE_;
endif;
endif;
EndGraph;
end;
which part of the template code do I need to change for this ?
... View more
02-04-2021
12:53 PM
I want to shift the x axis to origin
proc template ;
define statgraph Stat.Lifetest.Graphics.ProductLimitSurvival2;
dynamic NStrata xName plotAtRisk plotCensored plotCL plotHW plotEP labelCL labelHW labelEP maxTime xtickVals xtickValFitPol
rowWeights method StratumID classAtRisk plotTest GroupName Transparency SecondTitle TestName pValue _byline_ _bytitle_
_byfootnote_;
BeginGraph;
if (NSTRATA=1)
if (EXISTS(STRATUMID))
entrytitle &titletext1;
else
entrytitle &titletext0;
endif;
entrytitle "xyz2" / textattrs=GRAPHVALUETEXT;
layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
cell;
layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS
tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&yaxis" shortlabel="Survival" offsetmin=0 linearopts=(
viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
if (PLOTHW=1 AND PLOTEP=0)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="HW" legendlabel=LABELHW;
endif;
if (PLOTHW=0 AND PLOTEP=1)
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="EP" legendlabel=LABELEP;
endif;
if (PLOTHW=1 AND PLOTEP=1)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHDATA1 datatransparency=.55 name="HW" legendlabel=LABELHW;
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHDATA2 datatransparency=.55 name="EP" legendlabel=LABELEP;
endif;
if (PLOTCL=1)
if (PLOTHW=1 OR PLOTEP=1)
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" display=(
outline) outlineattrs=GRAPHPREDICTIONLIMITS name="CL" legendlabel=LABELCL;
else
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
GRAPHCONFIDENCE name="CL" legendlabel=LABELCL;
endif;
endif;
stepplot y=SURVIVAL x=TIME / name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT) tiplabel=(_tip1="Number at Risk"
_tip2="Observed Events") tip=(x y _tip1 _tip2) legendlabel="Survival";
if (PLOTCENSORED=1)
scatterplot y=CENSORED x=TIME / markerattrs=(symbol=plus) tiplabel=(y="Survival Probability") name="Censored"
legendlabel="Censored";
endif;
if (PLOTCL=1 OR PLOTHW=1 OR PLOTEP=1)
discretelegend "Censored" "CL" "HW" "EP" / location=outside halign=center;
else
if (PLOTCENSORED=1)
discretelegend "Censored" / location=inside autoalign=(topright bottomleft);
endif;
endif;
endlayout;
endcell;
cell;
layout overlay / walldisplay=none xaxisopts=(display=none);
axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt);
drawtext 'Number at Risk' / x=3 y=20 width=9;
endlayout;
endcell;
endlayout;
else
entrytitle &titletext1;
if (EXISTS(SECONDTITLE))
entrytitle SECONDTITLE / textattrs=GRAPHVALUETEXT;
endif;
layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
cell;
layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS
tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&yaxis." shortlabel="Survival" offsetmin=0 linearopts=(
viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
if (PLOTHW=1)
bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
if (PLOTEP=1)
bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
if (PLOTCL=1)
if (PLOTHW=1 OR PLOTEP=1)
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" display=(outline) outlineattrs=(pattern=ShortDash);
else
bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
modelname="Survival" datatransparency=Transparency;
endif;
endif;
stepplot y=SURVIVAL x=TIME / group=STRATUM index=STRATUMNUM name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT)
tiplabel=(_tip1="Number at Risk" _tip2="Observed Events") tip=(x y _tip1 _tip2);
if (PLOTCENSORED=1)
scatterplot y=CENSORED x=TIME / group=STRATUM index=STRATUMNUM tiplabel=(y="Survival Probability") markerattrs
=(symbol=plus);
endif;
DiscreteLegend "Survival" / title=GROUPNAME location=outside ;
if (PLOTCENSORED=1)
if (PLOTTEST=1)
layout gridded / rows=2 autoalign=(TOPRIGHT ) border=false BackgroundColor=
GraphWalls:Color Opaque=true;
entry "+ Censored";
if (PVALUE < .0001)
entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
else
entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
endif;
endlayout;
else
layout gridded / rows=1 autoalign=(TOPRIGHT ) border=false BackgroundColor=
GraphWalls:Color Opaque=true;
entry "+ Censored";
endlayout;
endif;
else
if (PLOTTEST=1)
layout gridded / rows=1 autoalign=(TOPRIGHT BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=
GraphWalls:Color Opaque=true;
if (PVALUE < .0001)
entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
else
entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
endif;
endlayout;
endif;
endif;
endlayout;
endcell;
cell;
layout overlay / walldisplay=none xaxisopts=(display=none);
axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt) class=CLASSATRISK colorgroup=CLASSATRISK ;
drawtext 'Number at Risk' / x=3 y=55 width=9 rotate= 90;
endlayout;
endcell;
endlayout;
endif;
if (_BYTITLE_)
entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
else
if (_BYFOOTNOTE_)
entryfootnote halign=left _BYLINE_;
endif;
endif;
EndGraph;
end;
I have set offsetmin to 0 in xaxisopts , but it doesn't work. Any other way to do it/?
... View more
02-02-2021
12:22 PM
I need to modify the Label and x / y axis of the Kaplan Meier curve. I modify the template due to restrictions on my system.
Codes I have tried -
title 'KM';
axis1 label= ("yaxis");
axis2 label= ('xaxis');
proc lifetest data=graph3 DESCRIPTION='xyz'
maxtime =1000 plots=(survival ( atrisk=0 to 2500 by 250 outside nocensor ) );
time time*status(0);
strata class;
/*weight wgt;*/
/*title 'KM curve';*/
/*title2 'xyz';*/
/*axis1 label=( 'xaxis');*/
/*label time = 'days';*/
run;
Nothing seems to work.
I also need to modify the strata label names as well.
Any other commands that I can use?
... View more
10-01-2020
08:00 AM
I have applied a cox proportional model on discontinuation data . There are two groups and OD and OW.
If the hazard ratio from cox proportional model is such-
Class
HR
OD
1.456
Then do can we interpret it as OW are 45.6%more likely to stay on treatment as compared to OD? Or should we say OD are 45.6% more likely to discontinue? Or do they mean the same?
... View more
08-05-2020
12:14 PM
yes
... View more
08-05-2020
10:06 AM
I have used the following code -
proc psmatch data = x;
class a b c cate;
psmodel cate(Treated = 'On') = a b c d ;
match method = greedy(k=1) ;
assess lps var=(a b c d )/plots = all weight = none;
output out(obs=match)= y;
run;
however the treated group has 6000 obs and control has 8000 obs , then why is the number of obs used 1134 and 1411 ?
... View more
05-12-2020
03:40 AM
Hi, My code - ods output productlimitestimates = sds ;
proc lifetest data=graph2_B_G timelist= 0 100 200 300 400 500 600 700 800 900 1000 plots=(survival( atrisk=0 to 1000 by 100 ) )maxtime = 1000;
time time*status(0);
strata drg_class_detail;
run; The numbers that i get from the product-limit-estimate table (number surviving) are not the same as the numbers i get on the graph with the atrisk number. Can anyone please help explain why that is the case? What is the difference in the calculation? even the numbers for the time-0 are different Eg; Atrisk Product-lim-estimate time group1 group2 group1 group2 0 2050 2050 2043 2048 100 1454 1481 1451 1480 200 1186 1217 1182 1213 300 894 848 892 845
... View more
05-07-2020
11:02 AM
Hi , I am using the code- ods select productlimitestimates=d99;
proc lifetest data=graph2_B_G plots= survival(strata = overlay);
time time*status(0);
strata drg_class_detail;
run; If i remove the =d99 from ods select the code works otherwise I get syntax error . Why is that? How do I save the dataset?
... View more
05-04-2020
09:20 AM
I have calculated the mean and median survival time from proc lifetest proc lifetest data=graph2;
ods output means = mean_surv quartiles= median_surv;
time time*status(0);
strata brand;
run; However I cannot understand how this is calculated. data have ;
input ID start_dt date9. end_dt date9. membership_end_dt date9. status brand ;
datalines;
1 01Jan2012 02Feb2013 02Sep2013 1 a
2 15Jan2012 25Feb2013 02Sep2012 0 a
3 19Jan2012 12Feb2013 22Sep2013 1 a
4 22Jan2012 06Feb2013 02Sep2012 0 b
5 01Jan2012 02Feb2013 02Sep2013 1 c
;
data have2;
set have;
cal_end = min(end_date,membership_end_dt );
time = cal_end - start_date ;
format cal_end date9.;
run; This data is medication use data, we have the start and end date of episodes for each ID and membership end date as well. If the end_date of episode is greater than the membership date then we censor that to the membership end date( as we dont want to measure the time on medication if the ID is not enrolled) . Status is the variable which which IDs are censored. I use the proc lifetest on have2 dataset and measure the mean and quartiles. Q1what is the formula used for measuring this mean? .If I use the have2 dataset to measure mean time then I get a very different result. why is that? Q2. why are quartiles missing for some brands?
... View more
01-18-2019
01:28 AM
data tst1;
input a $ yr b;
datalines ;
a 2000 1
b 2000 2
b 2003 3
c 1996 4
d 2013 3
;
run;
data tst2;
input a $ yr c;
datalines ;
a 2000 10
b 2003 13
d 2000 13
;
run;
proc sort data = tst1 ; by a;run;
proc sort data = tst2 ; by a;run;
data tst3;
merge tst1 (in=x) tst2 (in=y);
by a;
if x then output;
run; When I run this the result is a yr b c a 2000 1 10 b 2003 2 13 b 2003 3 13 c 1996 4 . d 2000 3 13 Why am I getting the same year value for b? year corresponding to b =2 in tst1 is 2000
... View more
01-18-2019
12:21 AM
You mean I should give some sample data ? Because I cannot give the datafiles.
... View more
01-16-2019
02:46 AM
I have two tables- I want to remove all the year+enrolids combinations which are common in both tables. Table1 has more observations than table2. code- data merge;
merge table1( in=a) table2(in=b);
by year enrolid;
if a and not b then output;
run;
Now the merge dataset should have observation count equal to count of table1 - count of table2. but that isnt the case. Is there anything wrong with the code?
... View more