Thank you all! I solved my problem with your help.
Best wishes,
Wei-Wei
__
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 commen
Hi,
Fitting all possible models (GLM) with 10 predictors will result in loads of
(2^10 - 1) models. I want to do that in order to get the importance of
variables (having an unbalanced variable design) by summing the up the
AIC-weights of models including the same variable, for every variable
se
> 'm performing RDA on plant presence/absence data, constrained by
> geographical locations. I'd like to constrain the RDA by the "extended
> matrix of geographical coordinates" -ie the matrix of geographical
> coordinates completed by adding all terms of a cubic trend surface
> regression- .
>
?system.
Cheers,
Andrew
On Tue, Feb 27, 2007 at 02:05:09PM +0800, Guo Wei-Wei wrote:
> Dear All:
>
> Maybe it is a too basic question, but I don't how to find the answer.
> Sorry for that.
>
> What I want to do is call a shell command, which will provide two
> numbers, and assign those numbers
if (!"name" %in% names(attributes(dat))) {
...
}
/Henrik
On 2/26/07, Michael Toews <[EMAIL PROTECTED]> wrote:
> In R 2.5.0 (r40806), one of the change is to allow partial matching of
> "name" in the attr function. However, how can I tell if I have an exact
> match or not?
>
> For example, check
Hi
as I do not know what class is labelled and not knowing about your
data I just try to give you some hints.
What says str(adata) and str(bdata) about structure of your data?
It can be possible that in second case the structure of resulting
table can be formed into matrix and apply probably d
Guo Wei-Wei wrote:
> Dear All:
>
> Maybe it is a too basic question, but I don't how to find the answer.
> Sorry for that.
>
> What I want to do is call a shell command, which will provide two
> numbers, and assign those numbers to a vector. For example:
>
> The following command:
>
> $mxresult.sh
Dear All:
Maybe it is a too basic question, but I don't how to find the answer.
Sorry for that.
What I want to do is call a shell command, which will provide two
numbers, and assign those numbers to a vector. For example:
The following command:
$mxresult.sh ABC.mx
mxresult.sh is a script writt
Another way is to use an indexed list, which is far more tidier than
your method. If you mean "about 100" as in an irregular number, then a
list is your friend (i.e., a ragged array, that can have sometimes 97
samples, sometime 105 samples, etc.). Similar to your example:
dat <- runif(10,0,
In R 2.5.0 (r40806), one of the change is to allow partial matching of
"name" in the attr function. However, how can I tell if I have an exact
match or not?
For example, checking to see if an object has a "name" attribute, then
giving it one if it doesn't:
dat <- data.frame(x=1:10,y=rnorm(10))
Rusers:
I am trying to apply a quadratic discriminant function to find the best
classification outcomes.
1 is assigned to the values greater than a threshold value; and 0 otherwise.
I would like to see how the apparent error rates and the optimal error
rate change with increasing threshold value
You do not say -- and I am unable to divine -- whether you wish to sample
with or without replacement: each time or as a whole.
In general, when you want to do this sort of thing, the fastest way to do it
is just to sample everything you need at once and then form it into a list
or matrix or whate
You can use par("usr") to get the min/max coords of the plot and then
use that. For example, this will plot a red dot in the middle of the
plot area regardless of the coordinates:
plot(1:10) # sample plot
usr <- par("usr")
points(mean(usr[1:2]), mean(usr[3:4]), pch = 20, col = "red") # red dot
Hi everyone,
Suppose I have a count the occurrences of positive results, and the total
number of occurrences:
pos <- 14
total <- 15
testing that the proportion of positive occurrences is greater than 0.5 gives
a p-value and confidence interval:
prop.test( pos, total, p=0.5, alternative='grea
Helene,
You will have to give us more information, such as your system/versions
and a small reproducible example. We try to stress that questions are
more easily answered when there are a lot of specific details given and
a reproducible case can be tested.
Here are two comments though:
1. The q
Dear all,
I'm performing RDA on plant presence/absence data, constrained by
geographical locations. I'd like to constrain the RDA by the "extended
matrix of geographical coordinates" -ie the matrix of geographical
coordinates completed by adding all terms of a cubic trend surface
regression- .
Greetings:
I am looking for some help (probably really basic) with looping. What I want
to do is repeatedly sample observations (about 100 per sample) from a large
dataset (100,000 observations). I would like the samples labelled sample.1,
sample.2, and so on (or some other suitably simple namin
Thanks to Charles, Gabor, and a private message from Frank E Harrell with some
good ideas and help. This crossprod approach was very clever, I would never
have thought of it.
Best, Michael
- Original Message
From: Charles C. Berry <[EMAIL PROTECTED]>
To: Michael Wexler <[EMAIL PROTE
Hi
Jonathan Lees wrote:
> Is it possible to add lines or other
> user defined graphics
> to a plot in R that does not depend on
> the user scale for the plot?
>
> For example I have a plot
> plot(x,y)
> and I want to add some graphic that is
> scaled in inches or cm but I do not want the
> graph
try this:
> values <- c("Kiwis", "Bananas", "Ananas", "Cherries", "Peer")
> vector <- c("Oranges", "Bananas", "Apples", "Cherries", "Lemons")
> vector <- sort(vector)
> vector
[1] "Apples" "Bananas" "Cherries" "Lemons" "Oranges"
> x <- sapply(values, function(x)ifelse(x<=vector, -1, 1))
> x
Dear R users,
I was wondering if R has a built-in function doing the following :
my_match(values_vector,lookup_vector)
{
for each value of values_vector :
if value %in% lookup_vector, then value is unchanged
else, value is changed the the closest element of lookup_vector, "closest"
meaning "the
Hello. I'm new to R and I'm trying to solve a classification problem. I have
a training dataset of about 40,000 rows and 50 columns. When I try to train
support vector machine, it gives me this error after a few seconds:
Error in predict.svm(ret, xhold) : Model is empty!
This is the code I use:
The underscore versus left-arrow
conundrum has its roots in the evolution
of ASCII during the middle of the last
century.
Some Teletype machines in the 1970s (when the
S language was being developed) still had a
left arrow, and its ASCII code was used in S
as a one keystroke convenience for the
Thanks everyone. I should have thought of dnorm as a straing return from the
normal density formula.
Hailu
On 2/27/07, Charilaos Skiadas <[EMAIL PROTECTED]> wrote:
>
> On Feb 26, 2007, at 3:03 PM, A Hailu wrote:
> > Hi All,
> > Why would calls to dnorm and dmvnorm return values that are above
> >
Thanks, I wasn't thinking real clearly when I pressed 'send'. All
figured out now. -A
-Original Message-
From: Wensui Liu [mailto:[EMAIL PROTECTED]
Sent: Monday, February 26, 2007 10:15 AM
To: Andy Bunn
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Partial whitening of time series?
andy,
Yes, you are right. Thanks.
On 2/27/07, Benilton Carvalho <[EMAIL PROTECTED]> wrote:
>
> well, nobody said that the density must be smaller than 1, right? :-)
>
> it's just the value of the normal density function at the point you
> asked. you may try doing that by hand and, with the correct math,
Haris Skiadas replied
>> Thanks for correcting me. Actually, my windows
>> R documentation says "mostattributes()", but it
>> makes no difference -- none of the three show
>> up as function names or R objects.
> That's because there is no "mostattributes" function,
> it only works as an assignme
I guarantee that it would also happen on all future versions of R.
Why would you expect density to be smaller than 1? The only constraints on
density are that (a) it is non-negative and (b) it integrates to one. The
smaller the variance, the greater the density is around its center. Density
can
On Feb 26, 2007, at 3:03 PM, A Hailu wrote:
> Hi All,
> Why would calls to dnorm and dmvnorm return values that are above
> 1? For
> example,
>> dnorm(0.3,mean=0, sd=0.1)
> [1] 3.989423
Because dnorm gives you the density function, whose integral is the
distribution function, which is like
On 2/26/07, Thaden, John J <[EMAIL PROTECTED]> wrote:
> I had written
>
> >> ...someattributes() does not seem to exist.
>
> And Haris Skiadas replied
>
> > My help shows it as "moreattributes", not
> > "someattributes". (MacOSX), though doesn't
> > sound like it should be platform-specific).
>
> T
On Feb 26, 2007, at 3:00 PM, Thaden, John J wrote:
> Thanks for correcting me. Actually, my windows
> R documentation says "mostattributes()", but it
> makes no difference -- none of the three show
> up as function names or R objects.
That's because there is no "mostattributes" function, it only
well, nobody said that the density must be smaller than 1, right? :-)
it's just the value of the normal density function at the point you
asked. you may try doing that by hand and, with the correct math,
you'll get the same thing.
b
On Feb 26, 2007, at 3:03 PM, A Hailu wrote:
> Hi All,
> Wh
Hi Everyone,
I am doing hierarchical clustering analysis and have a
question regarding "cutree".
I am doing things like this:
hc <- hclust(dist(X))
a <- cutree(hc, k=2)
Basically "a" is a vector containing the assignments
of 1 or 2 for each sample. May I know how "cutree"
decides to assign 1
Hi All,
Why would calls to dnorm and dmvnorm return values that are above 1? For
example,
> dnorm(0.3,mean=0, sd=0.1)
[1] 3.989423
This is happening on two different installations of R that I have.
Thank you.
Hailu
[[alternative HTML version deleted]]
__
I had written
>> ...someattributes() does not seem to exist.
And Haris Skiadas replied
> My help shows it as "moreattributes", not
> "someattributes". (MacOSX), though doesn't
> sound like it should be platform-specific).
Thanks for correcting me. Actually, my windows
R documentation says "m
I have two more or less parallel dataframes that are
giving me different results on one subset of
variables. I know that I assembled the 2 dataframes
slightly differently but I don't see why I am getting
this result because one set of variables are labelled
and the other is not. Variable names are
Peter Dalgaard wrote:
>
>>> Is it possible to get unordered eigenvalues and eigenvectors of a
>>> symmetric matrix in R?
>>
>> Yes, see help("eigen").
>
> Er, where do you see anything about (un)order? As far as I know,
> there's no "natural" ordering of eigenvalues and eigenvalue
> algorit
If I understand the question correctly, I would do this:
for (i in 1:54) assign( paste('input',i,sep='') , matrix(
dataset$variable, nrow=1) )
You now have 54 matrices, named input1, input2, ... input54, each
having 1 row and as many columns as dataset$variable is long.
(also, they're i
Alberto Monteiro wrote:
> Kaustubh Patil wrote:
>
>> Is it possible to get unordered eigenvalues and eigenvectors of a
>> symmetric matrix in R?
> Yes, see help("eigen").
>
Er, where do you see anything about (un)order? As far as I know, there's
no "natural" ordering of eigenvalues and eig
Kaustubh Patil wrote:
>
> Is it possible to get unordered eigenvalues and eigenvectors of a
> symmetric matrix in R?
>
Yes, see help("eigen").
If you are strict about the unordered part, do a sample(set, size)
to randomize the eigenvalues.
Alberto Monteiro
___
Hi all,
Is it possible to get unordered eigenvalues and eigenvectors of a symmetric
matrix in R?
Any help appreciated.
Regards,
Kaustubh
-
[[alternative HTML version deleted]]
__
R-help@stat.math.et
andy,
if your model is Xt = 0.5 * Xt-1 + e, then it should have
Xt = 0.1 * Xt-1 + 0.4 * Xt-1 + e
(Xt - 0.1*Xt-1) = 0.4 * Xt-1 + e
so what you need to do is to substract part of lag from your series.
it is just my $0.02.
On 2/26/07, Andy Bunn <[EMAIL PROTECTED]> wrote:
> I have a time series with
Serguei Kaniovski wrote:
> Hi,
>
> I am trying to add duplicates of matrix "mat" by row. Commands
>
> subset(mat,duplicated(rownames(mat)))
>
> or
>
> mat[which(duplicated(rownames(mat))),]
>
> return only half of the required indices. How can I find the remaining
> ones, ie the matches, so th
I have a time series with a one year lag, ar=0.5. The series has some
interesting events that disappear when the series is whitened (i.e.,
fitting an AR process and looking at the residuals). I'd like to remove
the autocorrelation in stages to see the effect on the time series. Is
there a way to sp
Hello,
I use rpart to predict survival time and have a problem in interpreting the
output of “estimated rate”. Here is an example of what I do:
> stagec <-
> read.table("http://www.stanford.edu/class/stats202/DATA/stagec.data";,
> col.names=c("pgtime", "pgstat", "age","eet", "g2", "grade", "gle
Hi,
I am trying to add duplicates of matrix "mat" by row. Commands
subset(mat,duplicated(rownames(mat)))
or
mat[which(duplicated(rownames(mat))),]
return only half of the required indices. How can I find the remaining
ones, ie the matches, so that I can add them up?
Thanks,
Serguei
Hello everyone:
I want to draw a Par plot but I don't know how to choose different pattern
of of colors for different bars to be able to distinguish them in a black
and white print. I want some kinds of patterns on the bars such as '///' or
'\\\' or
Suppose I have the following data in the
Thanks to every one who contributed - there definitely isn't a
consensus, but perhaps a slight preference towards number 3
(camelCase). I'm not sure yet if this beats out my personal
preference for number 2.
Hadley
On 2/25/07, hadley wickham <[EMAIL PROTECTED]> wrote:
> What do you prefer/recomm
On Feb 26, 2007, at 10:35 AM, Thaden, John J wrote:
> I'd like to use someattributes(), as described
> in documentation for R version 2.4.1 (windows build)
>
>> help("attributes")
>
> however, someattributes() does not seem to exist.
>
>> someattributes()
> Error: could not find function "someatt
Dear R-list,
I have a data set from 20 pigs, each of which is tested at crossed 9 doses
(logdose -4:4) and 3 skin treatment substances when exposed to a standard
polluted environment. So there are 27 patches on each pig. The response is
irritation=yes/no.
I want to determine "equally effective 50
you can use something like the following:
a <- list("A","B","C","D")
b <- list("A","B","E","F")
c <- list("A","C","E","G")
#
abc <- list(a, b, c)
unq.abc <- unique(unlist(abc))
out.lis <- lapply(abc, "%in%", x = unq.abc)
out.lis
lapply(out.lis, as.numeric)
I hope it helps.
> a <- c("A","B","C","D")
> b <- c("A","B","E","F")
> c <- c("A","C","E","G")
> Df <- cbind(a, b, c)
> apply(Df, 2, function(x)(LETTERS[1:7] %in% x))
a b c
[1,] TRUE TRUE TRUE
[2,] TRUE TRUE FALSE
[3,] TRUE FALSE TRUE
[4,] TRUE FALSE FALSE
[5,] FALSE TRUE TRUE
[6,] FALSE
I'd like to use someattributes(), as described
in documentation for R version 2.4.1 (windows build)
>help("attributes")
however, someattributes() does not seem to exist.
> someattributes()
Error: could not find function "someattributes"
Is this true or am I doing something wrong?
-John
Con
Hello,
Imagine 3 lists like so:
> a <- list("A","B","C","D")
> b <- list("A","B","E","F")
> c <- list("A","C","E","G")
What I need (vennDiagram) is a matrix characterizing with 1 or 0 whether any
given member is present or not like so:
x1 x2 x3
[1,] 1 1 1
[2,] 1 1 0
[3,] 1 0 1
[4,]
Hi Tony,
This question concerns a Bioconductor package, so is best asked on the
BioC mailing list instead of R-help.
Best,
Jim
Brooks, Anthony B wrote:
> Hi everyone,
>
> I'm trying to generate an RNA degradation plot of the Estrogen example
> data plot, but seem to get an error. I've tried d
Is it possible to add lines or other
user defined graphics
to a plot in R that does not depend on
the user scale for the plot?
For example I have a plot
plot(x,y)
and I want to add some graphic that is
scaled in inches or cm but I do not want the
graphic to change when the x-y scales are
changed
Hi,
Thanks for the input. I have tried the test again just using the Observed
values and the read.table() function and get this:
data: y
X-squared = NaN, df = 5405, p-value = NA
Warning message:
Chi-squared approximation may be incorrect in: chisq.test(y)
So it doesn't seem to like it! I gu
In that case, you can just ignore the expected values and use the
observed values in the chisq.test. The reason you got a p value of 1
before is because the second argument was ignored, and so you did a
chi square test on the expected values alone.
If you have loaded the obseved values into a mat
Hello R-lists,
I have released the new version of Rdonlp2
(an extension package to solve nonlinear constrained optimization problem).
0.2-1 improves stability and usability, and runs little faster.
Windows, OSX binary, and source files are available from:
http://arumat.net/Rdonlp2/
Any feedback
Hi,
The files look like below and the rows and columns are numbers of genetic
types e.g. row1 is type 4; column1 is type A. So for, row1:column1 cell
there are 78 type 4/type A combinations. I hope this makes sense!
78 500 18 6 0 4 0 1 6
1
On 2/25/07, Julien Barnier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am starting a new job as a study analyst for a social science
> research unit. I would really like to use R as my main tool for data
> manipulation and analysis. So I'd like to ask you, if you had just one
> book on R to buy (or to k
It's a bit difficult to advise without knowing what the rows and
columns represent, but why not just calculate the statistic yourself,
given that you already have observed and expected values? For
example:
chi2 <- sum((y-x)^2/x)
On 26/02/07, Carina Brehony <[EMAIL PROTECTED]> wrote:
> Yes, I w
Yes, I would like to do a goodness-of-fit test.
-Original Message-
From: Petr Klasterecky [mailto:[EMAIL PROTECTED]
Sent: 26 February 2007 11:50
To: Carina Brehony
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Chi Square with two tab-delimited text files
Carina Brehony napsal(a):
> Hi,
>
Carina Brehony napsal(a):
> Hi,
> I want to do a chi square test and I have two tab delimited text files with
> Expected and Observed values to compare. Each file contains only the values
There are a lot of chi^2 tests, most of them compare O&E quantities and
it is not clear which one you want
Hello,
for the first task change the names if they are character into a factor
and have a look at ?by
For the merge you will need strsplit() on character vectors (so be
carefull to change the factor back to character) and merge()
Regards,
Winfried
-Original Message-
From: [EMAIL PROT
Hi everyone,
I'm trying to generate an RNA degradation plot of the Estrogen example
data plot, but seem to get an error. I've tried defining an ylim value,
ylim=c(0,30) , but it doesn't seem to work either.
My code is as follows:
> RNAdeg<-AffyRNAdeg(Data)
> png(DegLoc, width=720, height=
Hello,
a have two matrices of data as below. I would like to add-up the duplicate
in terms of pair of names in rows, and then merge the values in the second
matrix to the pairs as two new variables x3 and x4.
Input
,x1,x2
jane.mike,31,43
jane.steve,32,2
jane.steve,5,3
jim.mike,76,5
jane.steve,4
Dear Radka
I'm not sure I quite understand your design and quite where the nesting comes
in.
But a quick suggestion is why are you adding species as random as well as
fixed? I don't think you can do this or indeed should do it. I think this is
why you get problems with your fixed effects. If y
Den Fr, 2007-02-23, 19:21 skrev Ronaldo Reis Junior:
> Hi,
>
> I testing JGR and I like, but my ~ caracter dont work. My keyboard is
> Brazilian ABNT2.
>
> The key is OK, only in JGR it dont work.
>
> Anybody have any idea about this?
Yes, and it's known problem -- see e.g.
http://bugs.sun.com/bug
hadley wickham wrote:
> What do you prefer/recommend for double-banger function names:
>
> 1 scale.colour
> 2 scale_colour
> 3 scaleColour
>
> 1 is more R-like, but conflicts with S3. 2 is a modern version of
> number 1, but not many packages use it. Number 3 is more java-like.
> (I like num
Hi,
I want to do a chi square test and I have two tab delimited text files with
Expected and Observed values to compare. Each file contains only the values
and are 48 rows by 116 columns. I have managed to do something with them,
but I don't think it is right as I got a p value of 1. In this ca
On 26 Feb 2007 at 9:14, Sergey Goriatchev wrote:
Date sent: Mon, 26 Feb 2007 09:14:17 +0100
From: "Sergey Goriatchev" <[EMAIL PROTECTED]>
To: r-help@stat.math.ethz.ch
Subject:[R] Automated figure production
> Hello, everybody
>
Williams Scott napsal(a):
> Hi all,
>
> I want to create a simple plot with 2 type='s' lines on it:
>
> plot(a, b, type='s')
> lines(x, y, type='s')
>
> I wish to then fill the area between the curves with a colour to
> accentuate the differences eg col=gray(0.95). I cant seem to come up
> with
Williams Scott wrote:
> Hi all,
>
> I want to create a simple plot with 2 type='s' lines on it:
>
> plot(a, b, type='s')
> lines(x, y, type='s')
>
> I wish to then fill the area between the curves with a colour to
> accentuate the differences eg col=gray(0.95). I cant seem to come up
> with a simp
Hello, everybody
Two questions:
1) I am new to maillists, and particularly to r-help maillist. Where
specifically do I go online to see my question and answers to it??? If
I use the searchable archives, or archives by Robert King, I see my
question but not the answers, though I know that at least
75 matches
Mail list logo