Displaying 20 results from an estimated 1000 matches similar to: "rpart for CART with weights/priors"
2005 Jun 15
1
anova.lme error
Hi,
I am working with R version 2.1.0, and I seem to have run into what looks
like a bug. I get the same error message when I run R on Windows as well as
when I run it on Linux.
When I call anova to do a LR test from inside a function, I get an error.
The same call works outside of a function. It appears to not find the right
environment when called from inside a function. I have provided
2008 Apr 17
1
survreg() with frailty
Dear R-users,
I have noticed small discrepencies in the reported estimate of the
variance of the frailty by the print method for survreg() and the
'theta' component included in the object fit:
# Examples in R-2.6.2 for Windows
library(survival) # version 2.34-1 (2008-03-31)
# discrepancy
fit1 <- survreg(Surv(time, status) ~ rx + frailty(litter), rats)
fit1
fit1$history[[1]]$theta
2011 Dec 05
1
about error while using anova function
fit1<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc)
fit2<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.5,data=wbc)
fit3<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc)
fit4<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc)
2004 Dec 21
0
Fwd: problems with limma
On Wed, December 22, 2004 12:11 am, r.ghezzo at staff.mcgill.ca said:
> ----- Forwarded message from r.ghezzo at staff.mcgill.ca -----
> Date: Mon, 20 Dec 2004 15:45:11 -0500
> From: r.ghezzo at staff.mcgill.ca
> Reply-To: r.ghezzo at staff.mcgill.ca
> Subject: [R] problems with limma
> To: r-help at stat.math.ethz.ch
>
> I try to send this message To Gordon
2004 Dec 20
2
problems with limma
I try to send this message To Gordon Smyth at smyth at vehi,edu.au but it bounced
back, so here it is to r-help
I am trying to use limma, just downloaded it from CRAN. I use R 2.0.1 on Win XP
see the following:
> library(RODBC)
> chan1 <- odbcConnectExcel("D:/Data/mgc/Chips/Chips4.xls")
> dd <- sqlFetch(chan1,"Raw") # all data 12000
> #
> nzw <-
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
2012 Apr 29
0
need help with avg.surv (Direct Adjusted Survival Curve)
Hello R users,
I am trying to obtain a direct adjusted survival curve. I am sending my whole code (see below). It's basically the larynx cancer data with Stage 1-4. I am using the cox model using coxph option, see the fit3 coxph. When I use the avg.surv option on fit3, I get the following error: "fits<-avg.surv(fit3, var.name="stage.fac", var.values=c(1,2,3,4), data=larynx)
2012 Nov 08
2
Comparing nonlinear, non-nested models
Dear R users,
Could somebody please help me to find a way of comparing nonlinear, non-nested
models in R, where the number of parameters is not necessarily different? Here
is a sample (growth rates, y, as a function of internal substrate
concentration, x):
x <- c(0.52, 1.21, 1.45, 1.64, 1.89, 2.14, 2.47, 3.20, 4.47, 5.31, 6.48)
y <- c(0.00, 0.35, 0.41, 0.49, 0.58, 0.61, 0.71, 0.83, 0.98,
2012 Apr 30
0
need help with avg.surv (Direct Adjusted Survival Curve), Message-ID:
Well, I would suggest using the code already in place in the survival
package. Here is my code for your problem.
I'm using a copy of the larynx data as found from the web resources for
the Klein and Moeschberger book.
larynx <- read.table("larynx.dat", skip=12,
col.names=c("stage", "time", "age", "year",
2018 Feb 14
0
Unexpected behaviour in rms::lrtest
Hello.
One of my teaching assistants was experimenting and encountered
unexpected behaviour with the lrtest function in the rms package. It
appears that when you have a pair of non-nested models that employ an
RCS, the error checking for non-nested models appears not to work.
Here is a reproducible example.
> library(rms)
Loading required package: Hmisc
Loading required package: lattice
2011 Jan 21
2
Looping with incremented object name and increment function
Folks,
I am trying to get a loop to run which increments the object name as part of
the loop. Here "fit1" "fit2" "fit3" and "fit4" are linear regression models
that I have created.
> for (ii in c(1:4)){
+ SSE[ii]=rbind(anova(fit[ii])$"Sum Sq")
+ dfe[ii]=rbind(summary(fit[ii])$df)
+ }
Error in anova(fit[ii]) : object 'fit' not found
2010 Feb 26
2
Error in mvpart example
Dear all,
I'm getting an error in one of the stock examples in the 'mvpart' package. I tried:
require(mvpart)
data(spider)
fit3 <- rpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water+twigs+reft+herbs+moss+sand,spider,method="dist") #directly from ?rpart
summary(fit3)
...which returned the following:
Error in apply(formatg(yval, digits - 3), 1,
2004 Nov 08
1
coxph models with frailty
Dear R users:
I'm generating the following survival data:
set.seed(123)
n=200 #sample size
x=rbinom(n,size=1,prob=.5) #binomial treatment
v=rgamma(n,shape=1,scale=1) #gamma frailty
w=rweibull(n,shape=1,scale=1) #Weibull deviates
b=-log(2) #treatment's slope
t=exp( -x*b -log(v) + log(w) ) #failure times
c=rep(1,n) #uncensored indicator
id=seq(1:n) #individual frailty indicator
2005 Mar 14
1
calling objects in a foreloop
I want to organize outputs from several regressions into a handy table. When I
try the following, each of my "fit_s" is replaces instead of read. Is there a
way to read from the regression summaries that does not require writing
separate lines of code for each?
-Ben Osborne
> fit1<-lm(dBA.spp16$sp2.dBA.ha~dBA.spp16$sp1.dBA.ha)
>
2011 Jan 26
2
Extracting the terms from an rpart object
Hello all,
I wish to extract the terms from an rpart object.
Specifically, I would like to be able to know what is the response variable
(so I could do some manipulation on it).
But in general, such a method for rpart will also need to handle a "." case
(see fit2)
Here are two simple examples:
fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
fit1$call
fit2 <-
2009 May 12
1
questions on rpart (tree changes when rearrange the order of covariates?!)
Greetings,
I am using rpart for classification with "class" method. The test data is
the Indian diabetes data from package mlbench.
I fitted a classification tree firstly using the original data, and then
exchanged the order of Body mass and Plasma glucose which are the
strongest/important variables in the growing phase. The second tree is a
little different from the first one. The
2010 Jan 19
1
A model-building strategy in mixed-effects modelling
Dear all,
Consider a completely randomized block design (let's use data(Oats)
irrespoctive of the split-plot design it was arranged in). Look:
library(nlme)
fit <- lme(yield ~ nitro, Oats, random = ~1|Block, method="ML")
fit2 <- lm(yield ~ nitro + Block, Oats)
anova(fit, fit2)
gives this:
Model df AIC BIC logLik Test L.Ratio p-value
fit 1 4 624.3245
2009 May 22
1
bug in rpart?
Greetings,
I checked the Indian diabetes data again and get one tree for the data with
reordered columns and another tree for the original data. I compared these
two trees, the split points for these two trees are exactly the same but the
fitted classes are not the same for some cases. And the misclassification
errors are different too. I know how CART deal with ties --- even we are
using the
2009 Jul 28
2
A hiccup when using anova on gam() fits.
I stumbled across a mild glitch when trying to compare the
result of gam() fitting with the result of lm() fitting.
The following code demonstrates the problem:
library(gam)
x <- rep(1:10,10)
set.seed(42)
y <- rnorm(100)
fit1 <- lm(y~x)
fit2 <- gam(y~lo(x))
fit3 <- lm(y~factor(x))
print(anova(fit1,fit2)) # No worries.
print(anova(fit1,fit3)) # Likewise.
print(anova(fit2,fit3)) #
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