Hi experts, http://r.789695.n4.nabble.com/file/n4034318/Parametric_survival_analysis_2nd-order_efffect.JPG Parametric_survival_analysis_2nd-order_efffect.JPG As we know a normal survival regression is the equation (1) Well, I'ld like to modify it to be 2nd-order interaction model as shown in equation(2) Question: Assume a and z is two covariates. x = dummy variable (1 or 0) z = factors (peoples' name) fit <- survreg(Surv(time,censor)~x*z, data=sample, dist="exponential") I tried to apply survreg(), while I have few questions: 1) If */survreg(Surv(time,censor)~x*z, data=sample, dist="exponential")/* correct? 2) If the baseline hazard is the value excluded both x and z effects? 3) How can I get the value and plot the hazard with only x effect (but exclude effect z) Thanks Best, Ryusuke -- View this message in context: http://r.789695.n4.nabble.com/Second-order-effect-in-Parametric-Survival-Analysis-tp4034318p4034318.html Sent from the R help mailing list archive at Nabble.com.
Second-order effect in Parametric Survival Analysis
4 messages · ryusuke, David Winsemius
On Nov 12, 2011, at 7:37 AM, ryusuke wrote:
Hi experts, http://r.789695.n4.nabble.com/file/n4034318/Parametric_survival_analysis_2nd-order_efffect.JPG Parametric_survival_analysis_2nd-order_efffect.JPG As we know a normal survival regression is the equation (1) Well, I'ld like to modify it to be 2nd-order interaction model as shown in equation(2) Question: Assume a and z is two covariates. x = dummy variable (1 or 0) z = factors (peoples' name) fit <- survreg(Surv(time,censor)~x*z, data=sample, dist="exponential") I tried to apply survreg(), while I have few questions: 1) If */survreg(Surv(time,censor)~x*z, data=sample, dist="exponential")/* correct?
The formula interface for R would expand x*z to x + z + x:z (Which is not the formula in your Nabble-provided-jpg, but from your later questions is probably what you want anyway.)
2) If the baseline hazard is the value excluded both x and z effects?
Maybe. You won't be "excluding" them so much as holding their values jointly at zero, which may or may not be the same thing.
3) How can I get the value and plot the hazard with only x effect (but exclude effect z)
You will never be able to do so. If you have an interacting variable in a model, there will always be an effect of that covariate on predictions associated with any covariate with which it is interacting. You should be able to display or plot the ""x- effects" (note the plural) that are estimated for chosen levels of z, however. To accomplish that you should construct an appropriate data.frame and offer it as the newdata argument to predict(fit) .... just as you would do with any properly constructed R/S regression package. There is a worked example on this posting from the Master: http://finzi.psych.upenn.edu/Rhelp10/2010-May/240458.html
David Winsemius, MD West Hartford, CT
Thank you Dr. David. I try to summarize it. Assumes x and z are two covariates: x = dummy variable (1 or 0) z = factors (people name) x*z = x + z + x*z therefore this is not a 2nd-order interactions, it should be (for an exponential survival regression):- h(t|(X=x,Z=z)) = exp(Beta0 + XZBeta1) #--------------------------------------------------- I believe there is no 2nd-order interactions survival regression as I searched over www.rseek.org. While I tried to read through the codes of survreg(), I stuck (cannot understand) at survreg6.c survreg6.c apply C Language which involves Cholesky decomposition multi-matrix (first-order interactions) calculation. 1) chinv2.c 2) cholesky3.c 3) chsolve2.c (only solve the equations of first-order interactions) If someone gives some idea or suggestion on these? Thank you. Best, Ryusuke -- View this message in context: http://r.789695.n4.nabble.com/Second-order-effect-in-Parametric-Survival-Analysis-tp4034318p4036005.html Sent from the R help mailing list archive at Nabble.com.
On Nov 13, 2011, at 12:51 AM, ryusuke wrote:
Thank you Dr. David. I try to summarize it. Assumes x and z are two covariates: x = dummy variable (1 or 0) z = factors (people name) x*z = x + z + x*z
Actually I said = x + z + x:z And interaction formula of a two level dummy with a multi-level factor would produce and intercept (which would be for the first person's name), a coefficient for each of other names at level zero, a dummy coefficient (for the first person), and interaction coefficients of each person at the 1-level.
therefore this is not a 2nd-order interactions, it should be (for an exponential survival regression):- h(t|(X=x,Z=z)) = exp(Beta0 + XZBeta1)
If Beta1 is not a vector in this instance, with a distinct value for each(x,z) pairing, then I am unable to make sense out of that model. The questin remains however whether you are also expecting Beta0 to also be distinct for each specific combination of covariates.
#--------------------------------------------------- I believe there is no 2nd-order interactions survival regression as I searched over www.rseek.org. While I tried to read through the codes of survreg(), I stuck (cannot understand) at survreg6.c survreg6.c apply C Language which involves Cholesky decomposition multi-matrix (first-order interactions) calculation. 1) chinv2.c 2) cholesky3.c 3) chsolve2.c (only solve the equations of first-order interactions)
That level of implementation should be addressed to a person with higher levels of knowledge: Therneau or Lumley are the two names that immediately come to mind.
If someone gives some idea or suggestion on these? Thank you. Best, Ryusuke -- View this message in context: http://r.789695.n4.nabble.com/Second-order-effect-in-Parametric-Survival-Analysis-tp4034318p4036005.html Sent from the R help mailing list archive at Nabble.com.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD West Hartford, CT