Re: [R] OT - use of R

2007-08-14 Thread Chung-hong Chan
A quick search of google scholar found 2556 cites to the classic paper by Ihaka et al. http://scholar.google.com/scholar?hl=enlr=cites=15992947024900415641 On 8/15/07, Andy Bunn [EMAIL PROTECTED] wrote: Hello, is there an up-to-date reference for how many people use R? I'm giving an R demo

[R] lmer problem

2007-08-02 Thread Yunjeong Hong
Dear all, Here's my question about lmer. this function is very weird because it depends on the data set to work. sometimes it works, other times does not work. I attach the data file and the codes are below that I tried to make it work. Please let me know what the problem is and how to solve

Re: [R] for loop doesn't stop with upper loop value

2007-07-03 Thread Hong Ooi
___ lower+2 : upper parses as lower + (2:upper). The colon operator has fairly high precedence. What you want is (lower + 2):upper -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW

Re: [R] Meta-Analysis of proportions

2007-06-28 Thread Chung-hong Chan
OpenBUGS should be something related to Bayesian statistics. You may refer to Chapter 12 of Handbook http://cran.r-project.org/doc/vignettes/HSAUR/Ch_meta_analysis.pdf It talks about meta-regression. On 6/28/07, Monica Malta [EMAIL PROTECTED] wrote: Dear colleagues, I'm conducting a

Re: [R] if within a function

2007-06-21 Thread Hong Ooi
(a) { if(a == 1) 1 else 2 } see ?return -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yuchen Luo Sent: Thursday, 21 June 2007 3:28 PM To: r-help

[R] Date and selection

2007-06-19 Thread Chung-hong Chan
Dear R experts, Suppose I have a data.frame recording the date and test results of some subjects like this: Name Date results John 01/01/1991 2 John 02/01/1991 3 John 09/0101991 4 Micheal 02/01/1991 4 Micheal 04/01/1991 5 How to select the earliest (or latest) test result from all

Re: [R] How to load a big txt file

2007-06-06 Thread Chung-hong Chan
Easy solution will be split your big txt files by text editor. e.g. 5000 rows each. and then combine the dataframes together into one. On 6/7/07, ssls sddd [EMAIL PROTECTED] wrote: Dear list, I need to read a big txt file (around 130Mb; 23800 rows and 49 columns) for downstream clustering

[R] Proxy Under Mac OS X

2007-05-31 Thread Chung-hong Chan
Dear R programmers, I can only config. proxy under Mac OS X terminal and launch R under Terminal by Terminal: export http_proxy=http://un:[EMAIL PROTECTED]:port Under R: chooseCRANmirror(graphics=FALSE) update.packages() I don't know how to config this in R for Mac OS X Aqua GUI. I checked

Re: [R] R's Spearman

2007-05-28 Thread Chung-hong Chan
Hi, You can try with cor.test(rank(y[1]),rank(y[2])) On 5/29/07, Raymond Wan [EMAIL PROTECTED] wrote: Hi all, I am trying to figure out the formula used by R's Spearman rho (using cor(method=spearman)) because I can't seem to get the same value as by calculating by hand. Perhaps I'm

Re: [R] Simple question about function with glm

2007-05-07 Thread Chung-hong Chan
Thank you akk. I know it is not statistically sounded to check the distribution of response before glm. I will check the distribution of xmodel$residuals later on. About the program problem. It can print summary(xmodel) but not confint(xmodel) by amending my code as suggested by Bill Venables.

[R] H-scatter plot in geostatistics

2007-05-07 Thread Hong Su An
Hello: I would like to make h-scatter plot. My data looks like as follow: x, y, z, 12.0, 11.2, 12, 10.21, 5.42, 8, 5.12, -8.25, 7, I want to make h-scatter plot for the z values by difference distance h from 1 to 20. There are 1023 observations. Do I need to change data class from

[R] Simple question about function with glm

2007-05-06 Thread Chung-hong Chan
Dear all, I coded a function called u.glm u.glm - function (x,ahi,age,bmiz,gender) { library(nortest) lil.rslt - lillie.test(x) if (lil.rslt$p.value 0.05) { cat(Logtrans=0, lillie=,lil.rslt$p.value,\n)

[R] Memory increase in R

2007-04-18 Thread Hong Su An
. There is error like as below: “The name C:\Documents and Settings\Hong Su An\My Documents\R\R-2.4.1\bin\Rgui.exe--max-mem-size=1024M specified in the Target box is not valid” I use R2.4.1. in window xp with sp2 and 4Gb RAM. Have a nice day. Hong Su An. [EMAIL PROTECTED

[R] Model matrix with redundant columns included

2007-03-13 Thread Hong Ooi
and adds the column for the base level of the first variable, but not the rest. Thanks, -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 ___ The information transmitted

Re: [R] hwo can i get a vector that...

2007-03-07 Thread Hong Ooi
___ max.col sounds like what you're after. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] Problem with sas.get function in Hmisc

2006-12-13 Thread Hong Ooi
a problem with the WinXP commmand interpreter? In any case, changing the sys() call to system() seems to fix the problem. ... status - system(paste(shQuote(sasprog), shQuote(sasin), -log, shQuote(log.file))) ... -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St

[R] Interaction and factor ':'

2006-11-15 Thread Hong Ooi
is the same as interaction(f,g, sep=:) when f and g are factors. I came across this when fitting multinom models, and the column order of the predicted probabilities shifted around depending on whether I used interaction or : on the LHS of the formula. -- Hong Ooi Senior Research Analyst, IAG

[R] How to specify a constant in gnls{nlme}

2006-10-25 Thread hong qin
Hi All, I have question about speficifying a constant in gnls() from package nlme. Here is a testing code: # library(nlme) x = exp( rnorm(100)) y = 1/(1+x) + rnorm(100)/10 plot( y ~ x) fm1 = gnls( y ~ 1/(1+(x/v)^w), start=list( v=1, w=1)) a =1; b=1; fm2 = gnls( y ~

[R] problem with mode of marginal distriubtion of rdirichlet{gtools}

2006-10-21 Thread hong qin
Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I tried to study the above properties using rdirichlet from gtools. The code are: ## library(gtools)

[R] problem of mode in marginal distributions of dirichlet distribution using rdirichlet{gtools}

2006-10-20 Thread hong qin
Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I tried to study the above properties using rdirichlet from gtools. The code are: ## library(gtools)

[R] function used to smooth the scatter plot and generate a density map

2006-10-09 Thread hong
Dear R-helpers, I want to smooth a scatter plot (or 2d histogram) to generate the density map using a squared Euclidean kernel function, with each data point contributing a density of 1/(r*r + k) to each cell on the heatmap, where r*r was the squared Euclidean distance between the coordinates of

[R] Glitch when creating online help

2005-12-13 Thread Hong Ooi
within R, not the html version. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 ___ The information transmitted in this message and its attachme...{{dropped

Re: [R] Glitch when creating online help

2005-12-13 Thread Hong Ooi
within an \item) gives the same glitch as described below. (Maybe I need to brush up on my TeX) -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hong Ooi

Re: [R] strange behavior of loess() predict()

2005-12-06 Thread Hong Ooi
3.913375 [49] 3.980249 4.048733 There's probably a way to make the aggregate and table calls neater. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leo

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Hong Ooi
to avoid it in R/S. Using if(identical(x, 1)) {... also addresses this problem, but that just looks awkward to me. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread Hong Ooi
. Of course, this really amounts to writing my own modelling function, so I'm not sure if it counts as straightforward. PS. Have my messages suddenly had word wrap turned off? Just noticed this in my recent posts to the list. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW

Re: [R] Looking for constrained optimisation code

2005-11-30 Thread Hong Ooi
, on a Windows XP workstation with 3GB of memory.) -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 +61 (2) 9292 1566 -Original Message- From: Spencer Graves [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29 November 2005 12:58 PM To: Hong Ooi Cc: Thomas Lumley; r-help

Re: [R] rlogis() in simulation

2005-11-29 Thread Hong Ooi
be about sqrt(3*0.25)/pi ~ 0.27567. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Wednesday, 30 November 2005 7:53 AM To: r-help

[R] Looking for constrained optimisation code

2005-11-28 Thread Hong Ooi
on the parameters, but ideally I'd like to be able to specify more general constraints on the solution space. Even if code isn't readily available, any tips on how to persuade optim/nlminb to cope with general constraints would also be much appreciated. Thanks! -- Hong Ooi Senior Research Analyst, IAG

Re: [R] Looking for constrained optimisation code

2005-11-28 Thread Hong Ooi
should be able to hack up a barrier function in my own code and feed that into optim/nlminb/constrOptim. Thanks! -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: Thomas Lumley [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29

Re: [R] glm: quasi models with logit link function and binary data

2005-11-28 Thread Hong Ooi
. Null); 99 Residual Null Deviance: 37.15 Residual Deviance: 37.15AIC: NA -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Björn Stollenwerk Sent

Re: [R] glm: quasi models with logit link function and binary data

2005-11-28 Thread Hong Ooi
___ Hm, I should have checked what would happen with binary data and not just continuous. Using glm with quasi(var=mu(1-mu), link=logit) indeed fails with NAs/NaNs when y is binary. -- Hong Ooi Senior

Re: [R] the matrix of rows with specific row sums

2005-11-22 Thread Hong Ooi
. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seth Falcon Sent: Wednesday, 23 November 2005 8:38 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] the matrix

Re: [R] negative binomial overdispersion question

2005-11-22 Thread Hong Ooi
___ I don't know the text in question, but it looks like a difference in parametrisation -- the R output is just the inverse of that from the book. -- Hong Ooi Senior Research Analyst, IAG Limited 388 George

[R] Unexpected result of names-

2005-11-15 Thread Hong Ooi
for why this is happening? -- Hong Ooi Senior Research Analyst, IAG Limited 388 George St, Sydney NSW 2000 (02) 9292 1566 ___ The information transmitted in this message and its attachments (if any) is intended

[R] R-Help : running MIX package

2005-01-28 Thread Jeanhee Hong
Hello all. I am inexperienced with R and am clumsily trying to work through it for specific multiple imputations Id like to run for my thesis.In running the MIX package, I keep getting an error message regarding the use of the prelim.mix command. Error in as.integer.default(list(alcohol =