Displaying 1 result from an estimated 1 matches for "kyphosisrep".
2011 Dec 27
0
Using minsplit and unequal weights in rpart
...ing with rpart weights
require(rpart)
dev.new()
par(mfrow=c(2,3), xpd=NA)
data(kyphosis)
fitOriginal <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis,
control=rpart.control(minsplit=15))
plot(fitOriginal)
text(fitOriginal, use.n=TRUE)
# this dataset is the original data repeated 3 times
kyphosisRepeated <- rbind(kyphosis, kyphosis, kyphosis)
fitRepeated <- rpart(Kyphosis ~ Age + Number + Start,
data=kyphosisRepeated, control=rpart.control(minsplit=45))
plot(fitRepeated)
text(fitRepeated, use.n=TRUE)
# instead of repeating, use weights
kyphosisWeighted <- kyphosis
kyphosisWeighted$my...