Re: [R] Can't understand syntax

2012-07-14 Thread Rui Barradas
Hello, It's more simple than you believe it is. One thing at a time. First, in order to lighten the instructions, create index vectors. test2 <- test # save 'test' for later na.v1 <- is.na(test[["v1"]]) na.v2 <- is.na(test[["v2"]]) na.v3 <- is.na(test[["v3"]]) Now use them. test[[ "result

[R] NB1 with glm.nb?

2012-07-14 Thread sanchez ana
Dear Dr. Schwartz,   I would like to ask you if you know how to fit NB1 with glm.nb(...), because glm.nb() is actually fitting NB2.   Thanks so much   Ana > > De: Marc Schwartz >Para: sanchez ana >CC: "r-help@R-project.org" >Enviado: Viernes, 13 de julio, 20

[R] NaN in hurdle model please?

2012-07-14 Thread sanchez ana
Dear all, I am fitting  a hurdle model in the following way: HNB <- hurdle(chro ~ as.factor(TandemRepeat)| as.factor(TandemRepeat), data =data_negbin_fin, dist = "negbin") But the std. error for log(theta) = NA Count model coefficients (truncated negbin with log link):    

[R] Hurdle "NaN" for log(theta)

2012-07-14 Thread sanchez ana
Dear all,   I am fitting  a hurdle model in the following way: HNB <- hurdle(chro ~ as.factor(TandemRepeat)| as.factor(TandemRepeat), data =data_negbin_fin, dist = "negbin") But the std. error for log(theta) = NA Count model coefficients (truncated negbin with log link):  

Re: [R] Vuong test

2012-07-14 Thread sanchez ana
Dear Dr. Schwartz,   Thanks so much   Ana > > De: Marc Schwartz >Para: sanchez ana >CC: "r-help@R-project.org" >Enviado: Viernes, 13 de julio, 2012 7:36:26 >Asunto: Re: [R] Vuong test > > >On Jul 13, 2012, at 12:35 AM, sanchez ana wrote: > >> Dear All, >> >

Re: [R] significance test interquartile ranges

2012-07-14 Thread Rui Barradas
Hello, Em 14-07-2012 13:08, peter dalgaard escreveu: On Jul 14, 2012, at 12:25 , Rui Barradas wrote: Hello, There's a test for iqr equality, of Westenberg (1948), that can be found on-line if one really looks. It starts creating a 1 sample pool from the two samples and computing the 1st an

Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Jeff Newmiller
I/O is not greatly improved by vectorization, except that whole files being read or written as units is faster than looping over rows. --- Jeff NewmillerThe . . Go Live... DCN:

Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Jeff Newmiller
you should lapply over a vector of indices (e.g. seq_along(names)) and extract out the subsets of data in your mywrite function before you write them. Is this homework? --- Jeff NewmillerThe .

Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
Thx Jeff. I could use a loop no doubt but I thought that will reduce the speed and I was thinking there could be a vectorisation idea. I will try your way. Cheers. On Sat, Jul 14, 2012 at 3:51 PM, Jeff Newmiller wrote: > You have to wrap the write calls in some kind of loop. For your example, > y

Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Jeff Newmiller
You have to wrap the write calls in some kind of loop. For your example, you could use a for loop. If you have multiple rows of one name you might look into the dlply function from the plyr package and use lapply to do the actual write calls.

Re: [R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
In the same context I tried the following but with no results. mywrite=function(a,b){ write.csv(a,paste(b,".csv") } lapply(age,mywrite(age,names)) which produced: Error in cat(list(...), file, sep, fill, labels, append) : argument 1 (type 'list') cannot be handled by 'cat' Thanks once again. R

[R] writing data into files whose names are in a vector

2012-07-14 Thread Raghuraman Ramachandran
GuRus How do I use the write function (or write.table or write.csv) to achieve the following please? age=c(32,37,39) names=c("john","peter","jake") I would like create in a directory 3 files each named as john.csv,peter.csv and jake.csv and each file have data from the age vector. That is jon.cs

Re: [R] changing the x axis labels in a time series plot

2012-07-14 Thread Hasan Diwan
Alternatively: require(xts) z.xts <- xts(cbind(1:100, 100:1), order.by=strptime(1322:1421, '%Y') plot(z.xts) -- H > Em 14-07-2012 10:54, Jim Bouldin escreveu: > > OK, this has to be simple but I've searched through help files, mailing >> list archives and well, everything I could think of, and st

Re: [R] significance test interquartile ranges

2012-07-14 Thread peter dalgaard
On Jul 14, 2012, at 12:25 , Rui Barradas wrote: > Hello, > > There's a test for iqr equality, of Westenberg (1948), that can be found > on-line if one really looks. It starts creating a 1 sample pool from the two > samples and computing the 1st and 3rd quartiles. Then a three column table > w

Re: [R] changing the x axis labels in a time series plot

2012-07-14 Thread Rui Barradas
Hello, Actually, axis() was doing its job, but you have xlim=1:100 and cannot expect to see points at x=1322:1421. The correct way would be to say that your time series starts at 1322 and that it records observations with a frequency of 1. Then plot it. Just look. I've nclude an axis(9 call t

Re: [R] significance test interquartile ranges

2012-07-14 Thread Rui Barradas
Hello, There's a test for iqr equality, of Westenberg (1948), that can be found on-line if one really looks. It starts creating a 1 sample pool from the two samples and computing the 1st and 3rd quartiles. Then a three column table where the rows correspond to the samples is built. The middle

[R] changing the x axis labels in a time series plot

2012-07-14 Thread Jim Bouldin
OK, this has to be simple but I've searched through help files, mailing list archives and well, everything I could think of, and still no luck. I simply want to change the x axis labels in a time series graph, from its default numbering (which starts at 1 and increments by 1), to values I have in

Re: [R] significance test interquartile ranges

2012-07-14 Thread peter dalgaard
On Jul 14, 2012, at 08:16 , Prof Brian Ripley wrote: > On 13/07/2012 21:37, Greg Snow wrote: >> A permutation test may be appropriate: > > Yes, it may, but precisely which one is unclear. You are testing whether the > two samples have an identical distribution, whereas I took the question to b

Re: [R] How to find frequent sequences.

2012-07-14 Thread Petr Savicky
On Fri, Jul 13, 2012 at 02:38:57PM -0500, Vineet Shukla wrote: > Hi Petr, >Yes, that's really very helpful. > > > Petr : Using this interpretation, AB occurs at lines 1,3,4 and not 1,3,5. > Is this correct? > Vineet : Yes , thats right sorry for the typo. > > > > Petr: If some sequence con