similar to: Variable centring within "predict.coxph"

Displaying 20 results from an estimated 5000 matches similar to: "Variable centring within "predict.coxph""

2010 Aug 11
4
Arbitrary number of covariates in a formula
Hello! I have something like this: test1 <- data.frame(intx=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x1=c(0,2,1,1,1,0,0), x2=c(1,1,0,0,2,2,0), sex=c(0,0,0,0,1,1,1)) and I can easily fit a cox model: library(survival) coxph(Surv(intx,status) ~ x1 + x2 + strata(sex),test1) However, I want to
2011 Jun 28
1
parallel computing with 'foreach'
Hi all, I would like to parallelize some R code and would like to use the 'foreach' package with a foreach loop. However, whenever I call a function from an enabled package outside of MASS, I get an error message that a number of the functions aren't recognized (even though the functions should be defined). For example: library(foreach) library(doSMP) library(survival) # Create the
2013 Nov 14
1
issues with calling predict.coxph.penal (survival) inside a function
Thanks for the reproducable example. I can confirm that it fails on my machine using survival 2-37.5, the next soon-to-be-released version, The issue is with NextMethod, and my assumption that the called routine inherited everything from the parent, including the environment chain. A simple test this AM showed me that the assumption is false. It might have been true for Splus. Working this
2009 Aug 19
2
Problem with predict.coxph
We occasionally utilize the coxph function in the survival library to fit multinomial logit models. (The breslow method produces the same likelihood function as the multinomial logit). We then utilize the predict function to create summary results for various combinations of covariates. For example:
2011 Feb 03
3
coxph fails to survfit
I have a model with quant vars only and the error message does not make sense: (mod1 <- coxph(Surv(time=strt,time2=stp,event=(resp==1))~ +incpost+I(amt/1e5)+rate+strata(termfac), subset=dt<"2010-08-30", data=inc,method="efron")) Call: coxph(formula = Surv(time = strt, time2 = stp, event = (resp == 1)) ~ +incpost + I(amt/1e+05) + rate + strata(termfac),
2010 Sep 08
4
coxph and ordinal variables?
Dear R-help members, Apologies - I am posting on behalf of a colleague, who is a little puzzled as STATA and R seem to be yielding different survival estimates for the same dataset when treating a variable as ordinal. Ordered() is used to represent an ordinal variable) I understand that R's coxph (by default) uses the Efron approximation, whereas STATA uses (by default) the Breslow. but we
2009 Mar 26
1
Centring variables in Cox Proportional Hazards Model
Dear All, I am contemplating centering the covariates in my Cox model to reduce multicollinearity between the predictors and the interaction term and to render a more meaningful interpretation of the regression coefficient. Suppose I have two indicator variables, x1 and x2 which represent age categories (x1 is patients less than 16 while x2 is for patients older than 65). If I use the following
2017 Nov 28
0
Discourage the weights= option of lm with summarized data
Since the three posters agree (only) that there is a bug, I propose to file it as a bug, which is the least we can do now. There is more to it: the only other case of a change in the Reference Manual which I know of, is also about the weights option! This is in coxph. The Reference Manual version 3.0.0 (2013) says about coxph: " ... If weights is a vector of integers, then the estimated
2009 Mar 09
2
path analysis (misspecification?)
hi, I have following data and code; cov <- c (1.670028 ,-1.197685 ,-2.931445,-1.197685,1.765646,3.883839,-2.931445,3.883839,12.050816) cov.matrix <- matrix(cov, 3, 3, dimnames=list(c("y1","x1","x2"), c("y1","x1","x2"))) path.model <- specify.model() x1 -> y1, x1-y1 x2 <-> x1, x2-x1 x2 <->
2011 Apr 12
2
Testing equality of coefficients in coxph model
Dear all, I'm running a coxph model of the form: coxph(Surv(Start, End, Death.ID) ~ x1 + x2 + a1 + a2 + a3) Within this model, I would like to compare the influence of x1 and x2 on the hazard rate. Specifically I am interested in testing whether the estimated coefficient for x1 is equal (or not) to the estimated coefficient for x2. I was thinking of using a Chow-test for this but the Chow
2006 Nov 11
1
predict.lda is missing ?
I'm trying to classify some observations using lda and I'm getting a strange error. I loaded the MASS package and created a model like so: >train <- mod1[mod1$rand < 1.7,] >classify <- mod1[mod1$rand >= 1.7,] >lda_res <- lda(over_win ~ t1_scrd_a + t1_alwd_a, data=train, CV=TRUE) That works, and all is well until I try to do a prediction for the holdouts:
2012 Jan 04
1
Extract concordance from coxph.object
Dear all, As I said in my previous email I have just upgraded to R 2.14.0 on Windows 7. I have just run the 'coxph' function and notice that a Concordance statistic is produced. Is there any way to extract this information from the output? E.g. can I call the concordance value independently of calling the output? Many thanks, Laura [[alternative HTML version deleted]]
2010 Mar 25
1
nls, predict() problem
hello, can anyone help with this: ########################################################### ###data: measurments (response = trans) run several times at the same predictor value level (press) por<-data.frame(list(structure(list(run = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L), .Label = c("1", "3", "4"), class = "factor"), press
2004 Feb 16
1
understanding loops for "loop-plotting"
Hi, i make some practice on "loops" to understand this important issue in "difference" to the wrappers like apply finally! The point is that i want plot's for different different const and wish in one pdf the 5 plots . So i want plots for const=1:5 which change the undelying data expressed in t1 and t2. I attempt some trials , while, for and now repeat loop now ,
2012 Nov 27
4
Fitting and plotting a coxph with survfit, package(surv)
Hi Dear R-users I have a database with 18000 observations and 20 variables. I am running cox regression on five variables and trying to use survfit to plot the survival based on a specific variable without success. Lets say I have the following coxph: >library(survival) >fit <- coxph(Surv(futime, fustat) ~ age + rx, data = ovarian) >fit what I am trying to do is plot a survival
2002 Jul 09
1
lines(predict(nls()) with NA's
Dear List, my exploration of R goes on... And I REALLY enjoy it ! (thanks to all guRus). Yesterday a colleague ask me for fitting some data presented as a data.frame, something like : >a x X158.7 X150.0 ... 1 -0.25 506 183.1 2 -0.75 633 210.7 3 -1.25 674 220.3 4 -1.50 NA 244.6 5 -1.75 742 261.2 6 -2.25 787 269.1 7 -2.50 NA 283.5 8
2010 Jan 28
2
Data.frame manipulation
Hi All, I'm conducting a meta-analysis and have taken a data.frame with multiple rows per study (for each effect size) and performed a weighted average of effect size for each study. This results in a reduced # of rows. I am particularly interested in simply reducing the additional variables in the data.frame to the first row of the corresponding id variable. For example:
2017 Oct 12
4
Discourage the weights= option of lm with summarized data
OK. We have now three suggestions to repair the text: - remove the text - add "not" at the beginning of the text - add at the end of the text a warning; something like: "Note that in this case the standard estimates of the parameters are in general not correct, and hence also the t values and the p value. Also the number of degrees of freedom is not correct. (The parameter
2009 Mar 05
1
problems with nls?
I need to make nonlinear regression with the posterior script, but how is the problem? I have error in library (nls), package 'nls' has been merged into 'stats'. I need help? What other forms I have to make nonlinear regression? and how I find to calculate statistics y residuals, scatterplot. thanks SCRIPT ros<-read.table("Dataset.csv",header=T,sep=",")
2012 Jun 29
1
number of items to replace is not a multiple of replacement length
Hello, I'm a complete newbie to R so sorry if this is too basic..:-S I have to modify some scripts someone else did to make it work with my data. For some reason, one of the scripts which were supposed to work is not, and I get the error message "number of items to replace is not a multiple of replacement length". The script is this one: *open_lpj_nc_gpp <-