search for: xstd

Displaying 20 results from an estimated 28 matches for "xstd".

Did you mean: std
2010 Feb 10
2
Total least squares linear regression
Dear all, After a thorough research, I still find myself unable to find a function that does linear regression of 2 vectors of data using the "total least squares", also called "orthogonal regression" (see : http://en.wikipedia.org/wiki/Total_least_squares) instead of the "ordinary least squares" method. Indeed, the "lm" function has a
2001 Nov 14
3
rpart:plotcp doesn't allow ylim argument (PR#1171)
...ow. -Greg ---PATCH STARTS HERE--- diff -r rpart.orig//R/plotcp.s rpart/R/plotcp.s 5c5 < upper=c("size", "splits", "none"), ...) --- > upper=c("size", "splits", "none"), ylim, ...) 18c18,19 < ylim <- c(min(xerror - xstd) - 0.1, max(xerror + xstd) + 0.1) --- > if(missing(ylim)) > ylim <- c(min(xerror - xstd) - 0.1, max(xerror + xstd) + 0.1) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Sen...
2008 Sep 16
1
1-SE rule in mvpart
Hello, I'm using mvpart option xv="1se" to compute a regression tree of good size with the 1-SE rule. To better understand 1-SE rule, I took a look on its coding in mvpart, which is : Let z be a rpart object , xerror <- z$cptable[, 4] xstd <- z$cptable[, 5] splt <- min(seq(along = xerror)[xerror <= min(xerror) + xvse * xstd]) I interprete this as following: the simplest tree with xerror under min(xerror) + its own xstd Neverthless, in some article I read the following rule: the simplest tree with xerror under min(xerror)...
2003 Sep 29
1
CP for rpart
Hi All, I have some questions on using library rpart. Given my data below, the plotcp gives me increasing 'xerrors' across different cp's with huge xstd (plot attached). What causes the problem or it's not a problem at all? I am thinking 'xerror's should be decreasing when 'cp' gets smaller. Also what the 'xstd' really tells us? If the error bars for each xerror overlap for different cp's, does that mean we don...
2005 Mar 29
1
regression tree xerror
I am running some models (for the first time) using rpart and am getting results I don't know how to interpret. I'm using cross-validation to prune the tree and the results look like: Root node error: 172.71/292 = 0.59148 n= 292 CP nsplit rel error xerror xstd 1 0.124662 0 1.00000 1.00731 0.093701 2 0.064634 1 0.87534 1.08076 0.092337 3 0.057300 2 0.81070 1.07684 0.095582 4 0.038462 4 0.69610 0.99104 0.091659 5 0.036200 5 0.65764 1.01596 0.094635 6 0.029228 7 0.58524 1.00058 0.095440 7 0.028779 8 0....
2006 Oct 17
1
Some questions on Rpart algorithm
...s of each class rather then counts. I don't see an option for this so would like to modify the text.rpart. However, I can't find the source since it is a method that's "hidden". How can I find the source? (2) printcp prints a table with columns cp, nsplit, rel error, xerror, xstd. I am guessing that cp is complexity, nsplit is the number of the split, rel error is the error on test set, xerror is cross-validation error and xstd is standard deviation of error across the cross-validation sets. Is there any documentation on this? For instance, how exactly is complexity compute...
2009 May 26
0
cross-validation in rpart
...with a tree, say A, obtained with "class" method with the one, say B, I get with my custom functions (init, split and eval). I should compare the cp tables for the two fitted rpart object. For tree B I only have the "rel error" column and I need to obtain the xerror and the xstd columns as for tree A. To this aim I should know how this values are computed. I guess they depend on the xval value (in rpart.control) which is set to 10 by default. Does this mean that the observations are divided into 10 groups and, as before, the xerror is computed by averaging the erorrs o...
2010 Feb 26
2
Error in mvpart example
...rectly from ?rpart summary(fit3) ...which returned the following: Error in apply(formatg(yval, digits - 3), 1, paste, collapse = ",", sep = "") : dim(X) must have a positive length This seems to be a problem with the cross-validation, since the "xerror" and "xstd" columns are missing from the summary table as well. Using the mpart() wrapper results in the same error: fit4<-mvpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water+twigs+reft+herbs+moss+sand,spider,method="dist") summary(fit4) Note, changing the 'metho...
2006 Sep 25
2
rpart
...? If so, it's up to me to choose a subtree by using the printcp method. In the technical report from Atkinson and Therneau "An Introduction to recursive partitioning using the rpart routines" from 2000, one can see the following table on page 15: CP nsplit relerror xerror xstd 1 0.105 0 1.00000 1.0000 0.108 2 0.056 3 0.68519 1.1852 0.111 3 0.028 4 0.62963 1.0556 0.109 4 0.574 6 0.57407 1.0556 0.109 5 0.100 7 0.55556 1.0556 0.109 Some lines below it says "We see that the best tree has 5 terminal nodes (4 sp...
2010 May 11
1
how to extract the variables used in decision tree
.... > printcp(fit.dimer) Classification tree: rpart(formula = outcome ~ ., data = p_df, method = "class") Variables actually used in tree construction: [1] CT DP DY FC NE NW QT SK TA WC WD WG WW YG Root node error: 608/1743 = 0.34882 n= 1743 CP nsplit rel error xerror xstd 1 0.185033 0 1.00000 1.00000 0.032726 2 0.052632 2 0.62993 0.65132 0.028773 3 0.026316 4 0.52467 0.58059 0.027596 4 0.025768 5 0.49836 0.57072 0.027419 5 0.019737 8 0.42105 0.56086 0.027239 6 0.018092 9 0.40132 0.55263 0.027087 7 0.013158 12 0.34704 0...
2012 Dec 07
0
loop for calculating 1-se in rpart
...+ Depth + Exp + DFP + FI + LAT, data = ch, method = "anova", control = rpart.control(minsplit = 10, cp = 0.01, xval = 10)) Variables actually used in tree construction: [1] BC Depth DFP Exp Root node error: 47456/99 = 479.35 n= 99 CP nsplit rel error xerror xstd 1 0.344626 0 1.00000 1.02074 0.139585 2 0.179054 1 0.65537 0.76522 0.107470 3 0.072037 2 0.47632 0.68115 0.092627 4 0.063469 3 0.40428 0.67320 0.094830 5 0.036190 4 0.34081 0.58516 0.096726 6 0.034677 5 0.30462 0.56747 0.074953 7 0.018219 6 0....
2010 Oct 12
2
repeating an analysis
...t1) Regression tree: rpart(formula = CHAB ~ ., data = chabun, method = "anova", control = rpart.control(minsplit = 10, cp = 0.01, xval = 10)) Variables actually used in tree construction: [1] EXP LAT POC RUG Root node error: 35904/33 = 1088 n= 33 CP nsplit rel error xerror xstd 1 0.539806 0 1.00000 1.0337 0.41238 2 0.050516 1 0.46019 1.2149 0.38787 3 0.016788 2 0.40968 1.2719 0.41280 4 0.010221 3 0.39289 1.1852 0.38300 5 0.010000 4 0.38267 1.1740 0.38333 Each time I re-run the model I will get a slightly different output. I want to extr...
2008 Mar 01
1
model R^2 and partial R^2 values
...r R-list members, I am doing a CART analysis in R using the rpart function in the rpart package: Phrag.rpart=rpart(PhragDiff~., data = Phrag, method="anova", xval=10). I used the xerror values in the CP table to prune the tree to 4 nsplits: CP nsplit rel error xerror xstd 1 0.098172 0 1.00000 1.02867 0.12768 2 0.055991 3 0.70548 1.00823 0.12911 3 0.029306 4 0.64949 0.83275 0.12074 4 0.018943 5 0.62019 0.86994 0.12467 5 0.010503 6 0.60124 0.86975 0.12080 6 0.010000 7 0.59074 0.87944 0.11757 I would like to get R^2 values for the m...
2008 Jul 03
1
cross-validation in rpart
...part no longer cross-validates the resulting tree to return errors. A simple test is to use the usersplits.R function to get a simple, custom rpart function, and then change fit1 and fit2 so that the both have xvals of 10. The problem occurs in that the cptable for fit1 doesn't have xerror or xstd, despite the fact that the cross-validation is set to 10-fold. I guess I just need conformation that cross-validation doesn't work with custom functions, and if someone could explain to me why that is the case it would be greatly appreciated. Thanks, Sam Stewart -- Sam Stewart, MMath Resear...
2011 Dec 31
1
Cross-validation error with tune and with rpart
...me when I want to estimate the cross-validation error of the generated tree: tree <- rpart(y~., data=data.frame(xsel, y), cp=0.00001) ptree <- prune(tree, cp=tree$cptable[which.min(tree$cptable[,"xerror"]),"CP"]) ptree$cptable CP nsplit rel error xerror xstd 1 0.33120000 0 1.0000 1.0000 0.02856022 2 0.08640000 1 0.6688 0.6704 0.02683544 3 0.02986667 2 0.5824 0.5856 0.02584564 4 0.02880000 5 0.4928 0.5760 0.02571738 5 0.01920000 6 0.4640 0.5168 0.02484761 6 0.01440000 8 0.4256 0.5056 0.02466708 7 0....
2005 Oct 14
1
Predicting classification error from rpart
...duces output like this :- > printcp(rpart.LFM) Classification tree: rpart(formula = Sex ~ LFM, data = Brides2) Variables actually used in tree construction: LFM Root node error: 44/104 = 0.42308 n= 104 CP nsplit rel error xerror xstd 1 0.227273 0 1.00000 1.00000 0.11451 2 0.113636 1 0.77273 0.95455 0.11372 3 0.022727 2 0.65909 0.95455 0.11372 4 0.010000 5 0.59091 0.95455 0.11372 > Presumably 'root node error' and 'rel error' are something to do with error but what? 'Root node...
2003 Apr 10
1
Classification problem - rpart
...1371,0.1013844,0.2027681,0.2267014,0.32......... MISSING 2392 3 random (0.001254181 0.998745819) * This is not like other trees I have run! And: summary(tree) > summary(tree) Call: rpart(formula = class ~ curvegrid + slope + tci10) n= 4966 CP nsplit rel error xerror xstd 1 0.9609344 0 1.00000000 1.0322191 0.01418310 2 0.0100000 1 0.03906565 0.7635924 0.01378822 Node number 1: 4966 observations, complexity param=0.9609344 predicted class=dw expected loss=0.5 class counts: 2483 2483 probabilities: 0.500 0.500 left son=2 (2574 obs) rig...
2013 Jan 27
2
rpart
...lts of the 2 functions (summary and plot) or it is not always the same? Look forward to your reply, Carol -------------------------------------------- ?summary(rpart.res) Call: rpart(formula = mydata$class ~ ., data = as.data.frame(t(mydata))) ? n= 62 ???????? CP nsplit rel error??? xerror????? xstd 1 0.6363636????? 0 1.0000000 1.0000000 0.1712469 2 0.1363636????? 1 0.3636364 0.6818182 0.1532767 3 0.0100000????? 2 0.2272727 0.7727273 0.1596659 Variable importance ? Hsa.627?? Hsa.692 Hsa.692.2? Hsa.3306?? Hsa.601?? Hsa.831? Hsa.1832? Hsa.2456 ?????? 19??????? 13??????? 11??????? 10??????? 10?...
2010 Jun 06
1
I need help in analyzing
...ond 2 1 1 0 braz 2 3 2 1 czarne 0 2 2 0 rude 1 1 1 1 model=rpart(y~.,dane,method="class",control=rpart.control(xval=3,cp=0)) > plot(model) > text(model) model$cptable CP nsplit rel error xerror xstd 1 0.05691057 0 1.0000000 1.097561 0.08180737 2 0.02439024 3 0.8292683 1.219512 0.07040857 3 0.00000000 4 0.8048780 1.195122 0.07310295 npt=which.min(model$table[,4]) > npt integer(0) I need to describe this subject, but i don't know what R is saying to me. This subject is a...
2010 Sep 26
4
How to update an old unsupported package
Hi all, I have a package that is specific to a task I was repetitively using a few years ago. I now needed to run it again with new data. However I am told it was built with an older version or R and will not work. How can I tweak the package so it will run on 11.1? It was a one-off product and has not been maintained. Is there a way to "unpackage" it and repackage it to work? I