Displaying 20 results from an estimated 5000 matches similar to: "faraway tutorial: cryptic command to newbie"
2003 Feb 26
1
calculationg condition numbers
am I right in the assumption, that for calculation of the condition
numbers I have to use the correlation matrix of X, and not t(x) %*% x?
> e <- eigen(t(x) %*% x)
better (x must not have a first column of ones):
> e <- eigen(cor(x))
> e$val
[1] 6.6653e+07 2.0907e+05 1.0536e+05 1.8040e+04 2.4557e+01 2.0151e+00
> sqrt(e$val[1]/e$val)
[1] 1.000 17.855 25.153 60.785 1647.478
2005 Apr 21
2
apply vs sapply vs loop - lm() call appl(y)ied on array
Christoph --
There was just a thread on this earlier this week. You can search in the
archives for the title: "refitting lm() with same x, different y".
(Actually, it doesn't turn up in the R site search yet, at least for me.
But if you just go to the archive of recent messages, available through
CRAN, you can search on refitting and find it. The original post was from
William
2003 Sep 26
2
overlay two pixmap
Hi
I need to overlay two pixmaps (library (pixmap)). One, a pixmapGrey, is
the basis, and on this I need to overlay a pixmapIndexed, BUT: the
pixmapIndexed has set only some of its "pixels" to an indexed color,
many of its pixels should not cover the basis pixmapGrey pixel, means,
for this "in pixmapIndexed not defined pixels" it should be transparent.
What would you
2004 Mar 30
1
classification with nnet: handling unequal class sizes
I hope this question is adequate for this list
I use the nnet code from V&R p. 348: The very nice and general function
CVnn2() to choose the number of hidden units and the amount of weight
decay by an inner cross-validation- with a slight modification to use it
for classification (see below).
My data has 2 classes with unequal size: 45 observations for classI and
116 obs. for classII
With
2003 May 22
1
faraway package installation failed (PR#3076)
Full_Name: José Otero
Version: Version 1.5.0 (2002-04-29)
OS: Redhat 7.3
Submission from: (NULL) (192.187.16.164)
Hi:
Installation of package faraway
as root, from tarbal:
R CMD INSTALL ./faraway.tar.gz
ERROR: cannot extract package from './faraway.tar.gz'
idem, from zipped package:
R CMD INSTALL faraway.zip
gzip: faraway.zip has more than one entry--rest ignored
ERROR: cannot
2003 Feb 26
1
plot as .ps file: where are the axes and labels gone
Sorry, I am sure, this must be documented somewhere (but there are that
many docs and tutorials to scan for topics..., actually a great thing...
but if you are in a hurry..):
I want to save a plot as .ps (or .eps):
> postscript("plot1.eps", horizontal=FALSE,
onefile=FALSE,height=8,width=8,pointsize=10)
> plot(hpfit$fit,rstudent(hpfit),xlab="Fitted
2003 Feb 26
0
(no subject)
Let's assume that the columns of the model matrix, apart perhaps
from an initial column that corresponds to the overall mean, have
been centred. Then:
1) Normal equation methods give an accurate fit to the matrix
of centred sums of squares and products.
2) QR methods give an accurate fit to the predicted values.
QR will give better precision than normal equation methods
(e.g., Cholesky) if
2003 Jun 01
6
compositional data: percent values sum up to 1
again, under another subject:
sorry, maybe an all too trivial question. But we have power data from J
frequency spectra and to have the same range for the data of all our
subjects, we just transformed them into % values, pseudo-code:
power[i,j]=power[i,j]/sum(power[i,1:J])
of course, now we have a perfect linear relationship in our x design-matrix,
since all power-values for each subject sum up
2002 Oct 25
2
source output differs from console output
Dear R-help,
I would like to be able to run the following code sequence as a source
routine.
If I paste it into R via the clipboard it works as expected, but if I source
the code instead then the last 3 statements fail.
I've also tried writing to the file in place of the sink sequence, but that
also hits a snag. R 1.6, w98e2, dfr is a data frame containing the content
of Julian
2004 Sep 23
0
nnet and weights: error analysis using V&R example
Dear R-users, dear Prof. Ripley as package maintainer
I tried to investigate the odd error, when I call nnet together with a
'weights' parameter, using the 'fgl' example in V&R p 348
The error I get is:
Error in eval(expr, envir, enclos) : Object "w" not found
I think it is a kind of scoping problem, but I really cannot see, what
the problem exactly is.
and
2003 Jun 09
1
understanding eigen(): getting non-normalized eigenvectors
Hi, dear R pros
I try to understand eigen(). I have seen, that eigen() gives the
eigenvectors normalized to unit length.
What shall I do to get the eigenvectors not normalized to unit length?
E.g. take the example:
A
[,1] [,2]
V1 0.7714286 -0.2571429
V2 -0.4224490 0.1408163
Calculating eigen(A) "by hand" gives the eigenvectors (example from
Backhaus,
2004 Sep 23
0
nnet with weights parameter: odd error
Dear R-users
I use nnet for a classification (2 classes) problem. I use the code
CVnn1, CVnn2 as described in V&R.
The thing I changed to the code is: I define the (class) weight for each
observation in each cv 'bag' and give the vector of weights as parameter
of nnet(..weights = weight.vector...)
Unfortunately I get an error during some (but not all!) inner-fold cv runs:
2000 Apr 28
3
Matrix inverse
I haven't found a function that directly calculates the matrix inverse, does it exist? Otherwise what would be the fastest way to do it?
Patrik Waldmann
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the
2009 Jun 17
3
Matrix inversion-different answers from LAPACK and LINPACK
Hello.
I am trying to invert a matrix, and I am finding that I can get different
answers depending on whether I set LAPACK true or false using "qr". I had
understood that LAPACK is, in general more robust and faster than LINPACK,
so I am confused as to why I am getting what seems to be invalid answers.
The matrix is ostensibly the Hessian for a function I am optimizing. I want
to get
2004 Oct 28
1
: a package problem
Dear R- users and Helpers:
I downloaded the package from www.stat.lsa.umich.edu/~faraway/book and
installed it from local zip file.
It looked fine. But when I input
library(faraway)
it showed " Error in library(faraway) : 'faraway' is not a valid package
--- installed < 2.0.0?
What I used is R 2.0.0 version now.
What should I do?
Thank you very much.
Xin
2003 Jun 03
3
lda: how to get the eigenvalues
Dear R-users
How can I get the eigenvalues out of an lda analysis?
thanks a lot
christoph
--
Christoph Lehmann <christoph.lehmann at gmx.ch>
2016 Apr 20
6
Solving sparse, singular systems of equations
I have a situation in R where I would like to find any x (if one exists) that solves the linear system of equations Ax = b, where A is square, sparse, and singular, and b is a vector. Here is some code that mimics my issue with a relatively simple A and b, along with three other methods of solving this system that I found online, two of which give me an error and one of which succeeds on the
2011 Nov 08
3
GAM
Hi R community!
I am analyzing the data set "motorins" in the package "faraway" by using
the generalized additive model. it shows the following error. Can some one
suggest me the right way?
library(faraway)
data(motorins)
motori <- motorins[motorins$Zone==1,]
library(mgcv)
>amgam <- gam(log(Payment) ~ offset(log(Insured))+
s(as.numeric(Kilometres)) + s(Bonus) + Make +
2010 May 13
1
What's data() for?
Hi there,
>library(faraway)
>pima
pregnant glucose diastolic triceps insulin bmi diabetes age test
1 6 148 72 35 0 33.6 0.627 50 1
2 1 85 66 29 0 26.6 0.351 31 0
>data(pima)
>pima
pregnant glucose diastolic triceps insulin bmi diabetes age test
1 6 148 72 35 0 33.6
2004 Feb 23
2
orthonormalization with weights
Hello List,
I would like to orthonormalize vectors contained in a matrix X taking into
account row weights (matrix diagonal D). ie, I want to obtain Z=XA with
t(Z)%*%D%*%Z=diag(1)
I can do the Gram-Schmidt orthogonalization with subsequent weighted
regressions. I know that in the case of uniform weights, qr can do the
trick. I wonder if there is a way to do it in the case of non uniform