Replies: 9 comments 5 replies
-
|
If it is your first DCA, I strongly recommend not doing the 95% CI. They actually have questionable value (see https://pubmed.ncbi.nlm.nih.gov/37277840/) With respect to the "baseline_surv" that is just a variable you create as an intermediate step (you can call it what you like). I wouldn't worry too much about how it is calculated, but if interested, go to the Stata pdf reference manual and look up "stcox" With respect to your error in "gen risk5y" this is because you forgot a ` symbol i.e. you wrote 1 - base'^exp(xbeta) instead of 1 - `base'^exp(xbeta) |
Beta Was this translation helpful? Give feedback.
-
|
Do you have a local statistician that can help you? the error you made is really quite straightforward and basic and I'm not sure it is best for you to be getting "help at a distance" for this sort of thing.
Andrew
From: mvb17 ***@***.***>
Reply-To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Date: Monday, September 11, 2023 at 8:22 AM
To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Cc: "Vickers, Andrew" ***@***.***>, Comment ***@***.***>
Subject: [EXTERNAL] Re: [MSKCC-Epi-Bio/decisioncurveanalysis] Can’t plot upper bounds and lower bounds (Discussion #7)
Hello again So after some reflection stcox var1 var2 var3, basesurv(surv_function) ///saving out baseline survival *get linear predictor for calculation of risk predict xb, xb sum xb, detail predict se, stdp *baseline survival at time 5 years
[Screenshot 2023-09-11 at 13 16 54]<https://urldefense.com/v3/__https:/user-images.githubusercontent.com/126494471/267015678-6e8afcd9-510a-47d1-9703-46334e94b55b.png__;!!KVWo1iE!WuZFgA8iERB_GmDgioaNe5V6-ANvtRwB2NdU1qv7mbfQFO9SkGi1KyVLrpsxdeeunP-tQkhUSrdHP8RyGd9BkIY$>Hello again
So after some reflection
stcox var1 var2 var3, basesurv(surv_function) ///saving out baseline survival
*get linear predictor for calculation of risk
predict xb, xb
sum xb, detail
predict se, stdp
*baseline survival at time 5 years
sum surv_funct if _t <=5
**We want survival closest to 5 years = 60 months , this is lowest survival rate for all survival times < 5 years
local base =r(min)
**Generate 5 year risk using baseline survival converts into a probability
gen risk5y= 1-`base'^exp(xb) // converts to a probability
label var risk5y "pROBABILITY OF FAILURE AT 5 YEARS"
*plot 5 year probability
two-way (line risk5y var1, sort clap(solid solid) clwidth (medthick thin) clcolor (gs0 gso)), ytitle(5 year probability of failure, margin(medium)) label (75(5)100, angle(horizontal) no grid) xtitle(experience (number of cases), margin(medium)) (150)250) legend(off) scheme(s2mono) graphregion(fcolor(white))
I get this graph which is not what I expected, do I have something wrong with my data?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/MSKCC-Epi-Bio/decisioncurveanalysis/discussions/7*discussioncomment-6967073__;Iw!!KVWo1iE!WuZFgA8iERB_GmDgioaNe5V6-ANvtRwB2NdU1qv7mbfQFO9SkGi1KyVLrpsxdeeunP-tQkhUSrdHP8RyurjnSCY$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVDIPRRKGT4HUHAS3B47I5TXZ366JANCNFSM6AAAAAA4H27BSQ__;!!KVWo1iE!WuZFgA8iERB_GmDgioaNe5V6-ANvtRwB2NdU1qv7mbfQFO9SkGi1KyVLrpsxdeeunP-tQkhUSrdHP8Ryy1avcvU$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately I don't as most are employed in the corporate / private sector... I was only trying to test this... however I came across ddsjoberg's github with dca command... which may perhaps me easier... however if it's a small error would appreciate your expertise |
Beta Was this translation helpful? Give feedback.
-
|
You aren't looking at the marginals. In a model where you have v1 v2 and v3 and predictors, the predicted value with vary for patients with the same level of v1 depending on their value of v2 and v3
From: mvb17 ***@***.***>
Reply-To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Date: Monday, September 11, 2023 at 11:10 AM
To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Cc: "Vickers, Andrew" ***@***.***>, Comment ***@***.***>
Subject: [EXTERNAL] Re: [MSKCC-Epi-Bio/decisioncurveanalysis] Can’t plot upper bounds and lower bounds (Discussion #7)
Unfortunately I don't as most are employed in the corporate / private sector. . . I was only trying to test this. . . however I came across ddsjoberg's github with dca command. . . which may perhaps me easier. . . however if it's a small error would
Unfortunately I don't as most are employed in the corporate / private sector... I was only trying to test this... however I came across ddsjoberg's github with dca command... which may perhaps me easier... however if it's a small error would appreciate your expertise
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/MSKCC-Epi-Bio/decisioncurveanalysis/discussions/7*discussioncomment-6968970__;Iw!!KVWo1iE!X5e-vknV5CDLuYTBYMHvvaVxBD_2mvjnaP_-pWAJ2uOPGHSXNtfoo8Lva8KhiyF-6h1Olwche1dkI-WrZOihdDg$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVDIPRWDYYDOR6WDN6OSBQ3XZ4SXVANCNFSM6AAAAAA4H27BSQ__;!!KVWo1iE!X5e-vknV5CDLuYTBYMHvvaVxBD_2mvjnaP_-pWAJ2uOPGHSXNtfoo8Lva8KhiyF-6h1Olwche1dkI-Wr9CyUXSI$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.
-
|
I am no statistician and use the internet as a learning platform. Thank you for pointing this out. |
Beta Was this translation helpful? Give feedback.
-
|
The code would something like
G tempv2=v2
G tempv3=v3
Stcox v1 tempv1 tempv2
Sum v2
Replace tempv2=r(mean)
Sum v3
Replace tempv3=r(mean)
Predict xb
However, I seriously suggest that you do not try to teach yourself stats on the internet but take some courses with a teacher
From: mvb17 ***@***.***>
Reply-To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Date: Monday, September 11, 2023 at 11:22 AM
To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Cc: "Vickers, Andrew" ***@***.***>, Comment ***@***.***>
Subject: [EXTERNAL] Re: [MSKCC-Epi-Bio/decisioncurveanalysis] Can’t plot upper bounds and lower bounds (Discussion #7)
I am no statistician and use the internet as a learning platform. Thank you for pointing this out. Do you mean creating the average values for var1 - var 4, then introducing these averages into the cox model and predicting from here ? —Reply
I am no statistician and use the internet as a learning platform. Thank you for pointing this out.
Do you mean creating the average values for var1 - var 4, then introducing these averages into the cox model and predicting from here ?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/MSKCC-Epi-Bio/decisioncurveanalysis/discussions/7*discussioncomment-6969099__;Iw!!KVWo1iE!TKfBptyAT8paABhoaCz7quPkTi1pz9MEyYyEWIdEMsUGW0xyL8qsEBLl1XpJMjBxGbGAFfw5V8koh873JZastPg$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVDIPRUYF63OK4OL6G3HW3DXZ4UDTANCNFSM6AAAAAA4H27BSQ__;!!KVWo1iE!TKfBptyAT8paABhoaCz7quPkTi1pz9MEyYyEWIdEMsUGW0xyL8qsEBLl1XpJMjBxGbGAFfw5V8koh873ivzmu3Y$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.
-
|
In the context of this statistical application, it is perfectly appropriate to use the mean for a categorical variable.
From: mvb17 ***@***.***>
Reply-To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Date: Wednesday, September 13, 2023 at 12:09 PM
To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Cc: "Vickers, Andrew" ***@***.***>, Comment ***@***.***>
Subject: [EXTERNAL] Re: [MSKCC-Epi-Bio/decisioncurveanalysis] Can’t plot upper bounds and lower bounds (Discussion #7)
Thank you I took on your advice and paid for a stats tutor. . . . Not every stats person is well read into the stats you do. . . I just wanted to clarify, with regards to centring the mean, this is only for continuous variables right. As it won't
Thank you I took on your advice and paid for a stats tutor....Not every stats person is well read into the stats you do...
I just wanted to clarify, with regards to centring the mean, this is only for continuous variables right. As it won't make sense to use gender - as you can't have a 0.5 of gender...
unfortunaely from a student's perspective it's a lot of money paying for a stats tutor.
Your resources are great.
Thanks for your contribution to the stats world.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/MSKCC-Epi-Bio/decisioncurveanalysis/discussions/7*discussioncomment-6992416__;Iw!!KVWo1iE!Q0XP0ZMkBZQRfaoXMKjlxkma0ftQ9t9N98FXQCTn_xgk86740HSB0QO1xZbmLk6ceaTpmFEiEkG5cm7VwHfoQ68$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVDIPRQYQOLNC24AK73Z5TDX2HLEPANCNFSM6AAAAAA4H27BSQ__;!!KVWo1iE!Q0XP0ZMkBZQRfaoXMKjlxkma0ftQ9t9N98FXQCTn_xgk86740HSB0QO1xZbmLk6ceaTpmFEiEkG5cm7VwA0LlLQ$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.
-
|
Hello, again. Apologies for asking another question. I just wanted to say I managed to plot the graph (see attached). Many thanks for your help. I've used the following STATA code .. However, I have a problem with the last bit (see below, I wonder if you can spot the problem? - it's not necessary as I still obtain the graph I require, but just curious to know what I'm doing wrong. gen modelage=age stcox c.yearlymesh* modelage modelgender modelprovider, basesurv(surf_function) sum modelage *Linear predictor for risk *baseline survival at time 10 years *obtain the lowest survival for all 10 years *converts into probability *conver to percentage *plot graph of 10y probability -- here is the problem //However I have something wrong here: I have tried the following options: I have tried adding another ) after % of y title |
Beta Was this translation helpful? Give feedback.
-
|
Try using the drop down menus for graphics and specify what you want. Then you can see how the code comes out on the command line.
From: mvb17 ***@***.***>
Reply-To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Date: Wednesday, November 22, 2023 at 1:36 PM
To: MSKCC-Epi-Bio/decisioncurveanalysis ***@***.***>
Cc: "Vickers, Andrew" ***@***.***>, Comment ***@***.***>
Subject: [EXTERNAL] Re: [MSKCC-Epi-Bio/decisioncurveanalysis] Can’t plot upper bounds and lower bounds (Discussion #7)
Hello, again. Apologies for asking another question. I just wanted to say I managed to plot the graph (see attached). Many thanks for your help. I've used the following STATA code .. However, I have a problem with the last bit (see below, I
Hello, again. Apologies for asking another question. I just wanted to say I managed to plot the graph (see attached). Many thanks for your help. I've used the following STATA code .. However, I have a problem with the last bit (see below, I wonder if you can spot the problem? - it's not necessary as I still obtain the graph I require, but just curious to know what I'm doing wrong.
gen modelage=age
gen modelgender= gender
gen modelprovider = provider
stcox c.yearlymesh* modelage modelgender modelprovider, basesurv(surf_function)
sum modelage
replace modelage=r(mean)
sum modelgender
replace modelgender=r(mean)
sum modelprovider
replace modelprovider=r(mean)
*Linear predictor for risk
predict xb, xb
sum xb, detail
predict se, stdp
*baseline survival at time 10 years
sum sure_funct if _t<=10
*obtain the lowest survival for all 10 years
local base=r(min)
*converts into probability
gen risk10y=1-`base'^exp(xb) //this converts to probability
label var risk10y "probability of failure at 10 years"
//My risk10y is a value between 0.07 - 0.19 *********
*plot graph of 10y probability -- here is the problem
twoway(line risk10y yearlymesh, sort clpat(solid solid) clwidth (medthick thin) clcolor (gs0 gs0)),
//till here the code is ok and it plots my graph( see attached)
//However I have something wrong here:
ytitle(10 year probability(%), margin(medium)) ylabel(75(5)100, angle(horizontal) nogrid) xtitle(experience(no of robotics), margin(medium)) (150)250) legend(off) scheme(s2mono) graphregion(colour(white))
I have tried the following options:
I have tried adding ) at ylabel - after the 100
Stata gave me the error: angle(horizontal) is not a two-wayplot type
I have tried adding another ) after % of y title
Stata gave me the error: option ( not allowed
Also my probability as indicated here ******* is between 0.07 to 0.19 --> this isn't a percentage....so I assume my y label will need to changed
[Image removed by sender. tempImagepAtw7z]<https://urldefense.com/v3/__https:/user-images.githubusercontent.com/126494471/285008632-8fb3eef2-de23-4fae-9bda-7beb046200ae.gif__;!!KVWo1iE!WNVuckDKrUWshcAn5_G9qN7-413ycfiEj9VhAH3JG_FJ16-OpfvPdKMGZtXpKlnIetNciQ2f0HlsaFx4D3R5jks$>
?
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/MSKCC-Epi-Bio/decisioncurveanalysis/discussions/7*discussioncomment-7645410__;Iw!!KVWo1iE!WNVuckDKrUWshcAn5_G9qN7-413ycfiEj9VhAH3JG_FJ16-OpfvPdKMGZtXpKlnIetNciQ2f0HlsaFx4Nllx-Jw$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVDIPRUVCORNQCBY5X4KBGDYFZA3RAVCNFSM6AAAAAA4H27BSSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNBVGQYTA__;!!KVWo1iE!WNVuckDKrUWshcAn5_G9qN7-413ycfiEj9VhAH3JG_FJ16-OpfvPdKMGZtXpKlnIetNciQ2f0HlsaFx499hI0e8$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hi trying to plot a decision analysis survival curve for the first time
Q1. I got stuck at the part of plotting upper and lower bounds - I get the error unknown function. I think it’s something mathematically incorrect, can anyone help ?
Q2. Can anyone explain what baseline sur
Using stata
[ST cox regression with finalised model predictors run]
stcox covar1 covar2, basesurv(surv_function)
*get linear predictor for calculation of risk
predict xb, xb
sum xb, detail.
predict se, stdp
*baseline survival at time 5 years = 60 months
sum surv_funct if _t <=60
**We want survival closest to 5 years = 60 months , this is lowest survival rate for all survival times < 5 years
local base =r(min)
**Generate 5 year risk using baseline survival converts into a probability
gen risk5y= 1-
base'^exp(xbeta) // converts to a probability g lowerbound= 1-base'^exp(xbeta)+ invnorm(0.975se) // unknown function **problem hereg upperboubd= 1-`base'^exp(xbeta)- invnorm(0.975se) //unknwon function **problem here
Beta Was this translation helpful? Give feedback.
All reactions