Displaying 20 results from an estimated 3000 matches similar to: "Dataframes in PLS package"
2016 Apr 22
1
Unique Ordering
Hi R-Help,
data at bottom
I've been struggling with a problem where I need to order based on 1) the
Frequency "Freq" and 2) keeping each group of 3 of the same type together
"Var2" but I want across all groups it to go "high to low" based on the
earn factor.
Thank you!
structure(list(Var1 = structure(c(1L, 3L, 2L, 1L, 2L, 3L, 1L,
3L, 2L, 3L, 1L, 2L, 3L, 1L,
2013 Oct 11
3
matrix values linked to vector index
Hi,
In the example you showed:
m1<- matrix(0,length(vec),max(vec))
1*!upper.tri(m1)
#or
?m1[!upper.tri(m1)] <-? rep(rep(1,length(vec)),vec)
#But, in a case like below, perhaps:
vec1<- c(3,4,5)
?m2<- matrix(0,length(vec1),max(vec1))
?indx <- cbind(rep(seq_along(vec1),vec1),unlist(tapply(vec1,list(vec1),FUN=seq),use.names=FALSE))
m2[indx]<- 1
?m2
#???? [,1] [,2] [,3] [,4] [,5]
2005 Nov 17
4
problem with \eqn (PR#8322)
Full_Name: Ross Boylan
Version: 2.2.0
OS: Linux
Submission from: (NULL) (65.175.48.58)
\eqn{{\bf\beta}_j}{b(j)} in my .Rd file produces this error
--------------------------------------------
! Missing $ inserted.
<inserted text>
$
l.7 \eqn{{\bf\beta}_j}{\bf\beta}_
jnormal-bracket5bracket-normal{b(j)}
--
! Missing $ inserted.
<inserted
2007 Oct 16
1
data structure for plsr
All,
I am working with NIR spectral data and it was great to find that the example in ?plsr also used spectral data. Unfortunately, I am having difficulty figuring out how the "yarn" dataset is structured to allow for the plsr model to read:
library(pls)
data(yard)
yarn.oscorespls <- mvr(density ~ NIR, 6, data = yarn, validation = "CV", method = "oscorespls")
2005 May 12
1
pls -- crossval vs plsr(..., CV=TRUE)
Hi,
Newbie question about the pls package.
Setup:
Mac OS 10.3.9
R: Aqua GUI 1.01, v 2.0.1
I want to get R^2 and Q^2 (LOO and Leave-10-Out) values for each
component for my model.
I was running into a few problems so I played with the example a little
and the results do not match up with the comments
in the help pages.
$ library(pls)
$ data(NIR)
$ testing.plsNOCV <- plsr(y ~ X, 6, data =
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
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 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 May 07
1
I need your help about plsr
Hi, I need your help, so I send letter to you.
I have a problem about plsr in pls package. I want to show how classfied or
related each ohter samples, so I tried to use plsr and biplot.
But, I failed. Because, I had to change data type of my sample.
Unfortunately, I didn't know how change data type.
I want you to help me about that.
please, help me.
I show you my sample data , my scripts
2012 Oct 29
4
replace repeated id in a pedigree list
Hello,
I have a pedigree file such this:
FAMID ID FA ID MO ID SEX STATUS
1 1 0 0 2 0
1 2 3 1 2 2
1 4 3 1 1 2
1 5 3 1 1 0
1 6 3 1 1 0
1 7 3 1 2 2
1 8 3 1 1 0
1 9 3 1 1 0
1 10 3 1 2 0
1 11 3 1 1 0
1 3 0 0 1 0
2 12 13
2007 May 23
1
I made some progress on my previous "systemfit" question but still not quite there
Surprisingly, I played around with some test code and below actually
creates equations that look correct.
tempmat<-matrix(10,nrow=6,ncol=6)
restrictmat<-diag(6)
colnames(tempmat)<-c("AUD.l1","CHF.l1","CAD.l1","GBP.l1","EUR.l1","JPY.l
1")
2007 May 25
2
R-About PLSR
hi R help group,
I have installed PLS package in R and use it for princomp & prcomp
commands for calculating PCA using its example file(USArrests example).
But How I can use PLS for Partial least square, R square, mvrCv one more
think how i can import external file in R. When I use plsr, R2, RMSEP it
show error could not find function plsr, RMSEP etc.
How I can calculate PLS, R2, RMSEP, PCR,
2011 Apr 06
5
Need a more efficient way to implement this type of logic in R
I have cobbled together the following logic. It works but is very
slow. I'm sure that there must be a better r-specific way to implement
this kind of thing, but have been unable to find/understand one. Any
help would be appreciated.
hh.sub <- households[c("HOUSEID","HHFAMINC")]
for (indx in 1:length(hh.sub$HOUSEID)) {
if ((hh.sub$HHFAMINC[indx] == '01')
2011 Feb 02
2
Using MathJax in R's help system
Hi,
I am doing a small experiment to test if I can use
MathJax ( official site: http://www.mathjax.org )
in R's html help pages (i.e. options(help_type='html'))
and it seems working with some minor modifications.
The screenshot (rendered by Firefox 4.0 beta and with STIX fonts) of
the help page in html format with MathJax enabled is at the following
url:
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
2010 Feb 19
1
ggplot2 X axis levels
Hi all:
I've done this before with factors but can't figure how to do it with
a continuous variable. I am trying to reorder the sequence of my weeks
along the X axis. I want to start with week 27 to 52 and then 1 to 26.
I guess I could use levels along with seq() but doesn't seem to work for me.
Thanks for your help
winter <- structure(list(week = c(27L, 28L, 29L, 30L, 31L, 32L,
2013 Mar 22
3
Distance calculation
Hi Elisa,
I hope this is what you wanted.
dat1<-read.csv("peaks.csv",sep=",")
#Subset
dat2<-dat1[1:5,]
res1<-do.call(cbind,lapply(seq_len(nrow(dat2)),function(i) do.call(rbind,lapply(split(rbind(dat2[i,],dat2[-i,]),1:nrow(rbind(dat2[i,],dat2[-i,]))), function(x) {x1<-rbind(dat2[i,],x);
2012 Mar 16
3
Faster way to implement this search?
I am working on a simulation where I need to count the number of matches
for an arbitrary pattern in a large sequence of binomial factors. My
current code is
for(indx in 1:(length(bin.05)-3))
if ((bin.05[indx] == test.pattern[1]) && (bin.05[indx+1] ==
test.pattern[2]) && (bin.05[indx+2] == test.pattern[3]))
return.values$count.match.pattern[1] =
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
2011 May 13
1
PLSR error
Hi,
this is my R-Script
library(pls)
file <- "C:\\TXT\\brix.txt"
d <- as.matrix(read.table(file, header=T, sep=",", row.names = NULL))
plsdata <- data.frame(NIR=c(1:nrow(X)))
plsdata$NIR <- I(d[,3:603])
plsdata$Brix <- d[,2]
results <- plsr(Brix ~ NIR, data=plsdata)
after the last string i have this error
> results <- plsr(Brix ~ NIR, data=plsdata)