similar to: Error: bad index in plotmo functions for MARS model (package earth)

Displaying 20 results from an estimated 700 matches similar to: "Error: bad index in plotmo functions for MARS model (package earth)"

2017 Jul 13
3
How to formulate quadratic function with interaction terms for the PLS fitting model?
I have two ideas about it. 1- i) Entering variables in quadratic form is done with the command I (variable ^ 2) - plsr (octane ~ NIR + I (nir ^ 2), ncomp = 10, data = gasTrain, validation = "LOO" You could also use a new variable NIR_sq <- (NIR) ^ 2 ii) To insert a square variable, use syntax I (x ^ 2) - it is very important to insert I before the parentheses. iii) If you want to
2017 Jul 13
2
Quadratic function with interaction terms for the PLS fitting model?
Dear all, I am using the pls package of R to perform partial least square on a set of multivariate data. Instead of fitting a linear model, I want to fit my data with a quadratic function with interaction terms. But I am not sure how. I will use an example to illustrate my problem: Following the example in the PLS manual: ## Read data data(gasoline) gasTrain <- gasoline[1:50,] ## Perform
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
> On Jul 13, 2017, at 10:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > poly(NIR, degree = 2) will work if NIR is a matrix, not a data.frame. > The degree argument apparently *must* be explicitly named if NIR is > not a numeric vector. AFAICS, this is unclear or unstated in ?poly. I still get the same error with: library(pld) data(gasoline) gasTrain <-
2017 Jul 13
0
How to formulate quadratic function with interaction terms for the PLS fitting model?
Below. -- Bert Bert Gunter On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini <luigi.biagini at gmail.com> wrote: > I have two ideas about it. > > 1- > i) Entering variables in quadratic form is done with the command I > (variable ^ 2) - > plsr (octane ~ NIR + I (nir ^ 2), ncomp = 10, data = gasTrain, validation = > "LOO" > You could also use a new variable
2017 Jul 13
4
Quadratic function with interaction terms for the PLS fitting model?
poly(NIR, degree = 2) will work if NIR is a matrix, not a data.frame. The degree argument apparently *must* be explicitly named if NIR is not a numeric vector. AFAICS, this is unclear or unstated in ?poly. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom
2009 Oct 22
1
data frame is killing me! help
Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the gasoline data to see below NIR.1686 nm NIR.1688 nm NIR.1690 nm NIR.1692 nm NIR.1694 nm NIR.1696 nm NIR.1698 nm NIR.1700 nm 1 1.242645 1.250789 1.246626 1.250985 1.264189 1.244678 1.245913
2008 May 11
1
Fundamental formula and dataframe question.
There is a very useful and apparently fundamental feature of R (or of the package pls) which I don't understand. For datasets with many independent (X) variables such as chemometric datasets there is a convenient formula and dataframe construction that allows one to access the entire X matrix with a single term. Consider the gasoline dataset available in the pls package. For the model
2017 Jul 16
2
How to formulate quadratic function with interaction terms for the PLS fitting model?
> On Jul 13, 2017, at 7:43 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > Below. > > -- Bert > Bert Gunter > > > > On Thu, Jul 13, 2017 at 3:07 AM, Luigi Biagini <luigi.biagini at gmail.com> wrote: >> I have two ideas about it. >> >> 1- >> i) Entering variables in quadratic form is done with the command I >>
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
> On Jul 12, 2017, at 6:58 PM, Ng, Kelvin Sai-cheong <kscng at connect.hku.hk> wrote: > > Dear all, > > I am using the pls package of R to perform partial least square on a set of > multivariate data. Instead of fitting a linear model, I want to fit my > data with a quadratic function with interaction terms. But I am not sure > how. I will use an example to
2017 Jul 16
0
How to formulate quadratic function with interaction terms for the PLS fitting model?
?? If I haven't misunderstood, they are completely different! 1) NIR must be a matrix, or poly(NIR,...) will fail. 2) Due to the previously identified bug in poly, degree must be explicitly given as poly(NIR, degree =2,raw = TRUE). Now consider the following example: > df <-matrix(runif(60),ncol=3) > y <- runif(20) > mdl1 <-lm(y~df*I(df^2)) > mdl2
2017 Jul 13
0
Quadratic function with interaction terms for the PLS fitting model?
Bert, The 'degree' argument follows the "..." argument in the function declaration: poly(x, ..., degree = 1, coefs = NULL, raw = FALSE, simple = FALSE) Generally, any arguments after the "..." must be explicitly named, but as per the Details section of ?poly: "Although formally degree should be named (as it follows ...), an unnamed second argument of length 1
2017 Jul 13
2
Quadratic function with interaction terms for the PLS fitting model?
Marc: 1. I am aware of the need to explicitly name arguments after ... -- see the R Language definition where this can be inferred from the argument matching rules. 2. I am aware of the stated exception for poly(). However: > x1 <- runif(20) > x2 <- runif(20) > mx <- cbind(x1,x2) > poly(mx,2) Error in poly(dots[[i]], degree, raw = raw, simple = raw) : 'degree'
2011 Sep 14
1
substitute games with randomForest::partialPlot
I'm having trouble calling randomForest::partialPlot programmatically. It tries to use name of the (R) variable as the data column name. Example: library(randomForest) iris.rf <- randomForest(Species ~ ., data=iris, importance=TRUE, proximity=TRUE) partialPlot(iris.rf, iris, Sepal.Width) # works partialPlot(iris.rf, iris, "Sepal.Width") # works (function(var.name)
2007 May 10
0
New package "earth"
The "earth" package is now available on CRAN. Earth builds models using Friedman's MARS. Earth's principal advantages over the existing function mda::mars are that it is much faster and provides plotting and printing methods. The general purpose model plotting function "plotmo" may also be useful to people who are not interested in earth itself. Example: > a
2007 May 10
0
New package "earth"
The "earth" package is now available on CRAN. Earth builds models using Friedman's MARS. Earth's principal advantages over the existing function mda::mars are that it is much faster and provides plotting and printing methods. The general purpose model plotting function "plotmo" may also be useful to people who are not interested in earth itself. Example: > a
2009 Dec 08
1
Serial Correlation in panel data regression
Dear R users, I have a question here library(AER) library(plm) library(sandwich) ## take the following data data("Gasoline", package="plm") Gasoline$f.year=as.factor(Gasoline$year) Now I run the following regression rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap" m1<- lm(as.formula(paste("lgaspcar ~", rhs)), data=Gasoline) ###Now I want to find the
2010 May 11
1
Gasoline Data in pls package
Hi - I am using pls package for some pcr computations. There is a data set called gasoline. Would someone be able to tell me what command(s) could be used to produce this graph in R? I am not sure where the log(1/R) - Y-axis - are coming from Thanks much Ravi
2015 Jun 26
1
[R-pkg-devel] Guidelines for S3 regression models
Stephen, thanks for your effort. The more appropriate list for this discussion is probably R-devel (as far as I understand it) so I've moved the discussion there. Related topics have already been discussed in the past. Specifically, I remember contributions by Paul Johnson ("rockchalk" package) and John Fox ("effects" and "car" package) as their packages
2009 Jul 09
2
plm Issues
Hi List I'm having difficulty understanding how plm should work with dynamic formulas. See the commands and output below on a standard data set. Notice that the first summary(plm(...)) call returns the same result as the second (it shouldn't if it actually uses the lagged variable requested). The third call results in error (trying to use diff'ed variable in regression) Other info:
2011 Jan 10
3
Lattice, combine histogram and line graph
Hello everyone, I have a simple histogram of gasoline prices going back a few years that I want to insert a line graph of consumer price index (cpi) over the histogram. I have looked through the "Lattice" book by Deepayan Sarkar but don't see anything there. How might this be done? An example would be wonderful. Current code snippet follows. For example additional field to add