[R] Difficult survival model

2007-08-16 Thread Daniel Malter
Hi all, I would appreciate your advice how to model the survival model for the following data, especially if it can be modeled in one model or if I should (have to) break it up (i.e. assume that some events are independent of each other, etc.). Data is on an experimental stock market simulation.

[R] residual plots for lmer in lme4 package

2007-08-16 Thread Margaret Gardiner-Garden
Hi, I was wondering if I might be able to ask some advice about doing residual plots for the lmer function in the lme4 package. Our group's aim is to find if the expression staining of a particular gene in a sample (or core) is related to the pathology of the core. To do this, we used

Re: [R] binomial simulation

2007-08-16 Thread Prof Brian Ripley
On Wed, 15 Aug 2007, Moshe Olshansky wrote: Thank you - I wasn't aware of this function. One can even use lchoose which allows really huge arguments (more than 2^1000)! Using dbinom() for binomial probabilities would be even better, and that has a log=TRUE argument to return results on

Re: [R] Possible to import histograms in R?

2007-08-16 Thread Nick Chorley
On 15/08/07, Ted Harding [EMAIL PROTECTED] wrote: So you if you want the density plot, you would need to calculate this for yourself. E.g. H1$density - counts/sum(counts) plot.histogram(H1,freq=FALSE) Oddly, plot.histogram doesn't work in my version of R (which is 2.5.1), even though R can

[R] function to find coodinates in an array

2007-08-16 Thread Ana Conesa
Dear list, I am looking for a function/way to get the array coordinates of given elements in an array. What I mean is the following: - Let X be a 3D array - I find the ordering of the elements of X by ord - order(X) (this returns me a vector) - I now want to find the x,y,z coordinates of each

[R] summarising systemfit with saveMemory

2007-08-16 Thread Tim Calkins
Hi all - I'm on R 2.5.1 for XP. in the systemfit package, the summary is set to print the McElroy's measure of fit unless it's NULL. When the option saveMemory = TRUE, the McElroy isn't included, instead it defaults to NA. Thus I am unable to use summary.systemfit. library(systemfit)

[R] an easy way to construct this special matirx

2007-08-16 Thread shaowenhua
Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an easy way to construct the following matrix: r 1 0 00 r^2 r 1 00 r^3 r^2 r 10 r^4 r^3 r^2 r1 where r could be any number. Thanks. Wen [[alternative

[R] time series with quality codes

2007-08-16 Thread Felix Andrews
list(...), I am working with environmental time series (eg rainfall, stream flow) that have attached quality codes for each data point. The quality codes have just a few factor levels, like good, suspect, poor, imputed. I use the quality codes in plots and summaries. They are carried through when

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread Ted Harding
On 16-Aug-07 03:10:17, [EMAIL PROTECTED] wrote: Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an easy way to construct the following matrix: r 1000 r^2 r100 r^3 r^2 r10 r^4 r^3 r^2 r1 where r

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread Prof Brian Ripley
?toeplitz ?lower.tri since it is the lower triangle of a Toeplitz matrix (or drop the top row) r - 0.95 R - toeplitz(r^(0:4)) R[upper.tri(R)] - 0 R[-1,] On Thu, 16 Aug 2007, [EMAIL PROTECTED] wrote: Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an

Re: [R] time series with quality codes

2007-08-16 Thread Achim Zeileis
On Thu, 16 Aug 2007, Felix Andrews wrote: list(...), I am working with environmental time series (eg rainfall, stream flow) that have attached quality codes for each data point. The quality codes have just a few factor levels, like good, suspect, poor, imputed. I use the quality codes in plots

[R] (coxph, se) Obtaining standard errors of coefficients from coxph to store

2007-08-16 Thread David Lloyd
Hi all, I'm wanting to be able to find and store the z-score of coxph below: - modz=coxph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method=breslow) I know summary(modz) will give me this, but how do i extract the standard error or z-score values in a similar way

[R] to combine bwplot + srt option?

2007-08-16 Thread KOITA Lassana - STAC/ACE
Hi R-users, Could someone help me to combine bwplot and srt option (exemple srt = 45 degree or srt 90 degree)? My graphic contains 146 boxplots, I would like to label all of them. As you know, labels are not readable. Thank you for your help in advance! Lassana KOITA Chargé d'Etudes de

Re: [R] time series periodic data

2007-08-16 Thread Petr PIKAL
Thank you. I will try to get the book, althoug I am not sure if I with my tiny knowledge of mathematics will be able to digest it. Meanwhile I tried to make 7 min average and then to reanalyze by spectrum, but the output was not very convincing. Regards Petr Pikal [EMAIL PROTECTED] Rolf

Re: [R] to combine bwplot + srt option?

2007-08-16 Thread Dieter Menne
KOITA Lassana - STAC/ACE lassana.koita at aviation-civile.gouv.fr writes: Could someone help me to combine bwplot and srt option (exemple srt = 45 degree or srt 90 degree)? My graphic contains 146 boxplots, I would like to label all of them. As you know, labels are not readable. You

Re: [R] lmer coefficient distributions and p values

2007-08-16 Thread Dieter Menne
Daniel Lakeland dlakelan at street-artists.org writes: We have used the lmer package to fit various models for the various experiments that she has done (random effects from multiple measurements for each animal or each trial, and fixed effects from developmental stage, and genotype etc).

Re: [R] Polynomial fitting

2007-08-16 Thread Jon Minton
Remember that polynomials of the form y = b1*x + b2*x^2 + ... + bm*x^m fit the linear regression equation form Y = beta_1*x_1 + beta_2*x_2 + ... + beta_m*x_m If one sets (from the 1st to the 2nd equation) x - x_1 x^2 - x_2 x^3 - x_3 etc. In R this is easy, just use the identity operator

Re: [R] to combine bwplot + srt option?

2007-08-16 Thread KOITA Lassana - STAC/ACE
Thank you for you quite and useful explanation. And do know how to sort them by median? best regargs Lassana KOITA Chargé d'Etudes de Sécurité Aéroportuaire et d'Analyse Statistique / Project Engineer Airport Safety Studies Statistical analysis Service Technique de l'Aviation Civile (STAC)

[R] ADF test

2007-08-16 Thread Megh Dal
Hi all, Hope you people do not feel irritated for repeatedly sending mail on Time series. Here I got another problem on the same, and hope I would get some answer from you. I have following dataset: data[,1] [1] 4.96 4.95 4.96 4.96 4.97 4.97 4.97 4.97 4.97 4.98 4.98

[R] combine 2 data frames with missing values

2007-08-16 Thread nalluri pratap
Hi All, I have 2 data frames as follows: abc 1 NA 1 2 NA 2 NA 3 3 So a, b are the input values and c is the output which I am interested in. NA - Missing values. I used rbind, but its not working. Let me know if anyone can help me Thanks,

[R] Combine matrix

2007-08-16 Thread Gianni Burgin
Hi R user, I am new to R, and I have a very simple question for you. I have two matrix A and B, with internally redundant rownames (but variables are different). Some, but not all the rownames are shared among the two matrix. I want to create a greater matrix that combines the previuos two, and

Re: [R] ungültige Versionsspezifikation

2007-08-16 Thread Mag. Ferri Leberl
Thank you. Hereby I send you the return to sessionInfo(). I have meanwhile updated to 2.5.1. R ist ein Gemeinschaftsprojekt mit vielen Beitragenden. Tippen Sie 'contributors()' für mehr Information und 'citation()', um zu erfahren, wie R oder R packages in Publikationen zitiert werden können.

[R] Odp: combine 2 data frames with missing values

2007-08-16 Thread Petr PIKAL
Hi for this particular task rowSums(cbind(a,b), na.rm=T) gives you c column Petr [EMAIL PROTECTED] [EMAIL PROTECTED] napsal dne 16.08.2007 13:03:51: Hi All, I have 2 data frames as follows: abc 1 NA 1 2 NA 2 NA 3 3 So a, b are the input values and c

Re: [R] combine 2 data frames with missing values

2007-08-16 Thread Stefan Grosse
I have 2 data frames as follows: abc 1 NA 1 2 NA 2 NA 3 3 So a, b are the input values and c is the output which I am interested in. NA - Missing values. I used rbind, but its not working. Let me know if anyone can help me What

[R] Regression tree: labels in the terminal nodes

2007-08-16 Thread Juergen Kuehn
Dear everybody, I'm a new user of R 2.4.1 and I'm searching for information on improving the output of regression tree graphs. In the terminal nodes I am up to now able to indicate the number of values (n) and the mean of all values in this terminal node by the command text(tree, use.n=T,

[R] use AnnBuilderSourceUrls with local path insted of ftp adress

2007-08-16 Thread Daniela Albrecht
Hallo everybody. I want to build my own GO package using the function GOPkgBuilder of AnnBuilder. It uses AnnBuilderSourceUrls to collect data from different ftp sites. These data are not complete for my organism, so I would like to change the ftp adresses to a local one. The changing itself

Re: [R] ADF test

2007-08-16 Thread gyadav
Hi Megh i hope you have confused with 'what is my NULL hypothesis' ? i suggest you to take any ideal dataset about which you know that whether it is stationary or not ? apply the test to know what is the NULL hypothesis used in any software :) usually in many softwares the NULL hypothesis is

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread Gabor Grothendieck
Here are two solutions. In the first lo has TRUE on the lower diagonal and diagonal. Then we compute the exponents, multiplying by lo to zero out the upper triangle. In the second rn is a matrix of row numbers and rn = t(rn) is the same as lo in the first solution. r - 2; n - 5 # test data lo

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread De-Jian,ZHAO
Hi wen, I don't think it is easy to construct this matrix in a simple way. I tried and found a way to do it. Try the following codes: i-1:4 j-5 aa-matrix(0,4,5) for (j in 1:5){aa[i,j]-(i+1-j)} r-4 #r could be any number bb-r^aa bb[aa0]=0 bb The matrix bb is what you want. Furthermore,I packaged

Re: [R] Polynomial fitting

2007-08-16 Thread Prof Brian Ripley
It is easier to use poly(raw=TRUE), and better to use poly() with orthogonal polynomials. The original poster shows signs of having read neither the help for predict.lm nor the posting guide, and so almost certainly misused the predict method. On Thu, 16 Aug 2007, Jon Minton wrote:

Re: [R] time series with quality codes

2007-08-16 Thread Gabor Grothendieck
In addition, we could create a function to.df which converts a zoo object to a data frame assuming that any column that only contains 1:nlevels is a factor with the indicated level names. Use to.df just before plotting: library(zoo) set.seed(1) f - zoo(factor(sample(3, 10, replace = TRUE))) x -

[R] CCC statistic in cluster analysis

2007-08-16 Thread silvia
Has anyone implemented CCC statistic (Sarle, 1983) in R? If so I would greatly appreciate the relevant script file. Any help will be much appreciated Best regards, Silvia Mg. Silvia Graciela Valdano Departamento de Ciencias Naturales Facultad de Cs. Exactas, Físico-Químicas y Naturales

[R] several plots on several pages

2007-08-16 Thread Rainer M. Krug
Hi version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 5.1 year 2007 month 06 day27 svn rev42083 language R version.string R

Re: [R] several plots on several pages

2007-08-16 Thread ONKELINX, Thierry
Dear Rainer, Have you considered using Sweave? HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg /

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread De-Jian,ZHAO
Hi Gabor, I am glad to see your answer,which gives a hope to resove this question in an easy way. I replied to this question in a more complex way before seeing your answer. However,I think your code needs some revision, because the original matrix is not a diagonal matrix. It has 4 rows and 5

Re: [R] Combine matrix

2007-08-16 Thread Gianni Burgin
let say something like this a=matrix(1:25, nrow=5) rownames(a)=letters[1:5] colnames(a)=rep(A, 5) a A A A A A a 1 6 11 16 21 b 2 7 12 17 22 c 3 8 13 18 23 d 4 9 14 19 24 e 5 10 15 20 25 b=matrix(1:40, nrow=8) rownames(b)=c(rep(a,4),rep(b,4)) colnames(b)=rep(B, 5) b B B B

[R] Question about sm.options sm.survival

2007-08-16 Thread Rachel Jia
Hi, there: It's my first time to post question in this forum, so thanks for your tolerance if my question is too naive. I am using a nonparametric smoothing procedure in sm package to generate smoothed survival curves for continuous covariate. I want to truncate the suvival curve and only

Re: [R] several plots on several pages

2007-08-16 Thread Rainer M. Krug
Hi Thierry ONKELINX, Thierry wrote: Dear Rainer, Have you considered using Sweave? No - and I am sure it will do what I want, but I guess it might be an overkill. These arew just draft outputs for myself for different datasets which should be easy to compare. SO I guess that Sweave might

Re: [R] Regression tree: labels in the terminal nodes

2007-08-16 Thread Achim Zeileis
On Thu, 16 Aug 2007, Juergen Kuehn wrote: Dear everybody, I'm a new user of R 2.4.1 and I'm searching for information on improving the output of regression tree graphs. In the terminal nodes I am up to now able to indicate the number of values (n) and the mean of all values in this terminal

[R] multiple colors within same line of text

2007-08-16 Thread Andrew Yee
Hi, I'm interested in using mtext(), but with the option of having multiple colors in the same line of text. For example, creating a line of text where: Red is red and blue is blue How do you create a text argument that lets you do this within mtext()? Thanks, Andrew MGH Cancer Center

Re: [R] an easy way to construct this special matirx

2007-08-16 Thread Gabor Grothendieck
It was pointed out that the required matrix may not be square and the superdiagonal was missing in my prior post. Here is a revision: r - 2; nr - 4; nc - 5 # test data x - matrix(nr = nr, nc = nc) x - row(x) - col(x) + 1 (x = 0) * r ^ x On 8/16/07, Gabor Grothendieck [EMAIL PROTECTED] wrote:

Re: [R] Combine matrix

2007-08-16 Thread François Pinard
[Gianni Burgin] let say something like this a=matrix(1:25, nrow=5) rownames(a)=letters[1:5] colnames(a)=rep(A, 5) a A A A A A a 1 6 11 16 21 b 2 7 12 17 22 c 3 8 13 18 23 d 4 9 14 19 24 e 5 10 15 20 25 b=matrix(1:40, nrow=8) rownames(b)=c(rep(a,4),rep(b,4)) colnames(b)=rep(B, 5)

Re: [R] residual plots for lmer in lme4 package

2007-08-16 Thread Martin Henry H. Stevens
Hi Margaret, Have a look at qqmath in the lattice package. ?qqmath Hank On Aug 16, 2007, at 2:45 AM, Margaret Gardiner-Garden wrote: Hi, I was wondering if I might be able to ask some advice about doing residual plots for the lmer function in the lme4 package. Our group's aim is to

Re: [R] to combine bwplot + srt option?

2007-08-16 Thread Deepayan Sarkar
On 8/16/07, KOITA Lassana - STAC/ACE [EMAIL PROTECTED] wrote: Thank you for you quite and useful explanation. And do know how to sort them by median? See ?reorder.factor Note that traditional practice with bwplot() is to have the categorical variable on the y-axis, in which case the default

Re: [R] Error message when using zero-inflated count regression model in package zicounts

2007-08-16 Thread James R. Milks
Dr. Stevens, I've double-checked my variable lengths. All of my variables (Total.vines, Site, Species, and DBH) came in at 549. I did correct one problem in the data entry that had escaped my previous notice: somehow the undergrad who entered all the data managed to make the Acer

[R] Newbie

2007-08-16 Thread Alan Harrison
Hello, I'm a bit new to the world of R so forgive my ignorance. I'm trying to do a zero-inflated negative binomial regression and have received an error message and i'm not sure what it means. I'm running R 2.5.1 on XP. I have just tried a really simple version of the model to see if it

[R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Lauri Nikkinen
Hi folks, I would like to trim the trailing spaces in my factor variables using lapply (described in this post by Marc Schwartz: http://tolstoy.newcastle.edu.au/R/e2/help/07/08/22826.html) but the code is not functioning (in this example there is only one factor with trailing spaces): y1 -

[R] Linear models and a simple time series

2007-08-16 Thread [EMAIL PROTECTED]
Working on modeling a wild animal population. Two data vectors: the herd count from year to year (estimated by a sampling procedure), and the number of animals killed by hunters. Task is to find the natural growth rate of the herd (A simplification, but preserves the essentials.) My question

Re: [R] Newbie

2007-08-16 Thread Stefan Grosse
I'm a bit new to the world of R so forgive my ignorance. That has nothing to do with the knowledge of R but with the model. Age has only 2 different values: 0 and 1 and if it is 0 there is no scars, so what exactly have you expected from the model? I would say if you just want to prove that

Re: [R] Newbie

2007-08-16 Thread Stefan Grosse
I would say if you just want to prove that older deer have more scars try the Mann Whitney non parametric test... Forgive me but even that does not really make sense since the values are all 0 so it is to obvious... __ R-help@stat.math.ethz.ch

Re: [R] Possible memory leak with R v.2.5.0

2007-08-16 Thread Martin Morgan
Hi Peter -- Here's my guess. Ironically, adding things to broken code reduces the signal to noise ratio. I ended up with get.vars.for.cluster = function( cluster, genes=get.global(gene.ids ), ratios=get.global(ratios)) { cluster - cluster rows - cluster$rows cols -

Re: [R] Error message when using zero-inflated count regression model in package zicounts

2007-08-16 Thread Achim Zeileis
On Thu, 16 Aug 2007, James R. Milks wrote: Dr. Stevens, I've double-checked my variable lengths. All of my variables (Total.vines, Site, Species, and DBH) came in at 549. I did correct one problem in the data entry that had escaped my previous notice: somehow the undergrad who entered all

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Lauri Nikkinen
Thanks Marc! What would be the easiest way to coerce char-variables back to factor-variables? Is there a way to prevent the coercion in d[] - lapply(d, function(x) if (is.factor(x)) sub( +$, , x) else x) ? -Lauri 2007/8/16, Marc Schwartz [EMAIL PROTECTED]: On Thu, 2007-08-16 at 17:54 +0300,

[R] Possible memory leak with large matrices in R v.2.5.0

2007-08-16 Thread Peter Waltman
I'm working with a very large matrix ( 22k rows x 2k cols) of RNA expression data with R v.2.5.0 on a RedHat Enterprise machine, x86_64 architecture. The relevant code is below, but I call a function that takes a cluster of this data ( a list structure that contains a $rows elt which lists

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Marc Schwartz
On Thu, 2007-08-16 at 17:54 +0300, Lauri Nikkinen wrote: Hi folks, I would like to trim the trailing spaces in my factor variables using lapply (described in this post by Marc Schwartz: http://tolstoy.newcastle.edu.au/R/e2/help/07/08/22826.html) but the code is not functioning (in this

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Marc Schwartz
The easiest way might be to modify the lapply() call as follows: d[] - lapply(d, function(x) if (is.factor(x)) factor(sub( +$, , x)) else x) str(d) 'data.frame': 60 obs. of 3 variables: $ x: Factor w/ 5 levels 1,2,3,4,..: 1 1 1 1 1 1 1 1 1 1 ... $ y: num 7.01 8.33 5.48 6.51 5.61 ... $ f:

[R] Urgent Help needed

2007-08-16 Thread AbouEl-Makarim Aboueissa
Dear All: Urgent help is needed. I have a data set in matrix format of three columns: X, Y and index of four groups (1,2,3,4). What I need to do is the following; 1- How I can subtract the sample mean of each group indexed 1,2,3,4 from the corresponding data values of this group and

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Prof Brian Ripley
On Thu, 16 Aug 2007, Marc Schwartz wrote: The easiest way might be to modify the lapply() call as follows: d[] - lapply(d, function(x) if (is.factor(x)) factor(sub( +$, , x)) else x) str(d) 'data.frame': 60 obs. of 3 variables: $ x: Factor w/ 5 levels 1,2,3,4,..: 1 1 1 1 1 1 1 1 1 1

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Marc Schwartz
On Thu, 2007-08-16 at 17:52 +0100, Prof Brian Ripley wrote: On Thu, 16 Aug 2007, Marc Schwartz wrote: The easiest way might be to modify the lapply() call as follows: d[] - lapply(d, function(x) if (is.factor(x)) factor(sub( +$, , x)) else x) str(d) 'data.frame': 60 obs. of 3

Re: [R] several plots on several pages

2007-08-16 Thread Greg Snow
You can set up the 3 plots per page by using: par(mfrow=c(3,1)) Then there are a couple of options for skipping the top graphics position if the graph fails. If you know that the graph failed then you can just use plot.new() (or frame()) to skip the top plot and plot the next one in the 2nd

Re: [R] several plots on several pages

2007-08-16 Thread Greg Snow
Oops, I read further down in your original post and see that you already knew about par(mfg=c(2,1)). To get it to advance to page 2 for the 4th plot try calling plot.new() which should move you to the next page, then doing par(mfg=c(1,1)) should cause the next graph to be at the top. Hope this

Re: [R] Trim trailng space from data.frame factor variables

2007-08-16 Thread Phil Spector
If the problem is with the levels of the factor, why not change them directly? d = data.frame(a=1:5, + b=c('one ','two','three ','three ','two')) d$b [1] onetwothree three two Levels: one three two levels(d$b) = sub(' +$','',levels(d$b)) d$b [1] one two three three two

Re: [R] AIC and logLik for logistic regression in R and S-PLUS

2007-08-16 Thread Ben Bolker
Leandra Desousa sousa at ims.uaf.edu writes: I am using 'R' version 2.2.1 and 'S-PLUS' version 6.0; and I loaded the MASS library in 'S-PLUS'. I am running a logistic regression using glm: summary(mydata.glm) Call: glm(formula = COMU ~ MeanPycUpT + MeanPycUpS, family = binomial,data =

Re: [R] Urgent Help needed

2007-08-16 Thread Weiwei Shi
try this: t0 = read.table(datatest.txt, header=T) X.mean = ave(t0[,1], as.factor(t0[,3])) you do the rest of Y.mean and make them into a data.fame or whatever. HTH, Weiwei On 8/16/07, AbouEl-Makarim Aboueissa [EMAIL PROTECTED] wrote: Dear All: Urgent help is needed. I have a data set in

Re: [R] use AnnBuilderSourceUrls with local path insted of ftp adress

2007-08-16 Thread John Zhang
I want to build my own GO package using the function GOPkgBuilder of AnnBuilder. It uses AnnBuilderSourceUrls to collect data from different ftp sites. These data are not complete for my organism, so I would like to change the ftp adresses to a local one. The changing itself is working but

Re: [R] Urgent Help needed

2007-08-16 Thread Henrique Dallazuanna
For the 2nd item, perhaps: by(df[,1:2], df$index, FUN=cor) where df is your data.frame. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 16/08/07, AbouEl-Makarim Aboueissa [EMAIL PROTECTED] wrote: Dear All: Urgent help is needed. I have a data set in matrix

Re: [R] Urgent Help needed

2007-08-16 Thread Marc Schwartz
On Thu, 2007-08-16 at 12:33 -0400, AbouEl-Makarim Aboueissa wrote: Dear All: Urgent help is needed. I have a data set in matrix format of three columns: X, Y and index of four groups (1,2,3,4). What I need to do is the following; 1- How I can subtract the sample mean of each group

Re: [R] Possible memory leak with R v.2.5.0

2007-08-16 Thread Peter Waltman
Hi Martin - Thanks for the feedback. Right after I sent the email to the list last night, I realized that I'd forgotten to clear the all the vars we attach() to the environment before rm()'ing everything. Whoops. However, I found that while doing this *does* reduce the memory stamp by

Re: [R] Urgent Help needed

2007-08-16 Thread AbouEl-Makarim Aboueissa
Thanks all. it works. Just one more thing: if you look to this out put, by(data1[,2:3], data1[,4], cor)[1] $`1` XY X 1.0000.4400451 Y 0.4400451 1.000 Q. How I can just pick the value of the correlation 0.4400451 from this output

[R] Help with optimization using GENOUD

2007-08-16 Thread Anup Nandialath
Dear Friends, I have been trying to learn how to use the derivative free optimization algorithms implemented in the package RGENOUD by Mebane and Sekhon. However, it does not seem to work for reasons best described as my total ignorance. If anybody has experience using this package, it would

Re: [R] Urgent Help needed

2007-08-16 Thread Henrique Dallazuanna
Hi, try this: by(df[,1:2], df$index, FUN=function(x)cor(x[1],x[2])) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 16/08/07, AbouEl-Makarim Aboueissa [EMAIL PROTECTED] wrote: Thanks all. it works. Just one more thing: if you look to this out put,

[R] Linear models over large datasets

2007-08-16 Thread Alp ATICI
I'd like to fit linear models on very large datasets. My data frames are about 200 rows x 200 columns of doubles and I am using an 64 bit build of R. I've googled about this extensively and went over the R Data Import/Export guide. My primary issue is although my data represented in ascii form

[R] combining P values using Fisher's method

2007-08-16 Thread Jiong Zhang, PhD
Hi All, Can somebody tell me how to use R to combine p values using Fisher's method? thanks. Jiong The email message (and any attachments) is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is

[R] (no subject)

2007-08-16 Thread mara serrano
hi, i'm new to R and i'm trying to port a quattro pro spreadsheet into R. spreadsheets have optional lower and upper limit parameters on the beta distribution function. i would like to know how to incorporate this with R's pbeta function. thanks in advance, mara.

Re: [R] Error message when using zero-inflated count regression model in package zicounts

2007-08-16 Thread James Milks
No, zeroinfl() in pscl did not give me any errors when I ran the model. So there may be a bug in zicounts. Only problem now is how to interpret the zeroinfl model. Am I correct in my understanding that zeroinfl runs both the poisson and binomial models without interactions? I'm

Re: [R] Linear models over large datasets

2007-08-16 Thread Greg Snow
Here are a couple of options that you could look at: The biglm package also has the bigglm function which you only call once (no update), you just need to give it a function that reads the data in chunks for you. Using bigglm with a gaussian family is equivalent to lm. You could also write your

Re: [R] Linear models over large datasets

2007-08-16 Thread Daniel Lakeland
On Thu, Aug 16, 2007 at 03:24:08PM -0500, Alp ATICI wrote: I'd like to fit linear models on very large datasets. My data frames are about 200 rows x 200 columns of doubles and I am using an 64 bit build of R. I've googled about this extensively and went over the R Data Import/Export guide.

Re: [R] combining P values using Fisher's method

2007-08-16 Thread Jonathan Baron
On 08/16/07 12:50, Jiong Zhang, PhD wrote: Hi All, Can somebody tell me how to use R to combine p values using Fisher's method? thanks. This might get you started. It is for the sole purpose of combining two two-tailed p-values for effects in the same direction. Thus, it is not very

Re: [R] ADF test

2007-08-16 Thread John C Frain
The option alternative in adf.test() takes the value 'stationary' or 'explosive'. The value 'explosive' is used to test if the series is stationary about a linear time trend. This means that a constant and trend are to be included in the DF or ADF test regression. In the case here the series is

Re: [R] Linear models over large datasets

2007-08-16 Thread Gabor Grothendieck
Its actually only a few lines of code to do this from first principles. The coefficients depend only on the cross products X'X and X'y and you can build them up easily by extending this example to read files or a database holding x and y instead of getting them from the args. Here we process incr

[R] Question on output of vectors from a for loop into a matrix

2007-08-16 Thread Ryan Briscoe Runquist
Hello R-help, I am a recent convert to R from SAS and I am having some difficulty with output of a for loop into a matrix. I have searched the help manuals and the archives, but I can't get my code to work. It is probably a syntax error that I am not spotting. I am trying to make a distance

[R] sample size computation for survival data

2007-08-16 Thread Stacey Burrows
Does a package exist to help compute sample size for censored data? I am planning a study involving interval censored data. I know that there exists functions in stata for this, so I was wondering if R has similar facilities. So far I have not been able to find anything for R. Thanks for any

Re: [R] Question on output of vectors from a for loop into a matrix

2007-08-16 Thread Dylan Beaudette
On Thursday 16 August 2007 15:35, Ryan Briscoe Runquist wrote: Hello R-help, I am a recent convert to R from SAS and I am having some difficulty with output of a for loop into a matrix. I have searched the help manuals and the archives, but I can't get my code to work. It is probably a

Re: [R] Combine matrix

2007-08-16 Thread Moshe Olshansky
This does not work in the general case. To see this, try: rownames(a}[5] - a and see what happens then. --- François Pinard [EMAIL PROTECTED] wrote: [Gianni Burgin] let say something like this a=matrix(1:25, nrow=5) rownames(a)=letters[1:5] colnames(a)=rep(A, 5) a A A A A A

Re: [R] function to find coodinates in an array

2007-08-16 Thread Moshe Olshansky
A not very good solution is as below: If your array's dimensions were KxMxN and the linear index is i then n - ceiling(i/(K*M)) i1 - i - (n-1)*(K*M) m - ceiling(i1/K) k - i1 - (m-1)*K and your index is (k,m,n) I am almost sure that there is a function in R which does this (it exists in Matlab).

Re: [R] function to find coodinates in an array

2007-08-16 Thread Henrik Bengtsson
See arrayIndex() in the R.utils package, e.g. X - array((2*3*4):1, dim=c(2,3,4)) idx - 1:length(X) ijk - arrayIndex(idx, dim=dim(X)) print(ijk) [,1] [,2] [,3] [1,]111 [2,]211 [3,]121 [4,]221 [5,]131 [6,]231 [7,]1

Re: [R] function to find coodinates in an array

2007-08-16 Thread Marc Schwartz
If I am correctly understanding the problem, I think that this is what you want: set.seed(1) # Create a 3x3x3 array ARR - array(sample(100, 27), c(3, 3, 3)) ARR , , 1 [,1] [,2] [,3] [1,] 27 89 97 [2,] 37 20 62 [3,] 57 86 58 , , 2 [,1] [,2] [,3] [1,]6 61

[R] N.cohen.kappa function for polytomous outcomes

2007-08-16 Thread Stacey Burrows
Is there a function analogous to N.cohen.kappa (concord package) which computes sample size needed for a Kappa statistic with polytomous outcomes? I have just started using R and so far I am finding it is missing alot of things that Stata has. -

Re: [R] Combine matrix

2007-08-16 Thread Gabor Grothendieck
Try this. We convert to data frame placing the row names in column 1, do the merge, remove column 1 and convert back to matrix: # test input a - matrix(1:25, nrow = 5, dimnames = list(letters[1:5], rep(A, 5))) b - matrix(1:40, nrow = 8, dimnames = list(rep(letters[1:2], each = 4), rep(B,

Re: [R] function to find coodinates in an array

2007-08-16 Thread François Pinard
[Ana Conesa] I am looking for a function/way to get the array coordinates of given elements in an array. What I mean is the following: - Let X be a 3D array - I find the ordering of the elements of X by ord - order(X) (this returns me a vector) - I now want to find the x,y,z coordinates

Re: [R] function to find coodinates in an array

2007-08-16 Thread Gabor Grothendieck
Get the indices using expand.grid and then reorder them: set.seed(1); X - array(rnorm(24), 2:4) # input X # look at X do.call(expand.grid, sapply(dim(X), seq))[order(X),] On 8/16/07, Ana Conesa [EMAIL PROTECTED] wrote: Dear list, I am looking for a function/way to get the array coordinates

[R] comparison of arrays of strings

2007-08-16 Thread ramakanth reddy
Hi i have two arrays of genes names,one with18 gene names and the other with 24000 gene names,I have to compare both of them for finding common names. I have both the arrays in .csv format.i loaded the files and tried to compare them using for and if loops but I got the error Error in

[R] for plots

2007-08-16 Thread Brad Zhang
Hi, All, I am a beginner for R. Now I have installed R 2.5.1 in Window environment. After I run a program such as gam I would like to display a plot for the object. The following is an example. When I did this, only the last plot was presented on my screen. How can I get a plot before the last

Re: [R] comparison of arrays of strings

2007-08-16 Thread jim holtman
Read them into 2 different vectors and then use 'intersect'. On 8/17/07, ramakanth reddy [EMAIL PROTECTED] wrote: Hi i have two arrays of genes names,one with18 gene names and the other with 24000 gene names,I have to compare both of them for finding common names. I have both the

Re: [R] for plots

2007-08-16 Thread jim holtman
Turn 'Recording on for the plots. windows(record=TRUE) or select from the GUI. On 8/17/07, Brad Zhang [EMAIL PROTECTED] wrote: Hi, All, I am a beginner for R. Now I have installed R 2.5.1 in Window environment. After I run a program such as gam I would like to display a plot for the