Re: [R] Lme does not work without a random effect (UNCLASSIFIED)

2008-03-15 Thread Simon Blomberg
There's a trick with this: you need to make sure you are using anova.lme rather than anova.lm. So if in this example you do anova(fit0, fit) you will get an error. Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat. Lecturer and Consultant Statistician Faculty of Biological and Chemical

Re: [R] How to create following chart for visualizing multivariate time series

2008-03-15 Thread Megh Dal
Let me take an artifical matrix : dat = matrix(rnorm(200*200), 200, 200) My goal is to visualize this matrix according to the procedure, described in previous mails. I took Mendelssohn's advice and got following advice : ?plot.im Z - setcov(owin()) plot(Z)

[R] again with polr

2008-03-15 Thread Luca Braglia
hello everybody solved the problem with summary, now I have another one eg I estimate try.op - polr( as.ordered(sod.sit.ec.fam) ~ log(y) + log(1 + nfiglimin) + log(1 + nfiglimagg) + log(ncomp - nfiglitot) +

Re: [R] How to get the value of last element in a vector/array ?

2008-03-15 Thread Chuck Cleland
On 3/15/2008 1:30 AM, Ng Stanley wrote: Hi, a[length(a)] gives the value of last element. Is there an alternative without using functions ? I'm not sure what you mean by without using functions, but how about this: tail(a, 1) ?tail [[alternative HTML version deleted]]

[R] Appending new values to an existing factor vector

2008-03-15 Thread David Hall (coding)
Hello, I've recently come across a situation where I'm trying to read in [genotype data] files that have around 80,000,000 lines, 4 fields, with a high proportion of repeated strings, here's a sample: rsXXX SAMPLE0001 CG 0.05302 rsXXSAMPLE0001 CC 0.06817

Re: [R] legend: bold and color of border

2008-03-15 Thread Jim Lemon
Thomas Steiner wrote: How do I write bold face in the legend - the function does not accept font=2 as argument? How do I plot a legend box with a background color, but not a border? Or, better: How do I specify the color of the legend-box-borderline? Okay, I abuse the legend, but have a

Re: [R] filehash

2008-03-15 Thread Prof Brian Ripley
I suspect you have a file permission problem, and noticed filehash has some bugs which would mask this. E.g. it does createDB1 - function(dbName) { if(!hasWorkingFtell()) stop(need working 'ftell()' to use 'DB1' format) if(!file.exists(dbName)) file.create(dbName)

[R] Réponse en cas d'absence

2008-03-15 Thread berthoulyanne
I am away until te 18th of April. However, I will have a look to my email from time to time. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] changing the quote

2008-03-15 Thread Christophe Genolini
Hi the list, I am using R2.6.2. I don't now why, the quote used in the output of 'new' seams not compatible with Sweave. Is there a way to change them ? Is it something link with R, or link with my computer configuration ? setClass(E,list(e=factor)) [1] E new(E) An object of class “E”

Re: [R] Optimization with constraint.

2008-03-15 Thread Paul Smith
On Fri, Mar 14, 2008 at 6:42 PM, Hans W Borchers [EMAIL PROTECTED] wrote: I have some problems, when I try to model an optimization problem with some constraints. The original problem cannot be solved analytically, so I have to use routines like Simulated Annealing or Sequential

Re: [R] changing the quote

2008-03-15 Thread Duncan Murdoch
On 15/03/2008 7:29 AM, Christophe Genolini wrote: Hi the list, I am using R2.6.2. I don't now why, the quote used in the output of 'new' seams not compatible with Sweave. Is there a way to change them ? Is it something link with R, or link with my computer configuration ?

Re: [R] feeding merge.zoo a vector containing the names of zoo objects?

2008-03-15 Thread Gabor Grothendieck
Try using do.call: library(tseries) adjClose0 - sapply(LETTERS[1:3], get.hist.quote, quote = AdjClose, simplify = FALSE) adjClose - do.call(merge, c(adjClose0, retclass = data.frame)) On Sat, Mar 15, 2008 at 9:37 AM, rich.p.martin [EMAIL PROTECTED] wrote: Hi, the snippet of code below

Re: [R] How to create following chart for visualizing multivariate time series

2008-03-15 Thread David Winsemius
Megh Dal [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Let me take an artifical matrix : dat = matrix(rnorm(200*200), 200, 200) My goal is to visualize this matrix according to the procedure, described in previous mails. I took Mendelssohn's advice and got following

Re: [R] is this a bug? [was Re: again with polr]

2008-03-15 Thread Luca Braglia
On 15/03/08 - 15:21, Luca Braglia wrote: Hello everybody as I said, i'm not a ordered probit guru, but what happened seems to me a little strange. Here I put my dataset http://bragliozzo.altervista.org/asd.dta my fault: i forgot the new antileech system on altervista

[R] empty array

2008-03-15 Thread Christophe Genolini
Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. I do not understand why we have length(numeric()), length(factor()) and length(character()) to zero, and length(array()) to

Re: [R] empty array

2008-03-15 Thread Gabor Csardi
On Sat, Mar 15, 2008 at 04:33:32PM +0100, Christophe Genolini wrote: Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. Sure: matrix(nrow=0, ncol=5) [,1] [,2] [,3]

Re: [R] empty array

2008-03-15 Thread Prof Brian Ripley
On Sat, 15 Mar 2008, Gabor Csardi wrote: On Sat, Mar 15, 2008 at 04:33:32PM +0100, Christophe Genolini wrote: Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. Sure:

[R] Please find the error in my code

2008-03-15 Thread kasturi bardhan
hello everybody I use the following code for my programming it runs with the error as specified below.Any help that would disolve the error will be highly appreciated. Thanks in advance my code looks like this R programme for simulating the power of the two sample t test vs various

Re: [R] problems creating data frames

2008-03-15 Thread John Kane
Another approach might be to start with a list, pad the vectors and then convert to a data.frame. Here is something that Henrique Dallazuanna and Phil Spector suggested to me a couple of days ago as a way of solving something of a similar problem. It seems to have the advantage that it will

Re: [R] empty array

2008-03-15 Thread John Kane
Will mymatrix - NULL do what you want? --- Christophe Genolini [EMAIL PROTECTED] wrote: Hi the list Is it possible to create an empty matrix ? I do not mean an matrix with a single value that is NA (which is not empty) but a real empty one, with length=0. I do not understand why we

Re: [R] Please find the error in my code

2008-03-15 Thread Uwe Ligges
kasturi bardhan wrote: hello everybody I use the following code for my programming it runs with the error as specified below.Any help that would disolve the error will be highly appreciated. Thanks in advance my code looks like this R programme for simulating the power of the two

Re: [R] Please find the error in my code

2008-03-15 Thread ArthurLi2001
## Corrected code: sim.size - 200 sample.size - 10 set.seed(231) mu1 - 0 delta - seq(-2,2, length=50) pow.ttest- numeric(50) pow.kstest- numeric(50) pow.wtest- numeric(50) for (j in 1:length(delta)) { mu2 - mu1 + delta[j] pt.test - numeric(sim.size) pw.test - numeric(sim.size)

Re: [R] empty array

2008-03-15 Thread Christophe Genolini
John Kane a écrit : Will mymatrix - NULL do what you want? Well, in your code, 'mymatrix' is not a matrix : a-array(dim=c(0,0)) # Solution of Gabor Csardi 0 x 0 matrix class(a) [1] matrix b-NULL class(b) [1] NULL Your definition will probably works in most case, but in S4, the uses of

Re: [R] legend: bold and color of border

2008-03-15 Thread Thomas Steiner
Hi Jim, thank you very much for your answers! How do I write bold face in the legend - the function does not accept font=2 as argument? par(font=2) perfect, thanks. How do I plot a legend box with a background color, but not a border? Or, better: How do I specify the color of

[R] Solving equations with optim

2008-03-15 Thread francogrex
Hello, optim searches for min (or max) of a function, but is it possible to solve for a specific value? I mean, I want to find the value of a and b that give the function value closest to ZERO (and not min or max) in the below. is it possible? thanks test=function(x){ a=x[1] b=x[2] if

[R] Fwd: Re: How to create following chart for visualizing multivariate time series

2008-03-15 Thread Megh Dal
Thanks David, It is working. Holtman's also gave me a solution but, I wanted to have a color pallet for description of colors, that was not in his solution. However I need one small modification. If I want to plot only lower diagonal elements of 'dat' then how should I proceed? What I want is,

[R] Conditionals for Errors or error flags

2008-03-15 Thread Jon Loehrke
Greetings, I have been working on a script that conducts repeated statistics and plots to my data. In this case it is sub-setting the dataframe by month. The intent is to develop a custom analysis and plotting that I can run on a large number of data sets. Unfortunately, a small portion

Re: [R] Solving equations with optim

2008-03-15 Thread ianfiske
If you want to find the value of x such that f(x) = 0, then you can minimize f^2 or abs(f) using optim. Hope this helps, Ian francogrex wrote: Hello, optim searches for min (or max) of a function, but is it possible to solve for a specific value? I mean, I want to find the value of a and

[R] Anova

2008-03-15 Thread daniel jupiter
Hi all, I apologize for what might be a silly question. I am interested in doing a one way anova. This is not too hard in and of itself, either with anova, aov or oneway.test . However, I need to 1) get pvalues, 2) do a posthoc analysis with Tukey HSD, 3) and have (sometimes) an unbalanced

Re: [R] Conditionals for Errors or error flags

2008-03-15 Thread Ramon Diaz-Uriarte
Dear Jon, You probably want to take a look at try and tryCatch. Either of them will let you do what you want. Best, R. On Sat, Mar 15, 2008 at 7:00 PM, Jon Loehrke [EMAIL PROTECTED] wrote: Greetings, I have been working on a script that conducts repeated statistics and plots to my data.

Re: [R] Fwd: Re: How to create following chart for visualizing multivariate time series

2008-03-15 Thread David Winsemius
Megh Dal [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Thanks David, It is working. Holtman's also gave me a solution but, I wanted to have a color pallet for description of colors, that was not in his solution. His second posting did:

[R] length of S4

2008-03-15 Thread Christophe Genolini
Hi the list, With basic type, length gives the length of the vector Wtih list, length gives the number of item With S4 object, length gives...one. Even with an objet with empty slot. setClass(E,representation(e=numeric)) [1] E length(new(E)) [1] 1 setClass(E,representation(e=matrix)) [1] E

Re: [R] length of S4

2008-03-15 Thread Martin Morgan
I replied off list, accidentally, below. Christophe then asked Probably you want to write a method for 'length' with signature x = 'E'. Well you're right. Consider the following code : setClass(A,representation(nb=numeric,li=list)) setMethod( show, A, function(object){

Re: [R] Solving equations with optim

2008-03-15 Thread Bill.Venables
There is one obvious way: test - function(x, value = 0) { a - x[1] b - x[2] ex - if (all(x 0)) (((a/(a+b))*(beta(a,b)/(beta(a,b)-beta(a,b+6-0.35259) else Inf (ex - value)^2 } opt - optim(c(1,2),test) opt[c(par, value)] $par [1] 0.5141272 2.4810257

[R] How to loop through all the columns in dataframe

2008-03-15 Thread Felipe Carrillo
Hi: Can anyone advice me on how to loop and perform a calculation through all the columns. here's my data xd- c(2.2024,2.4216,1.4672,1.4817,1.4957,1.4431,1.5676) pd- c(0.017046,0.018504,0.012157,0.012253,0.012348,0.011997,0.012825) td- c(160524,163565,143973,111956,89677,95269,81558)

[R] locating minimum value in matrix

2008-03-15 Thread Gonçalo Ferraz
Hi, I have a matrix BEE and want to find the row and column numbers of the minimum value in that matrix. The command which(BEE==min(BEE)) returns only one value which, I take, is the position of the minimum in a vector with as many elements as the matrix. Is there a quick and simple way of

Re: [R] How to loop through all the columns in dataframe

2008-03-15 Thread jim holtman
Is this what you were looking for: xd- + c(2.2024,2.4216,1.4672,1.4817,1.4957,1.4431,1.5676) pd- + c(0.017046,0.018504,0.012157,0.012253,0.012348,0.011997,0.012825) td- c(160524,163565,143973,111956,89677,95269,81558) mydf-data.frame(xd,pd,td) trans-t(mydf) trans [,1]

Re: [R] locating minimum value in matrix

2008-03-15 Thread Bill.Venables
Yes, they've thought of that. which(BEE == min(BEE), arr.ind = TRUE) will do it. Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819

Re: [R] locating minimum value in matrix

2008-03-15 Thread Chuck Cleland
On 3/15/2008 7:47 PM, Gonçalo Ferraz wrote: Hi, I have a matrix BEE and want to find the row and column numbers of the minimum value in that matrix. The command which(BEE==min(BEE)) returns only one value which, I take, is the position of the minimum in a vector with as many

[R] R code for the MLE of a geometric distribution

2008-03-15 Thread Kathy Maher
Does anyone know how to approach R code for the MLE of a geom. distribution? thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] R code for the MLE of a geometric distribution

2008-03-15 Thread Bill.Venables
This is an imprecise question. There are actually two geometric distributions. See http://en.wikipedia.org/wiki/Geometric_distribution They are related, of course. One is defined as the minimum number of trials to achive one success in bernoulli trials. The other is the number of failures