Please read `An Introduction to R': R does not have `strings' or
`namelists' whereas it does have `lists' but d$num is not one.
To communicate, you need a common language with your readers. You are not
speaking R, and your `examples' are not R output.
I suspect d$num is a numeric vector and
Hubert Feyrer wrote:
On Fri, 15 Apr 2005, Sundar Dorai-Raj wrote:
You snipped too much:
...
This is where it says ade4, etc. is not found. If you would like to
install these packages, it's rather easy:
install.packages(c(ade4, RColorBrewer, pixmap))
Ah, thanks! i'll try to see how I can add the
Dear Andy,
That's clearly much better -- and illustrates an effective strategy for
vectorizing (or matricizing) a computation. I think I'll add this to my
list of programming examples. It might be a little dangerous to pass ...
through to cor(), since someone could specify type=spearman, for
Thanks, it's interesting reading.
I also noticed that
sw[, 1, drop = TRUE] is a vector (coerces to the lowest dimension)
but
sw[1, , drop = TRUE] is a one-row data frame (does not convert it into
a list or vector)
FS
On 4/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
You should look
Dear Mark,
-Original Message-
From: Marc Schwartz [mailto:[EMAIL PROTECTED]
Sent: Friday, April 15, 2005 9:41 PM
To: John Fox
Cc: 'R-Help'; 'Dren Scott'
Subject: RE: [R] Pearson corelation and p-value for matrix
John,
Interesting test. Thanks for pointing that out.
You are
I defined map as follows:
map - function(x, y, fun) {
mymat - matrix( c(x,y), c(length(x), 2) )
tmat - t(mymat)
oldmat - tmat
result - apply(tmat, 2, function(x) {fun(x[1], x[2])})
}
It seems to work (see below). Of course you can turn it into a one-liner.
Because a data frame can hold different data types (even matrices) in
different variables, one row of it can not be converted to a vector in
general (where all elements need to be of the same type).
Andy
From: Fernando Saldanha
Thanks, it's interesting reading.
I also noticed that
From: John Fox
Dear Andy,
That's clearly much better -- and illustrates an effective
strategy for
vectorizing (or matricizing) a computation. I think I'll
add this to my
list of programming examples. It might be a little dangerous
to pass ...
through to cor(), since someone could
Michael Kubovy wrote:
Kindly send a cc to me when replying to the list.
I'm having trouble using lmer beyond a first step.
My data:
some(exp1B)
sub ba amplitude a b c d
2 1 1.00 1.5 65 63 4 8
414 1.15 0.0 92 41 3 4
434 1.15 3.0 88 48 2 2
63
Dear ts-friends,
I have an almost seasonal signal. It's human respiration pressure, where
the respiration signal is regular but non-sinusoidal, with a slightly
drifting period. Overlaid on the signal are non-periodic twitches (think
weak hickups) with amplitudes 2-5 times higher than the
ronggui wrote:
i have try hard to find the answer by google,but i can not find any solution.
so i wan to ask:
1,can we test the if canonical relationship is significant after using cancor?
One reference is T. W. Anderson: An Introduction to Multivariate
Statistical Analysis, second edition,
Peter Dalgaard wrote:
Ales Ziberna [EMAIL PROTECTED] writes:
I am also very interested how this could be done, possibly in such a
way that this would be incorporated in the function itself and there
wouldn't be a need to write environment(f) - NULL before calling a
function, as is proposed in the
Any comments on the following strategy:
(1) Take the log-odds of the frequencies of b and a (adding 1/6, as
Tukey recommended) and run lme.
(2) If the estimates from lme are in line with the estimates I got from
lmer, then use the results from lme.
On Apr 16, 2005, at 9:16 AM, Douglas Bates
Version 1.6 of the g.data package is available on CRAN.
The g.data package is used to create and maintain delayed-data
packages (DDP's). Data stored in a DDP are available on demand, but do
not take up memory until requested. You attach a DDP with
g.data.attach(), then read from it and assign to
We are pleased to announce the release of version 0.0 of bayesm on CRAN.
bayesm covers many important models used in marketing
and micro-econometrics applications.
The package includes:
Bayes Regression (univariate or multivariate dep var)
Multinomial Logit
Multinomial and Multivariate Probit
From: Fernando Saldanha
I defined map as follows:
map - function(x, y, fun) {
mymat - matrix( c(x,y), c(length(x), 2) )
tmat - t(mymat)
oldmat - tmat
result - apply(tmat, 2, function(x) {fun(x[1], x[2])})
}
It seems to work (see below). Of course you can turn
Thanks a lot for the input!
I forgot to add family=binomial, for a binomial glm. Now the AIC's are
positive!
I was planning to use AIC (from the binomial glm) and c-index (lrm) to
compare and rank different uni-variate (one continue explanatory variable)
logistic models to evaluate the
Compare them by `goodness for purpose': you have not told us the purpose.
Please do read some of the extensive literature on model comparison.
On Sat, 16 Apr 2005, Jan Verbesselt wrote:
Thanks a lot for the input!
I forgot to add family=binomial, for a binomial glm. Now the AIC's are
positive!
I
Perhaps Fernando will also note that is documented in ?[.data.frame,
a slightly more appropriate reference than Bill's.
It would be a good idea to read a good account of R's indexing: Bill
Venables and I know of a couple you will find in the R FAQ.
On Sat, 16 Apr 2005, Liaw, Andy wrote:
Because
Dear list members,
I've just uploaded version 1.0-0 of the Rcmdr package to CRAN. For people
who haven't seen the package before, the R Commander provides a
basic-statistics graphical user interface to R, based on the tcltk package.
The new version incorporates a number of improvements to the R
On Sat, 16 Apr 2005, Prof Brian Ripley wrote:
Perhaps Fernando will also note that is documented in ?[.data.frame,
a slightly more appropriate reference than Bill's.
It would be a good idea to read a good account of R's indexing: Bill Venables
and I know of a couple you will find in the R FAQ.
Tolga Uzuner wrote:
Hi there,
Is there an implementation of the Gaveh Stehfest algorithm in R
somewhere ? Or some other inversion ?
Thanks,
Tolga
Well, at least here is Zakian's algorithm, for anyone who needs it:
Zakian-function(Fs,t){
# Fs is the function to be inverted and evaluated at t
a
Tolga Uzuner wrote:
Tolga Uzuner wrote:
Hi there,
Is there an implementation of the Gaveh Stehfest algorithm in R
somewhere ? Or some other inversion ?
Thanks,
Tolga
Well, at least here is Zakian's algorithm, for anyone who needs it:
Zakian-function(Fs,t){
# Fs is the function to be inverted and
Dear members,
The code I am writing heavily use element-wise multiplication of
matrix and vectors, e.g.
X, is nxm matrix
e, is nx1 matrix
Doing Z=X*e[,], I obtain a nxm matrix, Z, where each column of X is
multiplied (element-wise) by e. Is this the best way to achieve the
result I want? By
On 4/16/05, GiusVa [EMAIL PROTECTED] wrote:
Dear members,
The code I am writing heavily use element-wise multiplication of
matrix and vectors, e.g.
X, is nxm matrix
e, is nx1 matrix
Doing Z=X*e[,], I obtain a nxm matrix, Z, where each column of X is
multiplied (element-wise) by e. Is
I am reading as fast as I can! Just started with R five days ago.
I found the following in the documentation:
Although the default for 'drop' is 'TRUE', the default behaviour when
only one _row_ is left is equivalent to specifying 'drop = FALSE'. To
drop from a data frame to a list, 'drop =
Hey, all: Do we have a convenient command(s) to extract the variance
components from a fitted model by lm (actually it's a nexted model)?
e.g.: using the following codes we could get MSA,MSB(A) and MSE. How
to get the variance component estimates by command in R rather than
calculations by hand?
Spencer Graves wrote:
Does the following answer the question:
cor(B, use=complete.obs)
** snip **
cor(B, use=pairwise.complete.obs)
Yep. That's exactly the issue. I had thought the reference to
casewise deletion in the help for complete.obs was referring solely to
the two variables
On Sun, 2005-04-17 at 02:38 +0800, wenqing li wrote:
Hey, all: Do we have a convenient command(s) to extract the variance
components from a fitted model by lm (actually it's a nexted model)?
e.g.: using the following codes we could get MSA,MSB(A) and MSE. How
to get the variance component
Spencer Graves wrote:
Does the following answer the question:
cor(B, use=complete.obs)
** snip **
cor(B, use=pairwise.complete.obs)
Yep. That's exactly the issue. I had thought the reference to
casewise deletion in the help for complete.obs was referring solely to
the two variables
Ted:
Thank you for your help. All I want is a binomial random variable that is
correlated with a normal random variable with specified correlation. By
linear I mean the ordinary Pearson correlation. I tried the following two
methods, in each case the resulting correlation is substantially less
Sorry, I didn't get the question clear. What I meant is to create a
character vector with length 200:
one, two, three, ..., two hundred
On 4/15/05, Federico Calboli [EMAIL PROTECTED] wrote:
On Fri, 2005-04-15 at 14:30 -0400, Frank Duan wrote:
Hi R people,
I met a naive prolem. Could anyone
I may be wrong, but I am unaware of anyone that has created a number to
text function in R.
If you search Google:
http://www.google.com/search?q=numbers+into+words
There are various program examples, from VB to JavaScript to PHP, etc.
It shouldn't be too hard to convert one of them to R. Most
I was wondering if someone could help me!
Here is what I don't understand!
Why the text in the function isn't showing up before the locator action?
###
plot(1:10)
toto-function(){
cat(Why this text isn't showing up before the point selection )
point-locator(2)
return(point)
}
Hello,
I am interested in fitting a segmented model with unknown joint points
in nls and perhaps eventually in nlme. I can fit this model in sas (see
below, joint points to be estimated are a41 and a41), but am unsure how
to specify this in the nlm function. I would really appreciate any
Dear Frank,
This was an interesting exercise. Here's a solution:
numbers2words - function(x){
helper - function(x){
digits - rev(strsplit(as.character(x), )[[1]])
nDigits - length(digits)
if (nDigits == 1) as.vector(ones[digits])
else if (nDigits == 2)
This is how I'd write the formula for use with nls/nlme:
y ~ b41*(x - 1) + b42*(x^2 - 1) +
ifelse((a41 - x) = 0, b43*(a41 - x)^2, 0) +
ifelse((a42 - x) = 0, b44*(a42 - x)^2, 0)
This is a direct translation from your funny foreign-looking code below
that probably makes it clear what's going
Thank you very much Dr. Venables, I'll give this a try.
Regards-
andy
On Sun, 2005-04-17 at 13:36 +1000, [EMAIL PROTECTED] wrote:
This is how I'd write the formula for use with nls/nlme:
y ~ b41*(x - 1) + b42*(x^2 - 1) +
ifelse((a41 - x) = 0, b43*(a41 - x)^2, 0) +
ifelse((a42 - x) = 0,
38 matches
Mail list logo