Re: [R] CHAID in R

2020-03-16 Thread Alaa Lababidi



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] CHAID in R

2014-04-24 Thread Preetam Pal
Hi,
I want to implement CHAID in R, but at this point am not sure how to go
about it.
Would be glad if someone please helps me out with it. I am attaching the
data set for your perusal.
The variable in the 1st column is the dependent variable.
Thanks,
Preetam

-- 
Preetam Pal
(+91)-9432212774
M-Stat 2nd Year, Room No. N-114
Statistics Division,   C.V.Raman
Hall
Indian Statistical Institute, B.H.O.S.
Kolkata.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CHAID in R

2013-11-15 Thread Achim Zeileis

On Sat, 16 Nov 2013, Preetam Pal wrote:


Hi,

I have a data set on credit rating for customers in a bank (Rating is 1 
for defaulter, 0 = non-defaulter). I have 10 predictor variables 
(C1,C2,.,C10) . I want to build a CHAID Tree using R for 
classification. How do I do this? For your perusal, the data set is 
attached. Thanks in advance.


The classical CHAID algorithm is implemented in a package on R-Forge:
https://R-Forge.R-project.org/R/?group_id=343
However, this only supports categorical covariates and hence is not useful 
for your data.


Alternatively, you might want to try out other packages for learning 
classification trees, e.g., partykit or rpart. See also

http://CRAN.R-project.org/view=MachineLearning

For your data you could do:

## read data with factor response
d <- read.table("text.txt", header = TRUE)
d$Rating <- factor(d$Rating)

## ctree
library("partykit")
ct <- ctree(Rating ~ ., data = d)
plot(ct)

## rpart
library("rpart")
rp <- rpart(Rating ~ ., data = d, control = list(cp = 0.02))
plot(as.party(rp))

## evtree
library("evtree")
set.seed(1)
ev <- evtree(Rating ~ ., data = d, maxdepth = 5)
plot(ev)

All methods agree that the decisive split is in C2 at about -110. And 
possibly you might be able to infer some more splits for the < -110 
subsample but there the methods disagree somewhat.


Best,
Z


-Preetam

--
Preetam Pal
(+91)-9432212774
M-Stat 2nd Year, Room No. N-114
Statistics Division,   C.V.Raman
Hall
Indian Statistical Institute, B.H.O.S.
Kolkata.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] CHAID in R

2013-11-15 Thread Preetam Pal
Hi,

I have a data set on credit rating for customers in a bank (Rating is 1 for
defaulter, 0 = non-defaulter). I have 10 predictor variables
(C1,C2,.,C10) . I want to build a CHAID Tree using R for
classification. How do I do this? For your perusal, the data set is
attached. Thanks in advance.

-Preetam

-- 
Preetam Pal
(+91)-9432212774
M-Stat 2nd Year, Room No. N-114
Statistics Division,   C.V.Raman
Hall
Indian Statistical Institute, B.H.O.S.
Kolkata.
C1  C2  C3  C4  C5  C6  C7  C8  C9  C10 
Rating
-24 -12 -1108   -4  5   12  -29 -109-225178 0
-150-118-5628   -7  15  83  -75 -303-1167   859 
1
-50 -31 -1984   -4  7   25  -36 -139-409308 0
-196-135-7454   -10 19  104 -105-416-1547   11390
-119-78 -4607   -8  13  63  -70 -277-955707 
1
-226-146-8563   -12 21  119 -116-465-1780   13050
-69 -52 -2684   -5  9   37  -46 -178-553416 0
-173-119-6571   -9  17  92  -90 -363-1365   10040
-73 -43 -2895   -5  8   37  -50 -195-598449 0
-130-92 -4950   -7  13  69  -69 -274-1028   757 
1
-31 -24 -1225   -2  4   17  -22 -81 -252190 
1
-109-96 -4075   -5  12  62  -57 -224-843624 
1
-38 -28 -1482   -3  4   21  -23 -93 -306229 0
-27 -29 -1137   -3  5   16  -28 -103-231183 
1
-34 -28 -1328   -3  4   19  -22 -89 -273206 0
-31 -34 -1215   -3  4   19  -21 -85 -249190 
1
-59 -46 -2295   -5  8   32  -41 -157-472357 0
-201-129-7633   -10 19  106 -103-410-1586   11630
-312-181-11894  -17 29  160 -162-646-2475   1813
1
-85 -62 -3245   -5  10  46  -48 -189-671497 0
-51 -30 -2019   -4  6   26  -36 -141-417314 0
-63 -35 -2504   -5  8   32  -41 -163-518386 0
-52 -32 -2121   -4  7   27  -38 -145-439329 0
-42 -29 -1708   -5  5   23  -32 -121-351266 0
-51 -33 -1957   -3  5   27  -30 -120-405301 0
-31 -18 -1300   -3  4   16  -24 -94 -269203 0
-8  -6  -404-2  2   4   -14 -50 -82 68  0
-9  -10 -389-1  2   6   -14 -52 -76 65  0
-58 -34 -2284   -4  6   30  -36 -144-473352 0
-170-135-6467   -10 18  94  -96 -377-1338   994 
1
-46 -36 -1811   -3  5   26  -32 -119-373280 0
-100-71 -3802   -6  10  54  -54 -215-788582 0
-145-89 -5547   -9  14  76  -77 -308-1152   847 0
-28 -20 -1198   -4  5   15  -28 -105-245191 0
-36 -25 -1395   -3  5   19  -25 -96 -288217 0
-120-99 -4489   -6  13  67  -63 -246-930687 
1
-154-119-5779   -8  15  85  -79 -318-1198   884 0
-52 -38 -1987   -4  6   28  -33 -130-410308 
1
-29 -19 -1160   -3  4   15  -22 -88 -238182 0
-10 -11 -434-1  2   6   -10 -40 -88 70  0
-59 -53 -2208   -3  8   34  -35 -134-456340 0
-27 -23 -1096   -2  5   16  -19 -76 -225170 0
-152-92 -5867   -9  15  79  -84 -335-1219   897 0
-154-105-5851   -9  15  82  -80 -318-1214   892 0
-152-115-5812   -9  17  83  -87 -340-1203   893 
1
-33 -23 -1318   -3  4   18  -25 -93 -272206 0
-58 -57 -2177   -3  8   34  -36 -139-447337 0
-32 -20 -1279   -2  5   16  -22 -84 -265197 0
-178-100-6835   -10 17  91  -95 -382-1422   10440
-51 -34 -1961   -4  5   27  -30 -122-405302 0
-57 -48 -2208   -3  7   32  -35 -133-456340 0
-148-98 -5641   -8  14  79  -78 -312-1172   862 0
-31 -24 -1194   -2  4   17  -20 -

Re: [R] CHAID in R

2009-08-29 Thread Achim Zeileis

On Fri, 28 Aug 2009, Arup wrote:


Hi..I am trying to run CHAID in R..I have installed the sofyware Party and
trying to use the function ctree() to carry out the analysis. but I am
getting the following message Error in terms.default(formula, data = data) :
no terms component


Without a simple reproducible example (as the posting guide tells you) 
it's hard to say what went wrong for you.



. I am having some Likert scale variable where I have variables like
"Overall satisfaction"(Dependent Variable),"Product quality", Brand
image,Warranty(Independent variable) etc..


ctree() can handle this situation appropriately, see
   vignette("party", package = "party")
for more details and worked examples.


Now can anyone tell me how to run
CHAID in this case..what would be the formula? Thanks in Advance..


CTree is similar in spirit to CHAID but not the same. However, there is 
the CHAID package on R-Forge (as pointed out previously, thanks to Max).


CTree is more flexible and can deal with more types of variables, e.g., it 
would be possible to use linear-by-linear type tests instead of plain 
Chi-squared tests for ordinal variables.


hth,
Z



--
View this message in context: 
http://www.nabble.com/CHAID-in-R-tp25188573p25188573.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CHAID in R

2009-08-28 Thread Wensui Liu
i couldn't find it on CRAN.

On Fri, Aug 28, 2009 at 5:16 PM, Max Kuhn  wrote:

> > well, are you sure if party() can implement chaid?
> > i doubt if chaid is being implemented in any R package.
>
> https://r-forge.r-project.org/projects/chaid/
>
>
> --
>
> Max
>



-- 
==
WenSui Liu
Blog   : statcompute.spaces.live.com
Tough Times Never Last. But Tough People Do.  - Robert Schuller
==

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CHAID in R

2009-08-28 Thread Max Kuhn
> well, are you sure if party() can implement chaid?
> i doubt if chaid is being implemented in any R package.

https://r-forge.r-project.org/projects/chaid/


-- 

Max

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CHAID in R

2009-08-28 Thread Wensui Liu
well, are you sure if party() can implement chaid?
i doubt if chaid is being implemented in any R package.

On Fri, Aug 28, 2009 at 7:50 AM, Arup  wrote:

>
> Hi..I am trying to run CHAID in R..I have installed the sofyware Party and
> trying to use the function ctree() to carry out the analysis. but I am
> getting the following message Error in terms.default(formula, data = data)
> :
> no terms component
> . I am having some Likert scale variable where I have variables like
> "Overall satisfaction"(Dependent Variable),"Product quality", Brand
> image,Warranty(Independent variable) etc.. Now can anyone tell me how to
> run
> CHAID in this case..what would be the formula? Thanks in Advance..
> --
> View this message in context:
> http://www.nabble.com/CHAID-in-R-tp25188573p25188573.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
==
WenSui Liu
Blog   : statcompute.spaces.live.com
Tough Times Never Last. But Tough People Do.  - Robert Schuller
==

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] CHAID in R

2009-08-28 Thread Arup

Hi..I am trying to run CHAID in R..I have installed the sofyware Party and
trying to use the function ctree() to carry out the analysis. but I am
getting the following message Error in terms.default(formula, data = data) :
no terms component
. I am having some Likert scale variable where I have variables like
"Overall satisfaction"(Dependent Variable),"Product quality", Brand
image,Warranty(Independent variable) etc.. Now can anyone tell me how to run
CHAID in this case..what would be the formula? Thanks in Advance..
-- 
View this message in context: 
http://www.nabble.com/CHAID-in-R-tp25188573p25188573.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.