Re: [R] MacOS delayed output (was Unlogical phenomenon caused by locator)

2005-04-17 Thread Prof Brian Ripley
I believe this is a function of the Mac console (I presume you are using the console, but you did not say). Please ask Mac-specific questions on R-sig-mac (or at the very least put `MacOS' in your subject line). I believe that adding flush.console() after the cat() call works on Mac as it

Re: [R] How to create a vector with one, two, three, ...?

2005-04-17 Thread Frank Duan
Dear John, That's exactly what I want. Millions of thanks, Frank On 4/16/05, John Fox [EMAIL PROTECTED] wrote: Dear Frank, This was an interesting exercise. Here's a solution: numbers2words - function(x){ helper - function(x){ digits - rev(strsplit(as.character(x), )[[1]])

RE: [R] Generating a binomial random variable correlated with a

2005-04-17 Thread Ted Harding
On 16-Apr-05 Ashraf Chaudhary wrote: Ted: Thank you for your help. All I want is a binomial random variable that is correlated with a normal random variable with specified correlation. By linear I mean the ordinary Pearson correlation. I tried the following two methods, in each case the

Re: [R] Re: HOWTO compare univariate binomial glm lrm models which are not nested

2005-04-17 Thread Frank E Harrell Jr
Prof Brian Ripley wrote: Compare them by `goodness for purpose': you have not told us the purpose. Please do read some of the extensive literature on model comparison. On Sat, 16 Apr 2005, Jan Verbesselt wrote: Thanks a lot for the input! I forgot to add family=binomial, for a binomial glm. Now

RE: [R] Generating a binomial random variable correlated with a

2005-04-17 Thread Ted Harding
On 17-Apr-05 Ted Harding wrote: [...] So I'd suggest experimenting on the following lines. 1. Let X1 be a sample of size N using rbinom(N,1,p) (where, in general, p need not be 0.5) 2. Let Y be a sample of size N using rnorm(N,mu,sigma) (and again, in general, mu need not be 0 nor

[R] Creating packages with windows (accessing data)

2005-04-17 Thread Alan Arnholt
Dear R List, I have created a package (under Windows 2.0.1) with 300+ data sets and 20 or so functions I use in teaching. However, to access the data, one needs to type data(foo) once the package has been installed and loaded. With other packages namely MASS, after the package is installed and

[R] generalized linear mixed models - how to compare?

2005-04-17 Thread Nestor Fernandez
Dear all, I want to evaluate several generalized linear mixed models, including the null model, and select the best approximating one. I have tried glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result in similar parameter estimates but fairly different likelihood estimates. My

RE: [R] Re: HOWTO compare univariate binomial glm lrm models which are not nested

2005-04-17 Thread Jan Verbesselt
Dear all, Thanks a lot for the input. I will take the considerations into account. Referring to; 2 or 3 completely pre-chosen models or you will invalidate inference and estimates if you use these comparisons to build a final model The aim is not use the comparisons to build a final model but

Re: [R] Creating packages with windows (accessing data)

2005-04-17 Thread Prof Brian Ripley
Look at `Writing R Extensions' and the description of the DESCRIPTION file, specifically `LazyData'. That is the manual about packages On Sun, 17 Apr 2005, Alan Arnholt wrote: I have created a package (under Windows 2.0.1) with 300+ data sets and 20 or so functions I use in teaching.

Re: [R] Re: HOWTO compare univariate binomial glm lrm models which are not nested

2005-04-17 Thread Frank E Harrell Jr
Jan Verbesselt wrote: Dear all, Thanks a lot for the input. I will take the considerations into account. Referring to; 2 or 3 completely pre-chosen models or you will invalidate inference and estimates if you use these comparisons to build a final model The aim is not use the comparisons to

Re: [R] generalized linear mixed models - how to compare?

2005-04-17 Thread Deepayan Sarkar
On Sunday 17 April 2005 08:39, Nestor Fernandez wrote: Dear all, I want to evaluate several generalized linear mixed models, including the null model, and select the best approximating one. I have tried glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result in similar

Re: [R] generalized linear mixed models - how to compare?

2005-04-17 Thread Prof Brian Ripley
On Sun, 17 Apr 2005, Deepayan Sarkar wrote: On Sunday 17 April 2005 08:39, Nestor Fernandez wrote: I want to evaluate several generalized linear mixed models, including the null model, and select the best approximating one. I have tried glmmPQL (MASS library) and GLMM (lme4) to fit the models.

[R] array indexing and which

2005-04-17 Thread Werner Wernersen
Hi R friends! I am stuck with a stupid question: I can circumvent it but I would like to understand why it is wrong. It would be nice if you could give me a hint... I have an 2D array d and do the following: ids - which(d[,1]0) then I have a vector gk with same column size as d and do: ids2 -

Re: [R] is there a function like %in% for characters?

2005-04-17 Thread Douglas Bates
Sundar Dorai-Raj wrote: Terry Mu wrote on 4/2/2005 9:38 PM: like: a %in% abcd TRUE Thanks. See ?regexpr. regexpr(a, abcd) 0 However, the first argument is not vectorized so you may also need something like: sapply(c(a, b, e), regexpr, c(abcd, bcde)) 0 ab e [1,] TRUE TRUE

Re: [R] array indexing and which

2005-04-17 Thread Marc Schwartz
On Sun, 2005-04-17 at 19:13 +0200, Werner Wernersen wrote: Hi R friends! I am stuck with a stupid question: I can circumvent it but I would like to understand why it is wrong. It would be nice if you could give me a hint... Having a reproducible example, as per the posting guide, would be

Re: [R] generalized linear mixed models - how to compare?

2005-04-17 Thread Deepayan Sarkar
On Sunday 17 April 2005 12:07, Prof Brian Ripley wrote: On Sun, 17 Apr 2005, Deepayan Sarkar wrote: [...] GLMM uses (mostly) the same procedure to get parameter estimates, but as a final step calculates the likelihood for the correct model for those estimates (so the likelihood reported

RE: [R] array indexing and which

2005-04-17 Thread Bill.Venables
You need to think about it just a bit harder. [Hint: what happens if you leave out the first 'which' and just make ids - (d[, 1] 0) does it work then...?] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Werner Wernersen Sent: Monday, 18 April 2005

[R] Minimum distance

2005-04-17 Thread Williams, Michael
G'day, I have a matrix 2 x 500 populated with all the distances between a list of airports and a list of towers. What I'm having trouble doing is finding the closest airport to each tower, Any help would be greatly appreciated. Regards, Michael Williams [[alternative HTML version

Re: [R] Minimum distance

2005-04-17 Thread Douglas Bates
Williams, Michael wrote: G'day, I have a matrix 2 x 500 populated with all the distances between a list of airports and a list of towers. What I'm having trouble doing is finding the closest airport to each tower, Any help would be greatly appreciated. Regards, Michael Williams Sounds like you

[R] polycoric correlation

2005-04-17 Thread Hiroto Miyoshi
Dear R-users Could anyone tell me which library contains a function to compute polycoric correlations? I wonder the same question was asked a while ago, but I could not locate the mail in the R-help archives. Sorry for bothering you. Sincerely

Re: [R] polycoric correlation

2005-04-17 Thread Steve Buyske
Here you go: Information on Package 'polycor' Description: Package: polycor Title: Polychoric and Polyserial Correlations Date: 2004/12/12 Version: 0.7-0 Depends: R (= 1.9.0), mvtnorm Author:John Fox Description: Computes polychoric

[R] Re[1]: Your soft wait you until you buy it. audioshattuckgaussian

2005-04-17 Thread Denny Kendall
Our offers are unbeatable and we always update our prices to make sure we provide you with the best possible offers! MS Plus! XP... Our Price: $50.00 Norton Antivirus Corporate Edition 2003 Our Price: $40.00 Microsoft Visual Studio.NET Architect Edition.. Our Price:

RE: [R] Minimum distance

2005-04-17 Thread Mulholland, Tom
Since it is not clear exactly what you require, I have assumed that what you are looking for is the minimum value for each row or column depending upon which is airports and which is the towers. Is this what you are looking for x - runif(100) dim(x) - c(5,20) apply(x,1,function(y) which(y ==

[R] Forcing best-fit lines to go through the origin

2005-04-17 Thread Jim Milks
Dear All, I have a rather unusual problem. I have a set of data for a class in subsurface processes. From that dataset, I must calculate the slope of the best-fit line (which is the parameter of interest). The problem I have is twofold: 1) for the purposes of the exercise, I must force my