Displaying 1 result from an estimated 1 matches for "myrpart".
Did you mean:
mvrpart
2004 Sep 06
1
rpart problem
...0% and group
2 60%
tmp1 <- as.factor((runif (1000) <= 0.9))
tmp2 <- as.factor((runif (1000) <= 0.5))
mysuccess <- as.factor(c(tmp1, tmp2))
mygroup <- as.factor(c(rep (1,1000), rep (2,1000)))
table (mysuccess, mygroup)
chisq.test (mysuccess, mygroup)
# p-value = < 2.2e-16
myrpart <- rpart (mysuccess ~ mygroup)
myrpart
# rpart does not provide splits !!
If I change the parameter in the setting of group 2 to 0.3 from 0.6 rpart
does return splits, i.e. change the line
tmp2 <- as.factor((runif (1000) <= 0.6))
to
tmp2 <- as.factor((runif (1000) <= 0.3))...