similar to: Using stepAIC to produce a p-value for when a particular variable was taken out of the model

Displaying 20 results from an estimated 5000 matches similar to: "Using stepAIC to produce a p-value for when a particular variable was taken out of the model"

2009 May 22
1
Forcing a variableinto a model using stepAIC
Dear All, I am attempting to use forward and/or backward selection to determine the best model for the variables I have. Unfortunately, because I am dealing with patients and every patient is receiving treatment I need to force the variable for treatment into the model. Is there a way to do this using R? (Additionally, the model is stratified by randomisation period). I know that SAS can be
2017 Sep 14
3
Help understanding why glm and lrm.fit runs with my data, but lrm does not
Dear all, I am using the publically available GustoW dataset. The exact version I am using is available here: https://drive.google.com/open?id=0B4oZ2TQA0PAoUm85UzBFNjZ0Ulk I would like to produce a nomogram for 5 covariates - AGE, HYP, KILLIP, HRT and ANT. I have successfully fitted a logistic regression model using the "glm" function as shown below. library(rms) gusto <-
2009 Jun 09
2
Isolating a single plot from plots produced simultaneously
Dear R-Help, I am using the 'mfp' package. It produces three plots (as I am using the Cox model) simultaneously which can be viewed together using the following code: fit <- mfp(Surv(rem.Remtime,rem.Rcens)~fp(age)+strata(rpa),family=cox,data=nearma,select=0.05,verbose=TRUE) par(mfrow=c(2,2)) plot(fit) They can be viewed separately but the return key must be pressed after each graph
2010 Nov 30
3
repeat write.table with the same code many times
Dear all, I am using R version 2.9.2 in Windows. I would like to output the results of a function I have written to a .txt file. I know that I can do this by using the code write.table(boothd(10),"boothd10.txt",sep="\t",append=TRUE) etc. However, I would like to bootstrap my function 'boothd' several times and get each vector of results as a new line in my text
2017 Sep 14
1
Help understanding why glm and lrm.fit runs with my data, but lrm does not
Fixed 'maxiter' in the help file. Thanks. Please give the original source of that dataset. That dataset is a tiny sample of GUSTO-I and not large enough to fit this model very reliably. A nomogram using the full dataset (not publicly available to my knowledge) is already available in http://biostat.mc.vanderbilt.edu/tmp/bbr.pdf Use lrm, not lrm.fit for this. Adding maxit=20 will
2008 Oct 28
3
Dose Profile
Hi Everyone, I have data in a long format e.g. there is one row per patient but each follow-up appointment is included in the row. So, a snippet of the data looks like this: TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2 Time2 B1001029 LTG M 15719 30/04/2003 15825 150 106 29/08/2003 15946 200 227 B1117003 LTG M 15734 30/04/2003 15825 200 91 03/09/2003 15951 250 217
2017 Sep 14
0
Help understanding why glm and lrm.fit runs with my data, but lrm does not
> On Sep 14, 2017, at 12:30 AM, Bonnett, Laura <L.J.Bonnett at liverpool.ac.uk> wrote: > > Dear all, > > I am using the publically available GustoW dataset. The exact version I am using is available here: https://drive.google.com/open?id=0B4oZ2TQA0PAoUm85UzBFNjZ0Ulk > > I would like to produce a nomogram for 5 covariates - AGE, HYP, KILLIP, HRT and ANT. I have
2018 Mar 02
1
Variable centring within "predict.coxph"
Dear R-help, I am using R-3.3.2 on Windows 10. I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for use in R too (as I far prefer R to Stata!) I notice that predictions made from a Cox model in Stata are based on un-centred variables,
2011 Oct 18
1
Repeat a loop until...
Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and covmat are not important.] > datamat <-
2009 Apr 03
2
Schoenfeld Residuals
Dear All, Sorry to bother you again. I have a model: coxfita=coxph(Surv(rem.Remtime/365,rem.Rcens)~all.sex,data=nearma) and I'm trying to do a plot of Schoenfeld residuals using the code: plot(cox.zph(coxfita)) abline(h=0,lty=3) The error message I get is: Error in plot.window(...) : need finite 'ylim' values In addition: Warning messages: 1: In sqrt(x$var[i, i] * seval) : NaNs
2008 Oct 13
1
na.pass
Hi All, I have a data frame which has columns comprised mainly of "NA"s. I know there are functions na.pass and na.omit etc which can be used in these situations however I can't them to work in this case. I have a function which returns the data according to some rule i.e. removal of N in this code: nep <- function(data) { dummy <- rep(0,378) for(i in 1:378){
2011 Sep 15
1
Where to put tryCatch or similar in a very big for loop
Dear all, I am running a simulation study to test variable imputation methods for Cox models using R 2.9.0 and Windows XP. The code I have written (which is rather long) works (if I set nsim = 9) with the following starting values. >bootrs(nsim=9,lendevdat=1500,lenvaldat=855,ac1=-0.19122,bc1=-0.18355,cc1=-0.51982,cc2=-0.49628,eprop1=0.98,eprop2=0.28,lda=0.003) I need to run the code 1400
2008 Sep 29
1
Hazard plot
Hi All, This sounds a relatively simple query, and I hope it is! I am looking at a continuous variable, age. I am looking at time to 12-month remission and can calculate the HR and 95% confidence interval are follows: coxfita = coxph(Surv(rem.Remtime,rem.Rcens)~nearma$all.age,data=nearma) exp(coxfita$coefficients) exp(confint(coxfita)) However, because I am looking at age as a continuous
2018 May 24
1
Predictions from a Cox model - understanding centering of binary/categorical variables
Dear all, I am using R 3.4.3 on Windows 10. I am preparing some teaching materials and I'm having trouble matching the by-hand version with the R code. I have fitted a Cox model - let's use the ovarian data as an example: library(survival) data(ovarian) ova_mod <- coxph(Surv(futime,fustat)~age+rx,data=ovarian) If I want to make predict survival for a new set of individuals at 100
2008 Apr 09
1
If statements for vectors
Dear Sirs, I am using both the Bioconductor adds on (Affy, AffyPLM,...) and the 'standard' R-package. I am trying to select a list of genes which all have expression values below a certain threshold. I have done this by creating a vector which has 0s where the expression is greater than the threshold and 1s where it is less than or equal to it. Multiplying this vector by the expression
2013 Feb 08
2
How to debug the C programs associated with R-packages?
hello, I was having some problems in debugging C codes assocaited with R-packages. I don't have much experience with debugging tools used in C language. Is there any methods similar to R-debugging tools such as browser ,debug etc which can be used to debug such C files. I was using the foreign package and found a bug in reading dta files containing empty strings "" in the data. I
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
2009 Dec 16
1
Baseline survival estimate
Dear R-help, I am trying to obtain the baseline survival estimate of a fitted Cox model (S_0 (t)). I know that previous posts have said use 'basehaz' but this gives the baseline hazard function and not the baseline survival estimate. Is there a way to obtain the baseline survival estimate or do I have to use the formula which does something like S(t) = exp[- the integral from 0 to t of
2008 Aug 26
1
Variance-covariance matrix
Dear R help forum, I am using the function 'coxph' to obtain hazard ratios for the comparison of a standard treatment to new treatments. This is easily obtained by fitting the relevant model and then calling exp(coef(fit1)) say. I now want to obtain the hazard ratio for the comparison of two non-standard treatments. >From a statistical point of view, this can be achieved by dividing
2009 Apr 16
1
Survreg/psm output
Dear R-listers, I know that there have been many, many posts on the output from Survreg. To summarise what I have read, Scale is 1/shape of the Weibull which is also the standard deviation of the normal distribution which is also the standard deviation of the log survival time and Intercept is log(scale). I also know that the hazard function can be calculated from the output to give something