Re: [R] comment in src/nmath/dgamma.c

2005-06-26 Thread Prof Brian Ripley
On Sat, 25 Jun 2005, Faheem Mitha wrote: > > Hi, > > In src/nmath/dgamma.c the comment at the top says > > * DESCRIPTION > * > * Computes the density of the gamma distribution, > * > * 1/s (x/s)^{a-1} exp(-x/s) > *p(x;a,s) = --- > *

Re: [R] optimization problem in R ... can this be done?

2005-06-26 Thread Uwe Ligges
Gregory Gentlemen wrote: > Spencer: Thank you for the helpful suggestions. I have another > question following some code I wrote. The function below gives a > crude approximation for the x of interest (that value of x such that > g(x,n) is less than 0 for all n). > > # // btilda optimize g(n,x) f

[R] chisq.test using amalgamation automatically (possible ?!?)

2005-06-26 Thread Mohammad Ehsanul Karim
Dear List, If any of observed and/or expected data has less than 5 frequencies, then chisq.test (Pearson's Chi-squared Test for Count Data from package:stats) gives warning messages. For example, x<-c(10, 14, 10, 11, 11, 7, 8, 4, 1, 4, 4, 2, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) y<-c(9.1

[R] Mixed model

2005-06-26 Thread Stephen
Hi All, I am currently conducting a mixed model. I have 7 repeated measures on a simulated clinical trial. If I understand the model correctly, the outcome is the measure (as a factor) the predictors are clinical group and trial (1-7). The fixed factors are the measure and group. The rando

[R] (sans objet)

2005-06-26 Thread pir2.jv
Ma première question: puis-je écrire en français, mon anglais est pire que pire. J'essaie en français; sinon, j'essaierai une traduction! Je sduis débutant. Ma question est donc simple, j'imagine. Je travaille sur des tableaux de statistiques. Je prends un exemple: J'ai un "frame" que j'appelle

Re: [R] r equivalent of egen? Not tapply

2005-06-26 Thread Tobias Muhlhofer
Thomas, I usually use the aggregate() function, proceeding as follows. Construct a vector of 1s that is the same length as your entire data. Then use aggregate() with sum as a function on this vector and your grouping variable as a by argument (note the use of na.rm in sum). This will create a

[R] Re Components of variance

2005-06-26 Thread John Wilkinson \(pipex\)
John, In addition to 'VarCorr(nlme) and VarCorr(Matrix)', you could also try 'varcomp' function in the 'ape' package.This requires an 'lme' class of file, from the 'nlme package as input.It additionally gives the options to scale the components by normalizing them (both cumulatively and in total)

[R] visualizing frequencies

2005-06-26 Thread Mag. Ferri Leberl
Dear everybody, In our game-theory lesson we have run several classroom-experiments where the students had to decide for a natural number between one and seven. I have troubles now to visualize the results: be a the vector of answers. hist(a) will not assume natural numbers as answers, but rati

Re: [R] visualizing frequencies

2005-06-26 Thread Gabor Grothendieck
On 6/26/05, Mag. Ferri Leberl <[EMAIL PROTECTED]> wrote: > Dear everybody, > > In our game-theory lesson we have run several classroom-experiments where the > students had to decide for a natural number between one and seven. I have > troubles now to visualize the results: be a the vector of answe

Re: [R] visualizing frequencies

2005-06-26 Thread Duncan Murdoch
Mag. Ferri Leberl wrote: > Dear everybody, > > In our game-theory lesson we have run several classroom-experiments where the > students had to decide for a natural number between one and seven. I have > troubles now to visualize the results: be a the vector of answers. > > hist(a) will not assu

Re: [R] interpreting Weibull survival regression

2005-06-26 Thread Göran Broström
On Fri, Jun 24, 2005 at 11:27:28AM -0400, [EMAIL PROTECTED] wrote: > Hi, > I was wondering if someone can help me > interpret the results of running > weibreg. > > I run the following and get the > following R output. > > weibreg(Surv(time, censor)~covar) > fit$fail = 0 > Call: > weibreg(formu

Re: [R] Mixed model

2005-06-26 Thread Douglas Bates
On 6/26/05, Stephen <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > I am currently conducting a mixed model. I have 7 repeated measures on a > simulated clinical trial. If I understand the model correctly, the > outcome is the measure (as a factor) the predictors are clinical group > and t

[R] is.all.equal

2005-06-26 Thread hadley wickham
Hi, The description of all.equal states "is.all.equal should be used for programming, typically in if expressions. It is a simple wrapper using identical as shown in the documentation there.", but is.all.equal is not explicitly defined there (although there is a hint in the comments that is.all.eq

Re: [R] Components of variance

2005-06-26 Thread Spencer Graves
Hi, Renaud: Thanks for the link to Doug Bates' recent comment on this. Unfortunately, the information contained therein is not enough for me to easily obtain all the required standard errors and write code to make confidence intervals. To be more specific, I'm able to produce the same a

Re: [R] chisq.test using amalgamation automatically (possible ?!?)

2005-06-26 Thread Gabor Grothendieck
On 6/26/05, Mohammad Ehsanul Karim <[EMAIL PROTECTED]> wrote: > Dear List, > > > If any of observed and/or expected data has less than > 5 frequencies, then chisq.test (Pearson's Chi-squared > Test for Count Data from package:stats) gives warning > messages. For example, > > x<-c(10, 14, 10, 11

Re: [R] better code?

2005-06-26 Thread Spencer Graves
Hi, Laura: How about the following: > sapply(x1.df, class) d x y "factor" "numeric" "numeric" > (byLH <- by(x1.df[-1], x1.df$d, var)) x1.df$d: 1/1/2005 x y x 1.272688 -0.783719 y -0.783719 0.884866 ---

Re: [R] (sans objet)

2005-06-26 Thread Spencer Graves
Have you studied "An Introduction to R" [available via help.start()]? Note especially the sections on "Factors", "Arrays and matrices", and "Lists and data frames". There are also a couple of French-language introductions to R available via "www.r-project.org" -> Documentation:

Re: [R] optimization problem in R ... can this be done?

2005-06-26 Thread Spencer Graves
The precision is not a problem, only the display, as Uwe indicated. Consider the following: > (seq(25.5,25.6,length=20)-25.5)[c(1, 2, 19, 20)] [1] 0.00e+00 5.25e-07 9.50e-02 1.00e-01 > ?options > options(digits=20) > seq(25.5,25.6,length=20)[c(1, 2, 1

[R] Sweave with layout() and loop

2005-06-26 Thread Mikkel Grum
When I try the following code with the Windows graphics window, a new window is opened for each multiple of four images I produce. par(layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE)), mar = c(2, 3, 2, 3)) for (i in 1:n) { image(... ) } When I try to do the same with Sweave to produce a pdf docu

Re: [R] Components of variance

2005-06-26 Thread Douglas Bates
On 6/26/05, Spencer Graves <[EMAIL PROTECTED]> wrote: > Hi, Renaud: > > Thanks for the link to Doug Bates' recent comment on this. > Unfortunately, the information contained therein is not enough for me to > easily obtain all the required standard errors and write code to make > confiden

Re: [R] Components of variance

2005-06-26 Thread Spencer Graves
Hi, Doug: Thanks for your reply. I'm keenly aware of many of the issues you've mentioned. (I've learned much of what I know about this from your innovation research.) Besides, "lme" provides one answer to that question, if not a great one. Moreover, if someone is really

[R] dates and time formats

2005-06-26 Thread Mike R
Is there a way in R to globally setup a default format for dates for all, or nearly all, or just "many" R date/time-related functions? For example, dates in library(chron) expects, by default, MDY with forward-slash delimiters, whereas my habit and my data sets tend to be YMD with dash delimiter

Re: [R] dates and time formats

2005-06-26 Thread Gabor Grothendieck
On 6/26/05, Mike R <[EMAIL PROTECTED]> wrote: > Is there a way in R to globally setup a default format for dates for all, or > nearly all, or just "many" R date/time-related functions? > > For example, dates in library(chron) expects, by default, MDY with > forward-slash delimiters, whereas my hab

Re: [R] interpreting Weibull survival regression

2005-06-26 Thread Prof Brian Ripley
> Here gamma is the usual gamma function, see ?gamma. (I notice in the R > documentation of the Weibull distribution that "E(X) = b Gamma(1+1/a)", > which is an error; the G should be g (lowercase).) It is not an error. R's function gamma() is said to implement \eqn{\Gamma}{Gamma}: `see ?gamma'!

Re: [R] better code?

2005-06-26 Thread Spencer Graves
OK. How about the following: R> x1.df$d. <- as.Date(as.character(x1.df$d), format="%m/%d/%Y") R> sapply(x1.df, class) d x yd. "factor" "numeric" "numeric""Date" R> R> (byLH <- by(x1.df[2:3], x1.df$d., var)) x1.df$d.: 2005-01-01 x

[R] Convert a "by" list into a data frame

2005-06-26 Thread Tudor Bodea
Dear useRs, Is there a way to convert a list generated by "by" command into a data frame? Or, more generally, are there any functions that operate on "by" lists? My "by" list consists of numeric vectors of equal length and the objective is to calculate the sum of the same index elements (i.e., col

Re: [R] Convert a "by" list into a data frame

2005-06-26 Thread Gabor Grothendieck
On 6/26/05, Tudor Bodea <[EMAIL PROTECTED]> wrote: > Dear useRs, > > Is there a way to convert a list generated by "by" command into a data frame? Here is an example which creates a by object whose elements are the first row of each Species of iris. The next line converts that to a data frame:

[R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-26 Thread Spencer Graves
How can one convert back slashes to forward slashes, e.g, changing "c:\a\b" to "c:/a/b"? I tried the following: > gsub("", "/", "c:\a\b") [1] "c:\a\b" Since this didn't work, I eliminated the replacement as a contributor as follows: > gsub("X", "/", "c:XaXb") [1] "c:

Re: [R] interpreting Weibull survival regression

2005-06-26 Thread Göran Broström
On Sun, Jun 26, 2005 at 11:28:04PM +0100, Prof Brian Ripley wrote: > >Here gamma is the usual gamma function, see ?gamma. (I notice in the R > >documentation of the Weibull distribution that "E(X) = b Gamma(1+1/a)", > >which is an error; the G should be g (lowercase).) > > It is not an error. R's

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-26 Thread Dirk Eddelbuettel
On 26 June 2005 at 20:30, Spencer Graves wrote: | How can one convert back slashes to forward slashes, e.g, changing | "c:\a\b" to "c:/a/b"? I tried the following: | | > gsub("", "/", "c:\a\b") | [1] "c:\a\b" This does work, provided you remember that single backslashed "don't exi

Re: [R] How to convert "c:\a\b" to "c:/a/b"?

2005-06-26 Thread Gabor Grothendieck
On 6/27/05, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote: > > On 26 June 2005 at 20:30, Spencer Graves wrote: > | How can one convert back slashes to forward slashes, e.g, changing > | "c:\a\b" to "c:/a/b"? I tried the following: > | > | > gsub("", "/", "c:\a\b") > | [1] "c:\a\b" > >

Re: [R] Mixed model

2005-06-26 Thread Stephen
Hi Thank you for your comments. Yes you are correct its a very big data set. Perhaps I am best splitting it up and then importing to R. The reason for the loop is that I am conducting the equivalent of Split file in SPSS. Specifically, I am conducting the analysis for each value of on the grouping

Re: [R] is.all.equal

2005-06-26 Thread Christoph Buser
Hi It is corrected in the newer R-version. The help page now says: 'all.equal(x,y)' is a utility to compare R objects 'x' and 'y' testing "near equality". If they are different, comparison is still made to some extent, and a report of the differences is returned.Don't use 'all.equal' direct

Re: [R] is.all.equal

2005-06-26 Thread Uwe Ligges
hadley wickham wrote: > Hi, > > The description of all.equal states "is.all.equal should be used for > programming, typically in if expressions. It is a simple wrapper using > identical as shown in the documentation there.", but is.all.equal is > not explicitly defined there (although there is a