prcomp() in stats handles matrices with n < p well, IMO.
--
Bjørn-Helge Mevik
__
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
Jeffrey J. Hallman wrote:
> I've been doing econometrics for nearly 20 years, and have not yet run across
> a situation that called for looking at a 1000 x 1000 matrix. I tend not to
> believe analyses with more than a dozen explanatory variables.
In NIR spectroscopy, it is common to have at lea
Try this
result <- summary(prcomp(USArrests))
names(result)
M <- result$importance
M[2,]
The "labels" are the dimnames of the "importance" matrix. They only
"show up" when the matrix is printed. If you wish, you can remove
them with dimname
CV, or train).
The objects returned by these functions have a plot method, som
plot(RMSEP(...)) does "what you'd expect". See ?R2 for details about
the returned objects.
To get R (I presume you mean the correlation between predicted and
measured values), yo
res Regression in R; Journal of
Statistical Software 18(2), 1--24.
<http://www.jstatsoft.org/v18/i02/v18i02.pdf>
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the post
>From within R, you can give the command
> install.packages("pls")
and R will download and install it for you (as long as you have access
to the Internet).
To install an already downloaded package, you can use
R CMD INSTALL pls_2.0-0.tar.gz
in a terminal window.
--
B
e:
M <- matrix(rnorm(900*100), ncol = 900)
pca <- prcomp(M, scale = TRUE)
S <- scale(M) %*% pca$rotation
all.equal(S, pca$x) ## => TRUE
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
cumulative' has been
removed.
- A new data set 'gasoline' has been included.
- The 'NIR' and 'sensory' data sets have been renamed to 'yarn' and 'oliveoil'.
See the file CHANGES in the sources for all changes.
--
Bjørn-Helge Mevik
__
x27; is 'TRUE', the factor levels are assumed to be ordered.
> ...
The help file for factor() probably doesn't tell you much about how
cut() works. :-)
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat
I think the Bioconductor package PROcess has functions for that.
--
Bjørn-Helge Mevik
__
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
ataframe)
(i.e. with no formula!) will use the first column as response and the
rest as predictors.
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://w
ning 3 and -3,
respectively), while
1 + 2 -
3
will be interpreted as a single command (returnig 0).
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http:/
er jejuni under environmental conditions,
Applied and Environmental Microbiology, 71, 2086-2094.
--
Bjørn-Helge Mevik and Øyvind Langsrud
___
R-packages mailing list
R-packages@stat.math.ethz.ch
https://stat.ethz.ch/mailman/list
Perhaps ?grid will help you.
--
Bjørn-Helge Mevik
__
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
and provide commented, minimal, self
t; sqrt(eX$values)
[1] 1.2931924 1.0215069 0.8346836 0.5828707
> sqrt(9/10 * eX$values)
[1] 1.2268300 0.9690865 0.7918504 0.5529597
--
Bjørn-Helge Mevik
__
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
Just an idea: how about using the \usage for the formal syntax, and
\synopsis for the "user syntax", i.e. x/y ?
Not sure it will work, but it might be worth a try... :-)
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing
capture.output(...)
If you want a single string, with newlines:
paste(capture.output(...), collapse = "\n")
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the pos
Liaw, Andy wrote:
> I don't see it on CRAN, either, nor could I find mention of it in the R News
> you cited.
p. 66
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
ter off using an existing implementation,
for instance Barry Wise's chemometric toolbox.
--
Bjørn-Helge Mevik
__
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
format p-values in different ways using format.pval(), which
returns a string with the formatted value. E.g.,
> format.pval(2e-14)
[1] "2e-14"
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/lis
of
(R)MSEP and R2
- A simple multiplicative scatter correction (msc) implementation
- Functions for plotting predictions, validation statistics,
coefficients, scores, loadings, biplots and correlation loadings.
--
Bjørn-Helge Mevik
___
R-packages
Andris Jankevics wrote:
> But I have a sligthy different results with my real data. Where can the
> problem be?
I think you have to supply some details for anyone to be able to
answer. At least what you did (the code), what you got (the results)
and what you expected to get.
--
Bjørn
):
d1=scale(test_data, center=pca$center, scale=FALSE) %*% pca$rotation;
--
Bjørn-Helge Mevik
__
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
scoreplot() are now
generic.
See the file CHANGES in the sources for all changes.
--
Ron Wehrens and Bjørn-Helge Mevik
___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages
_
cients in significance tests. (I don't have any
reference or implementation, sorry. :-)
The correlation loadings can also give valuable information about
which variables that might be important for the regression. See
?corrplot in the pls package.
--
Bjørn-Helge Mevik
___
Why don't you test it yourself?
E.g.,
set.seed(42)
bob1 <- rnorm(1000,0,1)
set.seed(42)
bob2 <- rnorm(500,0,1)
bob3 <- rnorm(500,0,1)
identical(bob1, c(bob2, bob3))
I won't tell you the answer. :-)
--
Bjørn-Helge Mevik
__
R-hel
>
> any(logical(0))
> [1] FALSE
But they are, all none of them:
> all(!logical(0))
[1] TRUE
:-)
And there aren't any FALSE values either:
> any(!logical(0))
[1] FALSE
so it is only logical that all none of them are TRUE. I love the
empty set! :-)
--
Bjørn-Helge Mevik
--
Sincerely,
Bjørn-Helge Mevik
___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r
is changed
by R CMD build, is DESCRIPTION. All .R and .Rd files are untouched
(even the modification dates are unchanged). (This is on a Linux
system, I don't know how it works on MS/Mac.)
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.
Bjørn-Helge Mevik wrote:
> Or use \documentclass[nogin,...]{...}. Then the 'Gin' will have no
> effect, and the size of the plots in the document will not be changed
> from the size given as <<...,height=??,width=??>> (i.e. the size
> produced by R).
A s
ocument will not be changed
from the size given as <<...,height=??,width=??>> (i.e. the size
produced by R).
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
Michael O'Connell wrote:
> tools to make it easy to convert R packages to S-PLUS.
Not the other way around as well?
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
y) quickly have led you to manuals
such as "the R Language Definition", "Writing R Extensions" and "R
Data Import/Export", and given references to books on programming S
and/or R.
--
Bjørn-Helge Mevik
__
R-help@stat.math.
`varnames' in coefplot, to label the x tick marks with the
variable names.
- loadingplot, coefplot and plot.mvrVal can now display legends, with the
argument 'legendpos'.
See CHANGES in the sources for all changes.
--
Bjørn-Helge Mevik
tvar = 16562,
Because the Xtotvar is the "total X variation", measured by sum(X^2)
(where X has been centered). With 14 variables, scaled to sd == 1,
and 1200 observations, you should get Xtotvar == 14*(1200-1) ==
16786. (Maybe you have 1184 observations: 14*1183 == 16562.)
The payoff came in the
section giving the meaning of the C library error codes: EGREGIOUS
means `You did *what*?'. :-)
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do re
l), but you would have to build the "inner
model" (the constructs) with other tools, such as prcomp/princomp or
other factor analyses (see e.g. ?factanal and ?varimax).
Alternatively, there is an R package "sem" that implements structured
equation models. You might want t
ge currently doesn't estimate se of
cross-validated MSEPs. There is also the question of what the
estimated should be conditioned on: for leave-one-out
cross-validation, sd(MSEP | trainData) = 0.
[If someone knows how to calculate unbiased estimates of
cross-validated MSEPs, plea
dings) %*% t$projection)
[1] TRUE
(A tip: Since 't' is used for transposing, it is usually a Good
Thing(TM) to avoid using it as a varable name.)
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/lis
Supposing 'inmatrix' is a matrix with coloumn names 'x1', 'x2' and
'x3'; how about something like
model.matrix(~ (x1 + x2 + x3)^2 + log(x1) + log(x2) + log(x3) +
sqrt(x1) + sqrt(x2) + sqrt(x3) - 1,
as.data
One way is to use the loadingplot() function in the package `pls':
molprop.pc <- princomp(whatever)
library(pls)
loadingplot(molprop.pc, scatter = TRUE, labels = "names")
(If you want comp 2 vs. comp 1:
loadingplot(molprop.pc, comps = 2:1, scatter = TRUE, labels = "na
I'd like to thank the developers in the Core Team for their great
work! R has become an invaluable and indispensible tool for (at least)
me, much thanks to the hard and good work of the Core Team.
--
Bjørn-Helge Mevik
__
R-help@stat.math.et
Werner Wernersen writes:
> the graphs look nice on the screen but when printed in black and
> white every color apart from black doesn't look very nice.
My advice is: If you want a black-and-white or grayscale printout, don't
plot in colors.
--
B
rst loadings
(The loadings can also be extracted with loadings(pc)[,1:4] .)
--
Bjørn-Helge Mevik
__
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
Roger D. Peng writes:
> On a Unix like system you can do `nice +19 R' or perhaps `nice +19 R
> CMD BATCH commands.R'.
At least on Suse (9.1) and Debian (3.0) Linux, the syntax is
`nice -19 R' (i.e. with `-', not `+'.)
--
Bjørn-Helge Mevik
__
I haven't found any other solution than using
<>
theCode()
@
(but of course that doesn't have any effect when theCode() is used
interactively).
--
Bjørn-Helge Mevik
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/ma
I haven't been able to connect to http://bugs.r-project.org the last
few days. Is there a problem with the site (or am I having a
problem :-) ?
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
P
ree that the regularity of R (or S) is part of what
makes it so much better than for instance Matlab. At least for me.)
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
lacing the PCA
"outside" the cross-validation. (The same for any resampling-based
validation.)
--
Bjørn-Helge Mevik
__
[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
file format and use a binary editor to extract/repair
objects in the file -- and even then, if the file was compressed, you
may be out of luck).
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLE
Well, you could download the latest beta-release and look in the NEWS
file there.
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting
u already have packages such as
SparseM, Matrix and graph installed on your system. If you don't,
help.search("sparse matrix") returns no matches. :-)
--
Bjørn-Helge Mevik
__
[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
Since you didn't say anything about _what_ you did, either in SAS or
R, my first thought was: Have you checked that you use the same
parametrization of the models in R and SAS?
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
s spectroscopic data.
> and whether the dependent variable should be scaled.
There is no need for scaling the dependent variable.
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do
he
covariance with the response, the first few components are usually
more correlated to the response than PCs. For spectroscopists, the
PLSR loadings are often very interpretable, and are much used to
qualitatively validate the model.
--
Bjørn-Helge Mevik
_
n k1(J) = ... and k2(J) = ...
> How do I write k2 in R?
> k1 = f(t,y)
> k2 = ?
## If f can take vector arguments:
k1 <- f(tt[-M],y)
k2 <- f(tt[-1], y+h*k1)
## Otherwise:
for (J in 1:M) {
k1[J] <- f(tt[J], y[J])
k2[J] <- f(tt[J+1], y[J] + h*k1[J])
}
--
Hth,
Bjørn-Helge Me
Rajarshi Guha <[EMAIL PROTECTED]> writes:
> apply(x, c(2), funtion(v1,v2){ identical(v1,v2) }, v2=c(1,4,2))
>
> The above gives me a syntax error. I also tried:
No wonder! Try with `function' instead of `funtion'.
--
Bjørn-Helge Mevik
/cran.r-project.org/bin/linux/debian woody
main' to /etc/apt/sources.list, to get the latest version of R.)
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Don't be disappointed, be glad: It gives you the opportunity to
contribute by writing one yourself!
(Remember, R is developed by volunteers.)
--
Sincerely,
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/ma
Thanks for good suggestions for alternatives to princomp!
My original question, though, was /why/ it was decided to disallow
more coloumns than rows in princomp. (And also whether it would be
possible to augment the result from prcomp with the coloumn means.)
--
Bjørn-Helge Mevik
ed from the new
data. Would it break conformance with S to let prcomp return the
means as well?
--
Sincerely,
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Ernie Adorio <[EMAIL PROTECTED]> writes:
> If not possible, is there any built-in R command to reverse the rows of a
> matrix?
How about Face[nrow(Face):1, ] ?
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.
Spencer Graves <[EMAIL PROTECTED]> writes:
> You need to say "library(nlme)" first.
Of course. But since he has alreade used lme to fit the models, he
must have loaded the library already. :-)
--
Bjørn-Helge Mevik
__
[EMAIL PROT
It is documented in ?anova.lme:
> anova(res1, type="marginal")
and
> anova(res2, type="marginal")
should give equivalent tables.
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Prof Brian D Ripley <[EMAIL PROTECTED]> writes:
> On Tue, 12 Aug 2003, [iso-8859-1] Bjørn-Helge Mevik wrote:
>
>> Also, is this example (lm(y~x+I(x^2), Df)) really balanced? I think
>
> No, and I did not use summary,aov on it!
And I didn't say you did!
>> Th
odel, i.e. it
is no longer marginal.
Using poly (x, 2) instead of x + I(x^2), one gets a marginal SS for
the total effect of x, but not for the linear and quadratic effects
separately. (summary.aov() has a 'split' argument that can be used to
get separate SSs, but the
s that I think it would be nice if a
function like Anova in the car package returned R(x | A, B, A:B)
instead of R(x | A, B, A:B, x^2) as SS for x in a model such as the
above.
(I hope I've made myself clearer, and not insulted anyone by
oversimplifying. :-)
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Mona Riihimaki <[EMAIL PROTECTED]> writes:
> I've done lme-analysis with R; [...] I'd need also the mean squares.
AFAIK, lme doesn't calculate sum of squares (or mean squares). It
maximises the likelihood (or restricted likelihood) and uses tests
based on likelihood
I'm writing a package for PLSR and PCR. It is not ready for "release"
yet, but I could email you a copy if you want.
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
the file, and in Rd-mode in a documentation part. I guess
using two files and a shell script, as you do, might be the best
solution.
--
Bjørn-Helge Mevik
__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
I'm writing a couple of related functions, and I'd like to generate a
(single) .R file (containing the function definitions), and separate .Rd
files (documenting each function).
Would this be possible with Sweave/noewb? Has anyone tried something
along this idea?
--
Regards,
Bjørn-H
71 matches
Mail list logo