[R] nonlinear constrained optimization

2008-08-19 Thread Chua Siang Li
your help is much appreciated. Chua Siang Li Consultant - Operations Research Acceval Pte Ltd Tel: 6297 8740 Email: [EMAIL PROTECTED] Website: www.acceval-intl.com This message and any attachments (the "message"...{{dropped:13}}

[R] Extracting variable names of final model in stepAIC

2008-08-04 Thread Chua Siang Li
2 - x.Channel 1 127.9724 1068 852385.2 7267.108 3 - x.Market.Price 1 858.2886 1069 853243.5 7266.200 question: Now, $anova list the final model only on the console. How do I retrieve the variable names of final model (to be written into a text file later)? Than

[R] predict rpart: new data has new level

2008-07-30 Thread Chua Siang Li
, minbucket=50, maxdepth=5) > predictLost <- predict(mod, newdata=data.frame(y=yLost, x=xLost), type="vector") Error in model.frame.default(Terms, newdata, na.action = act, xlev = attr(object, : factor 'x.Incoterm' has new level(s) MTD

[R] colnames from read.table

2008-07-30 Thread Chua Siang Li
ames(y) NULL > colnames(xDate) NULL > colnames(x) [1]"Market.Price""Quantity""Country""Incoterm" "Channel" [6] "PaymentTerm" Chua Siang Li Consultant - Operations Research

[R] rpart node number

2008-07-22 Thread Chua Siang Li
arket.Price>=1727.5 199 100960.60 6.5846730 * 3) x.Incoterm=DDP 62 40874.25 58.4919400 * How do I get the node number printed only for the terminal nodes? >plot(rpartModel,uniform=T,branch=1,compress=T,margin=0.1) >text(rpartModel,pretty=1,all=T,use.n=T,cex=.6) Than

Re: [R] rpart$where and predict.rpart

2008-07-22 Thread Chua Siang Li
data=as.matrix(xLost)) Error in pred.rpart(mod, newdata = as.matrix(xLost)) : unused argument(s) (newdata = c("1335.0", "1335.0", "1335.0", "1335.0", . Btw, my predict function is ok. > predictLost <- predict(mod, newdata=da

[R] rpart$where and predict.rpart

2008-07-22 Thread Chua Siang Li
ch seems to give only the predicted value with no information similar to rpart$where. May I know how to find out the terminal nodes that each new observations belongs to? Many thanks. ---- Chua Siang Li Consultant - Operations Research Acceval Pte Ltd Tel: 6297 8740

Re: [R] CART and CHAID

2008-07-21 Thread Chua Siang Li
more other R packages that offer improved CART/CHAID technqiues? Thanks. Chua Siang Li Consultant - Operations Research Acceval Pte Ltd Tel: 6297 8740 Email: [EMAIL PROTECTED] Website: www.acceval-intl.com This message and any attachments (the "message&

[R] CART and CHAID

2008-07-20 Thread Chua Siang Li
Can I say that RPART is a modified algo of CART and PARTY a modified of CHAID? Thanks. Chua Siang Li Consultant - Operations Research Acceval Pte Ltd Tel: 6297 8740 Email: [EMAIL PROTECTED] Website: www.acceval-intl.com This message and any attachments (the

[R] Otpmial initial centroid in kmeans

2008-07-02 Thread Chua Siang Li
Helo there. I am using kmeans of base package to cluster my customers. As the results of kmeans is dependent on the initial centroid, may I know: 1) how can we specify the centroid in the R function? (I don't want random starting pt) 2) how to determine the optimal (if not, a good

[R] Recommending number of clusters

2008-06-19 Thread Chua Siang Li
Hello there. I wanted to segment customers and is trying both kmeans and HCA method in R. As I don't know how many cluster is good for a set of data, in kmeans, I tried the code below and get a nice plot on number of cluster vs SSE. Looking at the slope between cluster number, I h

[R] Cluster on both categorical and numerical data

2008-06-18 Thread Chua Siang Li
Hello there. Is there any function in R that can do cluster on a set of data that has both categorical and numerical variables? thanks. siangli __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] How to output glm summary to csv file

2008-06-16 Thread Chua Siang Li
Hello there. I am new to R. I want to output the coefficients and their significance value (Pr(>|z|) into a csv file. I managed to do it for the "coefficients" but not their significances. Pls help. Thanks. mylogit<- glm(response~price, family=binomial(link="logit"),