similar to: help with step()

Displaying 20 results from an estimated 200 matches similar to: "help with step()"

2009 Apr 15
2
AICs from lmer different with summary and anova
Dear R Helpers, I have noticed that when I use lmer to analyse data, the summary function gives different values for the AIC, BIC and log-likelihood compared with the anova function. Here is a sample program #make some data set.seed(1); datx=data.frame(array(runif(720),c(240,3),dimnames=list(NULL,c('x1','x2','y' )))) id=rep(1:120,2); datx=cbind(id,datx) #give x1 a
2019 Apr 24
1
Bug in "stats4" package - "confint" method
Dear R developers, I noticed a bug in the stats4 package, specifically in the confint method applied to ?mle? objects. In particular, when some ?fixed? parameters define the log likelihood, these parameters are stored within the mle object but they are not used by the ?confint" method, which retrieves their value from the global environment (whenever they still exist). Sample code: >
2011 Oct 06
1
anova.rq {quantreg) - Why do different level of nesting changes the P values?!
Hello dear R help members. I am trying to understand the anova.rq, and I am finding something which I can not explain (is it a bug?!): The example is for when we have 3 nested models. I run the anova once on the two models, and again on the three models. I expect that the p.value for the comparison of model 1 and model 2 would remain the same, whether or not I add a third model to be compared
2018 Jan 17
1
Assessing calibration of Cox model with time-dependent coefficients
I am trying to find methods for testing and visualizing calibration to Cox models with time-depended coefficients. I have read this nice article <http://journals.sagepub.com/doi/10.1177/0962280213497434>. In this paper, we can fit three models: fit0 <- coxph(Surv(futime, status) ~ x1 + x2 + x3, data = data0) p <- log(predict(fit0, newdata = data1, type = "expected")) lp
2012 Nov 15
1
Step-wise method for large dimension
Hi , I want to apply the following code fo my data with 400 predictors. I was wondering if there ia an alternative way instead of typing 400 predictors for the following code. I really appreciate your help. fit0<-lm(Y~1, data= mydata) fit.final<- lm(Y~X1+X2+X3+.....+X400, data=mydata) ??? step(fit0, scope=list(lower=fit0, upper=fit.final), data=mydata, direction="forward")
2018 Jan 18
1
Time-dependent coefficients in a Cox model with categorical variants
First, as others have said please obey the mailing list rules and turn of First, as others have said please obey the mailing list rules and turn off html, not everyone uses an html email client. Here is your code, formatted and with line numbers added. I also fixed one error: "y" should be "status". 1. fit0 <- coxph(Surv(futime, status) ~ x1 + x2 + x3, data = data0) 2. p
2009 May 11
1
Warning trying to plot -log(log(survival))
windows xp R 2.8.1 I am trying to plot the -log(log(survival)) to visually test the proportional hazards assumption of a Cox regression. The plot, which should give two lines (one for each treatment) gives only one line and a warning message. I would appreciate help getting two lines, and an explanation of the warning message. My problem may the that I have very few events in one of my strata,
2011 May 08
1
anova.lm fails with test="Cp"
Here is an example, modified from the help page to use test="Cp": -------------------------------------------------------------------------------- > fit0 <- lm(sr ~ 1, data = LifeCycleSavings) > fit1 <- update(fit0, . ~ . + pop15) > fit2 <- update(fit1, . ~ . + pop75) > anova(fit0, fit1, fit2, test="Cp") Error in `[.data.frame`(table, , "Resid.
2009 May 10
2
plot(survfit(fitCox)) graph shows one line - should show two
R 2.8.1 Windows XP I am trying to plot the results of a coxph using plot(survfit()). The plot should, I believe, show two lines one for survival in each of two treatment (Drug) groups, however my plot shows only one line. What am I doing wrong? My code is reproduced below, my figure is attached to this EMail message. John > #Create simple survival object >
2006 Oct 18
1
MARS help?
I'm trying to use mars{mda} to model functions that look fairly close to a sequence of straight line segments. Unfortunately, 'mars' seems to totally miss the obvious places for the knots in the apparent first order spline model, and I wonder if someone can suggest a better way to do this. The following example consists of a slight downward trend followed by a jump up after
2019 Dec 27
2
"simulate" does not include variability in parameter estimation
Hello, All: ????? The default "simulate" method for lm and glm seems to ignore the sampling variance of the parameter estimates;? see the trivial lm and glm examples below.? Both these examples estimate a mean with formula = x~1.? In both cases, the variance of the estimated mean is 1. ??? ??????? * In the lm example with x0 = c(-1, 1), var(x0) = 2, and
2006 Oct 08
1
Simulate p-value in lme4
Dear r-helpers, Spencer Graves and Manual Morales proposed the following methods to simulate p-values in lme4: ************preliminary************ require(lme4) require(MASS) summary(glm(y ~ lbase*trt + lage + V4, family = poisson, data = epil), cor = FALSE) epil2 <- epil[epil$period == 1, ] epil2["period"] <- rep(0, 59); epil2["y"] <- epil2["base"]
2019 Dec 27
1
"simulate" does not include variability in parameter estimation
On 2019-12-27 04:34, Duncan Murdoch wrote: > On 26/12/2019 11:14 p.m., Spencer Graves wrote: >> Hello, All: >> >> >> ? ????? The default "simulate" method for lm and glm seems to ignore the >> sampling variance of the parameter estimates;? see the trivial lm and >> glm examples below.? Both these examples estimate a mean with formula = >>
2011 Sep 12
1
coxreg vs coxph: time-dependent treatment
Dear List, After including cluster() option the coxreg (from eha package) produces results slightly different than that of coxph (from survival) in the following time-dependent treatment effect calculation (example is used just to make the point). Will appreciate any explaination / comment. cheers, Ehsan ############################ require(survival) require(eha) data(heart) # create weights
2009 Oct 22
1
Automatization of non-linear regression
Hi everybody, I'm using the method described here to make a linear regression: http://www.apsnet.org/education/advancedplantpath/topics/Rmodules/Doc1/05_Nonlinear_regression.html > ## Input the data that include the variables time, plant ID, and severity > time <- c(seq(0,10),seq(0,10),seq(0,10)) > plant <- c(rep(1,11),rep(2,11),rep(3,11)) > > ## Severity
2012 Jul 05
3
Maximum Likelihood Estimation Poisson distribution mle {stats4}
Hi everyone! I am using the mle {stats4} to estimate the parameters of distributions by MLE method. I have a problem with the examples they provided with the mle{stats4} html files. Please check the example and my question below! *Here is the mle html help file * http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html http://stat.ethz.ch/R-manual/R-devel/library/stats4/html/mle.html
2023 Oct 24
1
by function does not separate output from function with mulliple parts
Colleagues, I have written an R function (see fully annotated code below), with which I want to process a dataframe within levels of the variable StepType. My program works, it processes the data within levels of StepType, but the usual headers that separate the output by levels of StepType are at the end of the listing rather than being used as separators, i.e. I get Regression results StepType
2009 Jan 13
1
deviance in polr method
Dear all, I've replicated the cheese tasting example on p175 of GLM's by McCullagh and Nelder. This is a 4 treatment (rows) by 9 ordinal response (cols) table. Here's my simple code: #### cheese library(MASS) options(contrasts = c("contr.treatment", "contr.poly")) y = c(0,0, 1, 7, 8,8,19, 8,1, 6,9,12,11, 7,6, 1, 0,0, 1,1, 6, 8,23,7,
2004 Apr 27
0
Extracting labels for residuals from lme
Dear R-helpers, I want to try to extract residuals from a multi-level linear mixed effects model, to correlate with another variable. I need to know which residuals relate to which experimental units in the lme. I can show the labels that relate to the experimental units via the command ranef(fit0)$resid which gives: 604/1/0 -1.276971e-05 604/1/1 -1.078644e-03 606/1/0 -7.391706e-03 606/1/1
2009 Jun 15
2
coxph and robust variance estimation
Hello, I would like to compare two different models in the framework of Cox proportional hazards regression models. On Rsitesearch and google I don't find a clear answer to my question. My R-Code (R version 2.9.0) coxph.fit0 <- coxph(y ~ z2_ + cluster(as.factor(keys))+ strata(stratvar_), method="breslow" ,robust=T ) coxph.fit1 <- coxph(y ~ z_ +