search for: sfitting

Displaying 20 results from an estimated 20 matches for "sfitting".

Did you mean: fitting
2007 Mar 09
2
Extracting the p of F statistics from lm
I need to extract the p value from a ANOVA done with lm model fitting <- lm(var ~ group) Sfitting <- summary(fitting) Sfitting[10][1] gives the F value and the degrees of freedom but I am not able to get the p value. The function df should give a p value given a F but I am not able to make it work. I found only something about aov in the R help and I am not able to make it work Massimo...
2011 Apr 05
6
simple save question
Hi, When I run the survfit function, I want to get the restricted mean value and the standard error also. I found out using the "print" function to do so, as shown below, print(km.fit,print.rmean=TRUE) Call: survfit(formula = Surv(diff, status) ~ 1, type = "kaplan-meier") records n.max n.start events *rmean *se(rmean) median 200.000
2012 May 16
1
survival survfit with newdata
Dear all, I am confused with the behaviour of survfit with newdata option. I am using the latest version R-2-15-0. In the simple example below I am building a coxph model on 90 patients and trying to predict 10 patients. Unfortunately the survival curve at the end is for 90 patients. Could somebody please from the survival package confirm that this behaviour is as expected or not - because I
2013 Nov 04
0
Fwd: Re: How to obtain nonparametric baseline hazard estimates in the gamma frailty model?
-------- Original Message -------- Subject: Re: How to obtain nonparametric baseline hazard estimates in the gamma frailty model? Date: Mon, 04 Nov 2013 17:27:04 -0600 From: Terry Therneau <therneau.terry at mayo.edu> To: Y <yuhanusa at gmail.com> The cumulative hazard is just -log(sfit$surv). The hazard is essentially a density estimate, and that is much harder. You'll notice
2012 Oct 11
2
Question on survival
Hi, I'm going crazy trying to plot a quite simple graph. i need to plot estimated hazard rate from a cox model. supposing the model i like this: coxPhMod=coxph(Surv(TIME, EV) ~ AGE+A+B+strata(C) data=data) with 4 level for C. how can i obtain a graph with 4 estimated (better smoothed) hazard curve (base-line hazard + 3 proportional) to highlight the effect of C. thanks!! laudan [[alternative
2012 May 07
1
estimating survival times with glmnet and coxph
Dear all, I am using glmnet (Coxnet) for building a Cox Model and to make actual prediction, i.e. to estimate the survival function S(t,Xn) for a new subject Xn. If I am not mistaken, glmnet (coxnet) returns beta, beta*X and exp(beta*X), which on its own cannot generate S(t,Xn). We miss baseline survival function So(t). Below is my code which takes beta coefficients from glmnet and creates coxph
2007 Dec 17
2
Capture warning messages from coxph()
Hi, I want to fit multiple cox models using the coxph() function. To do this, I use a for-loop and save the relevant results in a separate matrix. In the example below, only two models are fitted (my actual matrix has many more columns), one gives a warning message, while the other does not. Right now, I see all the warning message(s) after the for-loop is completed but have no idea which model
2004 Jul 04
2
smooth non cumulative baseline hazard in Cox model
Hi everyone. There's been several threads on baseline hazard in Cox model but I think they were all on cumulative baseline hazard, for instance http://tolstoy.newcastle.edu.au/R/help/01a/0464.html http://tolstoy.newcastle.edu.au/R/help/01a/0436.html "basehaz" in package survival seems to do a cumulative hazard. extract from the basehaz function: sfit <- survfit(fit) H
2008 Feb 25
0
logLik calculation in gls (nlme)
I'm getting some odd results computing log-likelihoods with gls using splines with increasing degrees of freedom -- the deviance *increases* substantially with increasing df. (Since spline models with increasing df aren't nested, it need not decline monotonically but I would expect it to have a decreasing trend!) I may just be confused, but I *think* the issue is somewhere within the
2005 Jun 24
1
"Error in contrasts" in step wise regression
Hi, I have a problem in getting step function work. I am getting the following error: > fit1 <- lm(Response~1) > fmla <- as.formula(paste(" ~ ",paste(colnames,collapse="+"))) > sfit <- step(fit1,scope=list(upper= fmla,lower= ~1),k=log(nrow(dat))) Start: AIC= -1646.66 Response ~ 1 Error in "contrasts<-"(`*tmp*`, value =
2012 May 12
1
access the se of a forecast
Hi everybody, I am currently trying to forecast some double seasonal time series by using the function dshw. I want to access the standard errors to build the confident interval for my forecast. I am using to following code : fit<-dshw(eem,period1=7,period2=48,h=48) then by using summary(fit), I see that my se are contained in the vector : $s20 but when I call fit$s20, I get NULL. I
2017 Nov 07
0
Survfit when new data has only 1 row of data
Dear R-help, I am using R version 3.4.0 within Windows, and survival 2.41-3. I have fit a Prentice Williams and Peterson-Counting Process model to my data as shown below. This is basically an extension of the Cox model for interval censored data. My dataset, bdat5 can be found here: https://drive.google.com/open?id=1sQSBEe1uBzh_gYbcj4P5Kuephvalc3gh cfitcp2 <-
2008 Aug 12
2
ANOVA tables - storing F values
When I run a summary(anova) I get output for all of the elements (columns) as these are multiple - single anova results. Can I store the F values? I can't find the attribute of the fitted model attributes(fit) that stores these F values, and for that matter, P values. Thanks -- Gareth Campbell PhD Candidate The University of Auckland P +649 815 3670 M +6421 256 3511 E
2009 Dec 22
1
Slow survfit -- is there a faster alternative?
Using R 2.10 on Windows: I have a filtered database of 650k event observations in a data frame with 20+ variables. I'd like to be able to quickly generate estimate and plot survival curves. However the survfit and cph() functions are extremely slow. As an example: I tried results.cox<-coxph(Surv(duration, success) ~ start_time + factor1+ factor2+ variable3, data=filteredData) #(took a
2010 Oct 27
2
coxph linear.predictors
I would like to be able to construct hazard rates (or unconditional death prob) for many subjects from a given survfit. This will involve adjusting the ( n.event/n.risk) with (coxph object )$linear.predictors I must be having another silly day as I cannot reproduce the linear predictor: fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian) fit$linear.predictors[1] [1] 2.612756
2006 Oct 31
2
Put a normal curve on plot
I would like to be able to place a normal distribution surrounding the predicted values at various places on a plot. Below is some toy code that creates a scatterplot and plots a regression line through the data. library(MASS) mu <- c(0,1) Sigma <- matrix(c(1,.8,.8,1), ncol=2) set.seed(123) x <- mvrnorm(50,mu,Sigma) plot(x) abline(lm(x[,2] ~ x[,1])) Say I want to add a normal
2007 Jul 27
4
Q: extracting data from lm
Warning: I am a complete newbie to R. I have read ISwR, but I am still finding myself completely stuck on some simple concepts. I have tried everything I can think of to solve this one, and finally decided that enough was enough and I need a pointer to a solution. I have the following summary from lm(): ---- > summary(lm(nu1~nu4)) Call: lm(formula = nu1 ~ nu4) Residuals: Min 1Q
2009 Nov 03
2
about the cox result
Hi all: I finished cox analysis like this: fit_cox<-coxph(Surv(dat$Time, dat$death) ~ dat$CD4 + strata(dat$gender),data=dat); > fit_cox Call: coxph(formula = Surv(data_ori$Time, data_ori$death) ~ data_ori$drug + strata(data_ori$gender), data = data_ori) coef exp(coef) se(coef) z p data_ori$drugddI 0.216 1.24 0.146 1.47 0.14 Likelihood ratio test=2.17 on
2009 Oct 23
1
coxph() and survfit()
Dear All, I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example: library(survival) fit <- coxph(Surv(time, status == 2) ~ factor(spiders), data = pbc) fit # HR for spiders is significant newdata <- data.frame(spiders = factor(0:1)) sf <- survfit(fit, newdata = newdata) sum.sf <- summary(sfit, times = c(2000, 2500, 3000)) # survival
2017 Jun 15
3
about fitting a regression line
Thanks for your replies. I tried the regression, but then got a NA value for the slope. And here is the error message: Coefficients: (1 not defined because of singularities) On Thu, Jun 15, 2017 at 12:20 AM, PIKAL Petr <petr.pikal at precheza.cz> wrote: > Hi > > But X can be some function like - sin, cos, log, exp... > > Cheers > Petr > > > -----Original