[R] output of mars() in package mda; how do I read the pairwise interaction terms from the output?
0.0 [19,]0016.03509 0 0 0.0 [20,]00 0.0 0 0 1.28535 [21,]00 0.0 0 0 1.28535 [22,]00 0.0 0 0 0.0 [23,]00 0.0 0 0 0.0 [24,]00 0.0 0 0 1.28535 [25,]00 0.0 0 0 1.28535 [26,]00 0.0 0 0 0.0 [27,]00 0.0 0 0 1.28535 [28,]00 0.0 0 0 0.0 [29,]00 0.0 0 0 0.0 [30,]00 0.0 0 0 0.0 [31,]00 0.0 0 0 1.28535 [32,]0016.03509 0 0 3.01888 [33,]00 0.0 0 0 1.28535 [34,]0016.03509 0 0 0.0 sclogit_new hit II_Find_Income2 II_SESI2 [1,] 0 0 00 [2,] 0 0 00 [3,] 0 0 00 [4,] 0 0 00 [5,] 0 0 00 [6,] 0 0 00 [7,] 0 0 0 16 [8,] 0 0 00 [9,] 0 0 00 [10,] 0 0 00 [11,] 0 0 00 [12,] 0 0 00 [13,] 0 0 00 [14,] 0 0 00 [15,] 0 0 00 [16,] 0 0 00 [17,] 0 0 00 [18,] 0 0 00 [19,] 0 0 00 [20,] 0 0 0 27 [21,] 0 0 00 [22,] 0 0 00 [23,] 0 0 00 [24,] 0 0 00 [25,] 0 0 00 [26,] 0 0 1220000 [27,] 0 0 00 [28,] 0 0 00 [29,] 0 0 00 [30,] 0 0 00 [31,] 0 0 00 [32,] 0 0 00 [33,] 0 0 2250000 [34,] 0 0 00 While I can construct splines in a similar manner to what I did for my first output, I am unable to figure out how to construct mars splines for the pairwise interactions I am supposed to be getting for degree=2. The mars documentation and Venables' and Ripley's Modern Applied Statistics with S (pages 235 to 237) do show similar output, but not how to construct splines or figure out the pairwise interactions. Any help is greatly appreciated. Thanks in advance. Jude Ryan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Error message in function mars() in package mda
Hi, I am using function mars() in package mda to find knots in a whole bunch of predictor variables. I hope to be able to replicate all or some of the basis functions that the MARS software from Salford Systems creates. When I ran mars() on a small dataset, I was able to get the knots. However, when I tried running mars() on a larger dataset (145 predictor variables), for a different project, I get the following error message: fit1 - mars(disney2[,-146], disney2[,146]) Error in mars(disney2[, -146], disney2[, 146]) : NA/NaN/Inf in foreign function call (arg 5) In addition: Warning messages: 1: NAs introduced by coercion 2: NAs introduced by coercion Does arg 5 refer to the 5th column in my dataset? This seems to be a data problem, is this correct? Are there any other functions in R that will give me the knots for a set of predictor variables? Any help is greatly appreciated. Thanks, Jude __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Error when I try to build / plot a tree using rpart()
Hi, I am using the rpart package to build a classification tree. I did manage to build a tree with data on a previous project. However, when attampting to build a tree on a project I am working on, I seem to be getting the error shown below: nhg3.rp - rpart(profitresp ~., nhg3, method=class) plot(nhg3.rp, branch=0.4, uniform=T); text(nhg3.rp, digits=3) Error in yval[, 1] : incorrect number of dimensions The distribution of my binary dependent variable is: table(nhg$profitresp) 01 3703 4360 I am using 105 potential predictor variables. I am trying to come up with a decision rule to identify profitable responders from non-responders to a mailing. Some other details are: summary(nhg3.rp) Call: rpart(formula = profitresp ~ ., data = nhg3, method = class) n= 8063 CP nsplit rel error 1 0.009451796 0 1 Error in yval[, 1] : incorrect number of dimensions print(nhg3.rp) n= 8063 node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 8063 3703 1 (0.4592583 0.5407417) * printcp(nhg3.rp) Classification tree: rpart(formula = profitresp ~ ., data = nhg3, method = class) Variables actually used in tree construction: character(0) Root node error: 3703/8063 = 0.45926 n= 8063 CP nsplit rel error 1 0.0094518 0 1 Any help is appreciated. Thanks much, Jude Ryan __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html