similar to: How to formulate quadratic function with interaction terms for the PLS fitting model?

Displaying 20 results from an estimated 2000 matches similar to: "How to formulate quadratic function with interaction terms for the PLS fitting model?"

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 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 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?
> 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
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
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 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 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'
2017 Jul 12
0
How to formulate 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
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 13
0
Quadratic function with interaction terms for the PLS fitting model?
Hi Bert, Ok, to your initial point, the key nuance is that if 'x' is a vector, you can leave the 'degree' argument unnamed, however, if 'x' is a matrix, you cannot. That aspect of the behavior does not seem to change if poly() is called stand alone or, as suggested in ?poly, within a formula to be parsed. Working on tracing through the code using debug(), the error is
2011 Jul 21
1
Error: bad index in plotmo functions for MARS model (package earth)
Hello all useRs, I am tring make a simple surface plot ( 2 by 2 terms of a MARS model (with earth package) but I get the follow error message: > plotmo( mars ) Error: bad index (missing column in x?) I don't no how to workround this... :-( I thanks in advanced by some help! Thanks. Cleber ############### > > ### example code: > library( earth ) > data( gasoline,
2011 May 12
1
Fw: Help with PLSR
Hi I am attempting to use plsr which is part of the pls package in r. I amconducting analysis on datasets to identify which proteins/peptides are responsible for the variance between sample groups (Biomarker Spoting) in a multivariate fashion. I have a dataset in R called "FullDataListTrans". as you can see below the structure of the data is 40 different rows representing a
2011 May 18
1
Help with Memory Problems (cannot allocate vector of size)
While doing pls I found the following problem > BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, jackknife = >FALSE, validation = "LOO") when not enabling jackknife the command works fine, but when trying to enable jackknife i get the following error. >BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = 10, data = PLSdata, jackknife = >TRUE,
2011 May 17
1
Help with PLSR with jack knife
Hi I am analysing a dataset of 40 samples each with 90,000 intensity measures for various peptides. I am trying to identify the Biomarkers (i.e. most significant peptides). I beleive that PLS with jack knifing, or alternativeley CMV(cross-model-validation) are multivariateThe 40 samples belong to four different groups. I have managed to conduct the plsr using the commands: BHPLS1 <-
2009 Aug 28
2
Pls package
Hi, I have managed to format my data into a single datframe consisting of two AsIs response and predictor dataframes in order to supply the plsr command of the pls package for principal components analysis. When I execute the command, however, I get this error: > fiber1 <- plsr(respmat ~ predmat, ncomp=1, data=inputmat,validation="LOO") Error in model.frame.default(formula =
2017 Dec 05
2
PLS in R
Hello, I need help with a partial least square regression in R. I have read both the vignette and the post on R bloggers but it is hard to figure out how to do it. Here is the script I wrote: library(pls) plsrcue<- plsr(cue~fb+cn+n+ph+fung+bact+resp, data = cue, ncomp=7, na.action = NULL, method = "kernelpls", scale=FALSE, validation = "LOO", model = TRUE, x = FALSE, y =
2010 Jul 08
4
Column header strategy
Hopefully simple question: What is the best way to name, and treat factor columns for data that has lots of columns? This is my column list: id pID50 D.1 D.2 D.3 D.4 D.5 , etc. all the way to D.185 I was under the impression from several R examples in pls that if you name your columns like above, you should be able to simply call all the D factors with "D", instead of going in and