Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: "the global deviance is increasing"

2010-06-03 Thread Gavin Simpson
On Wed, 2010-06-02 at 13:45 +0200, Joris Meys wrote: > Hi Diederik, > > I can't say immediately why your models fail without seeing the data and > running a number of tests. You could play around with the other parameters, > as the problem might be related to the optimization algorithm. > > A dif

Re: [R] Sweave glm.fit

2010-06-03 Thread Gavin Simpson
On Wed, 2010-06-02 at 20:29 +0200, Jimmy Söderly wrote: > Dear R users, > > After running Sweave, this is what I get : > > Warning messages: > 1: glm.fit: algorithm did not converge > 2: glm.fit: algorithm did not converge > There is no glm.fit function in my code. glm calls glm.fit did you call

[R] intersection on more than two sets

2010-06-03 Thread amir
Hi, I want to do an intersection or union on more than two sets. Is there any command to do this? Regards, Amir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

[R] compare results of glms

2010-06-03 Thread Sacha Viquerat
dear list! i have run several glm analysises to estimate a mean rate of dung decay for independent trials. i would like to compare these results statistically but can't find any solution. the glm calls are: dung.glm1<-glm(STATE~DAYS, data=o_cov, family="binomial(link="logit")) dung.glm2<-glm(

Re: [R] intersection on more than two sets

2010-06-03 Thread jim holtman
?Reduce > x <- function(z) Reduce('union', z) > x(list(1:3, 4:6)) [1] 1 2 3 4 5 6 > x(list(1:3, 4:6, 3:7)) [1] 1 2 3 4 5 6 7 > x <- function(z) Reduce('intersect', z) > x(list(1:3, 4:6, 3:7)) integer(0) > x(list(1:3, 2:6, 3:7)) [1] 3 On Thu, Jun 3, 2010 at 3:59 AM, amir wrote: > Hi, > > I want

[R] compare results of glms

2010-06-03 Thread Sacha Viquerat
dear list! i have run several glm analysises to estimate a mean rate of dung decay for independent trials. i would like to compare these results statistically but can't find any solution. the glm calls are: dung.glm1<-glm(STATE~DAYS, data=o_cov, family="binomial(link="logit")) dung.glm2<-glm(

[R] increase memory

2010-06-03 Thread azam jaafari
Dear All   Pleas help me to increase the memory in R.   In order increase memory, I read the FAQ and follow the instruction as below     Close R, then right-click on your R program icon (the icon on your desktop or in your programs directory). Select ``Properties'', and then select the ``Sho

Re: [R] increase memory

2010-06-03 Thread Henrik Bengtsson
On Thu, Jun 3, 2010 at 11:11 AM, azam jaafari wrote: > Dear All > > Pleas help me to increase the memory in R. > > In order increase memory, I read the FAQ and follow the instruction as below > > > Close R, then right-click on your R program icon (the icon on your desktop or > in your programs di

Re: [R] lapply or data.table to find a unit's previous transaction

2010-06-03 Thread Matthew Dowle
William, Try a rolling join in data.table, something like this (untested) : setkey(Data, UnitID, TranDt)# sort by unit then date previous = transform(Data, TranDt=TranDt-1) Data[previous,roll=TRUE]# lookup the prevailing date before, if any, for each row within that row's UnitID Tha

Re: [R] Help barplots

2010-06-03 Thread Jim Lemon
On 06/03/2010 01:27 AM, khush wrote: Hi all, I want to draw a arrow (small) of any length along with OsCYP right side i.e parrallel and antiparallel arrows both text(os[1], 10.2, pos = 4, "OsCYP", font=1, cex = 1, col = "red") and how can I connect two points with dotted line let

Re: [R] pdf function, resize xyplot plot automatically

2010-06-03 Thread Patrick Connolly
On Wed, 02-Jun-2010 at 02:34PM -0400, Afshartous, David wrote: |> |> All, |> |> When saving plots to a pdf file via the pdf function, I would like to be |> able to automatically expand the graphics device to achieve the same result |> as when one does this manually (e.g., clicking the green expa

[R] function

2010-06-03 Thread n.via...@libero.it
Dear list, I would like to ask you a question. I'm trying to build the time series' production with the Divisia index. The final step would require to do the following calculations: a)PROD(2006)=PROD(2007)/1+[DELTA_PROD(2007)] b)PROD(2005)=PROD(2006)+[1+DELTA_PROD(2006)] c)PROD(2004)=PROD(2005)

[R] ISO 8601 Weeks/Years on Windows with strptime

2010-06-03 Thread Michael Höhle
Dear R-help, I am working on a R package for public health surveillance where the ISO 8601 representation of dates is of importance. Especially, the ISO Week and ISO Year of a date needs to be extracted. I was quite happy to find all of this implemented in the "Date" class with appropriate calls t

[R] rules for optimizing samples in CLARA (size and numbers) ?

2010-06-03 Thread vincent vicaire
Hi, With a 9000 observations dataset, I have noticed a significant variability in the silhouette index when I change the default value for samples (5 default value) and sampsize (40+2*clusters number) in CLARA. Is there somes rules according to the number of cluster and observations to fix sampl

Re: [R] mlogit and weights

2010-06-03 Thread Achim Zeileis
On Wed, 2 Jun 2010, Misha Spisok wrote: Hello, I can't figure out why using and not using weights in mlogit yields identical results. My motivation is for the case when an "observation" or "individual" represents a number of individuals. For example, library(mlogit) library(AER) data("Travel

Re: [R] ISO 8601 Weeks/Years on Windows with strptime

2010-06-03 Thread Gustaf Rydevik
2010/6/3 Michael Höhle : > Dear R-help, > > I am working on a R package for public health surveillance where the ISO > 8601 representation of dates is of importance. Especially, the ISO Week > and ISO Year of a date needs to be extracted. I was quite happy to find > all of this implemented in the "

Re: [R] Draw text with a box surround in plot.

2010-06-03 Thread Jim Lemon
On 06/03/2010 08:57 AM, g...@ucalgary.ca wrote: text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Hi james, Have a look at boxed.labels and textbox in the plotrix package. Jim __ R-help@r-project.org mail

Re: [R] function

2010-06-03 Thread Joris Meys
This is what you asked for. > Prod2007 <- 1:10 > Prod2006 <- Prod2007/1+c(0,diff(Prod2007)) > Prod2005 <- Prod2006+(1+c(0,diff(Prod2006))) > Prod2004 <- Prod2005+(1+c(0,diff(Prod2005))) > Prod2006 [1] 1 3 4 5 6 7 8 9 10 11 > Prod2005 [1] 2 6 6 7 8 9 10 11 12 13 > Prod2004 [1

[R] gam error

2010-06-03 Thread natalieh
Hi all, I'm trying to use a gam (mgcv package) to analyse some data with a roughly U shaped curve. My model is very simple with just one explanatory variable: m1<-gam(CoT~s(incline)) However I just keep getting the error message "Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$kno

[R] ARIMA order

2010-06-03 Thread nuncio m
Hi all, Is there any way in R to select the order of an ARIMA model automatically nuncio -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma Goa-403804 [[alternative HTML version deleted]]

Re: [R] gam error

2010-06-03 Thread Joris Meys
Data? On Thu, Jun 3, 2010 at 1:24 PM, natalieh wrote: > > Hi all, > > I'm trying to use a gam (mgcv package) to analyse some data with a roughly > U > shaped curve. My model is very simple with just one explanatory variable: > > m1<-gam(CoT~s(incline)) > > However I just keep getting the error m

Re: [R] Fancy Page layout

2010-06-03 Thread Carlos Ortega
Hello, You can the same as trellis but with the standar graphics library in the direction you are exploring. Use par(mfrow=c(5,2)) to display your graphics. The size and location of the graphics can be managed with the layout() function, present in the graphics library. And with mtext and text fu

Re: [R] glmnet strange error message

2010-06-03 Thread Dave_F
I think I have figured out the problem. The response variable has one level with only one observation -- hence when that one observation was in the test set the training data did not contain any observations from that level and so did not fit a logistic model for that level causing the somewhat cr

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread Joris Meys
x <- rnorm(100,10,1) sqrtx <- sqrt(x) y <- rbinom(100,1,0.5) lrm(y~x+sqrtx) works. What's the problem? But you wrote linear+ square. Don't you mean: lrm(Y~x+x^2) Cheers On Thu, Jun 3, 2010 at 6:34 AM, zhu yao wrote: > Dear r users > > I have a question in coding continuous variables in logis

Re: [R] ordinal variables

2010-06-03 Thread Iasonas Lamprianou
Dear colleagues, I teach statistics using SPSS. I want to use R instead. I hit on one problem and I need some quick advice. When I want to work with ordinal variables, in SPSS I can compute the median or create a barchart or compute a spearman correlation with no problems. In R, if I "read" the

Re: [R] Faster union of polygons?

2010-06-03 Thread nikhil kaza
Reduce might work. Not sure about the speed advantages though. It does simplify code. Unionall <- function(x) Reduce('union', x) leaveout <- Unionall(leaves) On Tue, Jun 1, 2010 at 9:53 PM, Remko Duursma wrote: > Dear R-helpers, > > thanks for yesterday's speeding-up tip. Here is my next query

[R] rgl problem on Fedora 13

2010-06-03 Thread Håvard Rue
Just installed Fedora 13, and reinstalled the lastest rgl package 0.91. The problem is that open3d() opens a window, but then halt. Nothing happens and I have to kill R. In the previous version of Fedora 12, everything worked fine. Any tests etc I should/could do? Best, H -- Håvard Rue Depa

Re: [R] compare results of glms

2010-06-03 Thread Joris Meys
Mailing this twice ain't going to help you. Reading a course on statistics might. The test you want to do is answering following hypothesis : The mean predicted value of a specific model differs when different datasets are used to fit it. Seems likely to me if the datasets are not almost identical

Re: [R] gam error

2010-06-03 Thread Gavin Simpson
On Thu, 2010-06-03 at 04:24 -0700, natalieh wrote: > Hi all, > > I'm trying to use a gam (mgcv package) to analyse some data with a roughly U > shaped curve. My model is very simple with just one explanatory variable: > > m1<-gam(CoT~s(incline)) > > However I just keep getting the error message

[R] Comparing a 4-point and 5-point Likert scale

2010-06-03 Thread Simon Kiss
Help with survey data: Hello R colleagues, I hope this is an appropriate place to direct this question. It relates specifically to the comparability of a 5-point likert to a 4- point likert scale. One question in my dataset asks "How much should be done to reduce the gap between rich and p

[R] deduplication

2010-06-03 Thread Epi-schnier
Colleagues, I am trying to de-duplicate a large (long) database (approx 1mil records) of diagnostic tests. Individuals in the database can have up-to 25 observations, but most will have only one. IDs for de-duplication (names, sex, lab number...) are patchy. In a first step, I am using Andreas B

[R] function

2010-06-03 Thread n.via...@libero.it
Dear list, I would like to ask you a question. I'm trying to build the time series' production with the Divisia index. The final step would require to do the following calculations: a)PROD(2006)=PROD(2007)/[1+DELTA_PROD(2007)/100] b)PROD(2005)=PROD(2006)/[1+DELTA_PROD(2006)/100] c)PROD(2004)=P

Re: [R] ordinal variables

2010-06-03 Thread Joris Meys
see ?factor and ?as.factor. On ordered factors you can technically do a spearman without problem, apart from the fact that a spearman test by definition cannot give exact p-values with ties present. x <- sample(c("a","b","c","d","e"),100,replace=T) y <- sample(c("a","b","c","d","e"),100,replace=T)

[R] General-purpose GPU computing in statistics (using R)

2010-06-03 Thread Ravi Varadhan
Hi All, I have been reading about general purpose GPU (graphical processing units) computing for computational statistics. I know very little about this, but I read that GPUs currently cannot handle double-precision floating points and also that they are not necessarily IEEE compliant. Howeve

Re: [R] ordinal variables

2010-06-03 Thread Iasonas Lamprianou
Thank you Joris, I'll have a look into the commands you sent me. They look convincing. I hope my students will also see them in a positive way (although I can force them to pretend that they have a positive attitude)! Dr. Iasonas Lamprianou Assistant Professor (Educational Research and Eval

Re: [R] Seeking help on Vectorize()

2010-06-03 Thread Duncan Murdoch
Megh Dal wrote: Dear falks, here I have written following function : fn <- Vectorize(function(x = 1:3, y = 3:6) { x <- matrix(x, nrow=1) y <- matrix(y, ncol=1) dat <- apply(x, 2, function(xx) { apply(y, 1, function(yy) {

[R] Tukey HSD

2010-06-03 Thread Claire Berger
Hello, I am a little out of date and am still using S-Plus instead of R. I haven't been able to find the right place to ask this question, so I thought I would ask it here and hope that someone can help. I am unable to located the TukeyHSD() function in S-Plus. I have been able to use the GU

[R] Creating dummy variables

2010-06-03 Thread Arantzazu Blanco Bernardeau
Hello R project I am a R beginner trying to create a dummy variable to clasificate soil types. So, I have a column in my database called codtipo (typecode in english) where soil type is coded as 1.1 to 1.4 arenosol (I have 4 types) 2.1 to 2.3 calcisols 4.1 to 4.4 fluvisols and so on To make dum

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread vaneet
Thanks for your replies. I understand you think the best solution is to find the gfortran and possibly libgfortran packages from the version of my Linux and gcc distribution which according to a quick check is the following (also this is a 64 bit linux machine): gcc (GCC) 4.1.2 20080704 (Red Hat

[R] Exporting a list of data frames

2010-06-03 Thread Christoph Scherber
Dear R helpers, Suppose I have a list of data frames. How can I export them (e.g. as a text file) without losing the columns of the individual data.frames? Example: data(Orange) mylist=list(Orange1=Orange,Orange2=Orange,Orange3=Orange) I would like to use something like write(mylist,"mylist.t

[R] moving average on irregular time series

2010-06-03 Thread Gustaf Rydevik
Hi all, I wonder if there is any way to calculate a moving average on an irregular time series, or use the rollapply function in zoo? I have a set of dates where I want to check if there has been an event 14 days prior to each time point in order to mark these timepoints for removal, and can't fi

Re: [R] rgl problem on Fedora 13

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 8:00 AM, Håvard Rue wrote: > Just installed Fedora 13, and reinstalled the lastest rgl package 0.91. > The problem is that open3d() opens a window, but then halt. Nothing > happens and I have to kill R. > In the previous version of Fedora 12, everything worked fine. > > Any te

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread vaneet
P.S. My linux machine has the following info: Red Hat Enterprise Linux Server release 5.5 (Tikanga) -- View this message in context: http://r.789695.n4.nabble.com/R-linux-install-FORTRAN-compiling-error-tp2240821p2241770.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Tukey HSD

2010-06-03 Thread RICHARD M. HEIBERGER
Tukey's pairwise comparisons test is included in the multicomp package. Also, see the MMC function in the HH package, available from CSAN. Rich [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] ordinal variables

2010-06-03 Thread S Ellison
If you set them a problem that has them doing the same sort of thing five times and compare the time it takes with code pasted from an editor (eg Tinn-R) and the time it takes via menius, you may have more luck convincing them. A command line sequence is harder than menus the first two times but e

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 9:17 AM, vaneet wrote: > > Thanks for your replies. > > I understand you think the best solution is to find the gfortran and > possibly libgfortran packages from the version of my Linux and gcc > distribution which according to a quick check is the following (also this is > a

Re: [R] gam error

2010-06-03 Thread Jannis
How many datapoints do you have? The spline smoothers assume a default of 10 degrees of freedom (i think), so If you have less datapoints than 10 I would guess that you get this error. Same would be true if you have >10 datapoints but many replicates of CoT~incline combinations. Either reduce t

Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: "the global deviance is increasing"

2010-06-03 Thread Joris Meys
On Thu, Jun 3, 2010 at 9:27 AM, Gavin Simpson wrote: > > vegan is probably not too useful here as the response is univariate; > counts of ducks. > If we assume that only one species is counted and of interest for the whole research. I (probably wrongly) assumed that data for multiple species was

[R] Bug with ESS? R freezes after cat()

2010-06-03 Thread Jannis
Dears, I am tumbling over something that appears to me as a bug. If I run the following code using ESS in one block (CTRL+C CTRL+R), R (or ESS) just freezes. Running the same line by line does not cause the error. Running the same from the R Gui either in steps or in a block does not produce t

Re: [R] Creating dummy variables

2010-06-03 Thread Jannis
Was that the original code that you ran? As there appear to be several mistakes in the code: 1. In the gipsisoil stuff, there is a ')' too much 2. In the gambisoil stuff both > signs point in the same direction, you probably want one > and one < My general suggestion would be to skip the loops

Re: [R] Exporting a list of data frames

2010-06-03 Thread Christoph Scherber
Dear all, I found one possible solution using a single call to write.table: # assuming that mylist is a named list of data.frames: data(Orange) mylist=list(Orange1=Orange,Orange2=Orange,Orange3=Orange) sapply(1:length(mylist), function(x){ write.table(

Re: [R] Bug with ESS? R freezes after cat()

2010-06-03 Thread RICHARD M. HEIBERGER
I will guess that your use of cat without a line end leaves ESS waiting for a prompt. cat("b", "\n") would be the way to avoid that. The way to unfreeze ESS (and emacs more generally) is Ctrl-g Please put followup ESS questions on the ESS list ess-h...@stat.math.ethz.ch Rich [[alter

Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: "the global deviance is increasing"

2010-06-03 Thread Gavin Simpson
On Thu, 2010-06-03 at 17:00 +0200, Joris Meys wrote: > On Thu, Jun 3, 2010 at 9:27 AM, Gavin Simpson wrote: > > > > > vegan is probably not too useful here as the response is univariate; > > counts of ducks. > > > > If we assume that only one species is counted and of interest for the whole > res

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread vaneet
I tried downloading the pre-built binaries of R from this website and then installing the rpms but is seems they depend on so many other packages to be installed first. I tried simply the R package first: warning: R-2.11.0-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6 error:

[R] import text file into R

2010-06-03 Thread dhanush
can anyone tell me how to import a text file in R? the text file I want to import is a large file, about 800MB in size. Thanks in advance. I tried using the following data<-read.table("file",header=T,sep="\t") -- View this message in context: http://r.789695.n4.nabble.com/import-text-file-in

Re: [R] gam error

2010-06-03 Thread natalieh
Data? The data are measures of energy use (continuous variable) for running on 7 inclines between -90 and +90 degrees (n=7-21). -- View this message in context: http://r.789695.n4.nabble.com/gam-error-tp2241518p2241608.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread vaneet
Also would I need to install the R package as root in order for all users to use it? I'm assuming I would have to, I don't have root access now but I could possibly obtain it. For now this is simply a test install so if there is a way to install the R package simply under my user name please let

Re: [R] Overlay of barchart and xyplot

2010-06-03 Thread Chen, Huapeng FOR:EX
Hello, I am new to R. I am trying to use “DoubleYScale” to overlay one barchart with a xyplot with two lines. I have two problems. One is that I could not figure out how to custom line (point and line) with “par.settings” and seems to me that whatever “par.settings” I used to custom the barcha

Re: [R] import text file into R

2010-06-03 Thread Sarah Goslee
That sounds like a good plan. What went wrong? You're more likely to get an answer if you tell us what your problem/question actually is. Sarah On Thu, Jun 3, 2010 at 7:32 AM, dhanush wrote: > > can anyone tell me how to import a text file in R? the text file I want to > import is a large file

[R] plot polar coordinates

2010-06-03 Thread Thomas Steiner
Hi, I'd like to plot in in polar coordinates a line which is given as a vector of lengths and angles. library("plotrix") polar.plot(length=c(1,-13,3,-1),polar.pos=c(20,20,45,55),rp.type="p",line.col="red",lwd=3,clockwise=TRUE,label.pos=seq(30,360,by=30),labels=c("ESE","SSE","S","SSW","WSW","W","WN

[R] For Loop help needed

2010-06-03 Thread Geeti Khan
Hi, I have a dataset with three column like this x1 x2 Count 1 0 523 1 0 23 0 0 2 0 1 45 0 0 3 1 1 433 I need to create a loop so that when c(x1,x2)=c(1,1), I can add the corresponding Counts.When c(x1,x2)=c(1,0), can add the corresponding counts and so on. Can anyone help me

Re: [R] import text file into R

2010-06-03 Thread Erik Iverson
dhanush wrote: can anyone tell me how to import a text file in R? the text file I want to import is a large file, about 800MB in size. Thanks in advance. I tried using the following data<-read.table("file",header=T,sep="\t") And what happened?? Your specification is incomplete, as we don

Re: [R] function

2010-06-03 Thread Joris Meys
That's a bit more clear. > Prod2007=2 > Delta=c(4,3,5) > Delta <- 1+Delta/100 > Series <- Prod2007+cumsum(Delta) > Series [1] 3.04 4.07 5.12 On Thu, Jun 3, 2010 at 1:21 PM, n.via...@libero.it wrote: > What I would like to do is for example: > Suppose that I have the following value > > a)PROD(

[R] Question about avoid the for loop

2010-06-03 Thread Carrie Li
Dear R-helpers, I would like to generate a binary random variable within a stratum's stratum. Here is a simple example. ## x is the first level strata index, here I have 3 strata. x=c(rep(1,5), rep(2,5), rep(3,5)) ## within x, there is a second strata indexed by t=0 and t=1 t=rep(c(0,0,1,1,1),3

[R] (no subject)

2010-06-03 Thread Rosario Garcia Gil
Dear R users, I am trying to draw error bars in a bar plot, I use this code (tried many others which did not work): install.packages() library(gplots) y <-c(39.02, 46.42) se <- c(7.57,7.35) plot <- barplot(y, beside=TRUE, col=0, ylim=c(0,47), axis.lty=1, main="far-red", xlab="latitude", names.a

[R] cumsum function with data frame

2010-06-03 Thread n.via...@libero.it
Dear list, I have a problem with the cumsum function. I have a data frame like the following one variableYear value EC01 2005 5 EC01 2006 10 AAO12005 2 AAO1 2006 4 what I would like to obtain is varia

Re: [R] Exporting a list of data frames

2010-06-03 Thread Allan Engelhardt
On 03/06/10 15:24, Christoph Scherber wrote: Dear R helpers, Suppose I have a list of data frames. How can I export them (e.g. as a text file) without losing the columns of the individual data.frames? save(mylist, file="/tmp/foo.RData") But somehow I cannot get the information contained

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 10:38 AM, vaneet wrote: > > I tried downloading the pre-built binaries of R from this website and then > installing the rpms but is seems they depend on so many other packages to be > installed first. I tried simply the R package first: > > warning: R-2.11.0-1.el5.x86_64.rpm:

Re: [R] Shell command help

2010-06-03 Thread Uwe Ligges
On 03.06.2010 04:19, galen kaufman wrote: Uwe, Thank you so much for the response. I tried running the command in the format you suggested but still could not get the shell command to execute. The following is the command that I used per your suggestion and the subsequent error message.

Re: [R] General-purpose GPU computing in statistics (using R)

2010-06-03 Thread Allan Engelhardt
You may be interested in the "gputools" package and associated web site which discusses some of your questions in the second paragraph. Hope this helps a little. Allan On 03/06/10 14:43, Ravi Varadhan wrote: Hi All, I have been reading about general purpose GPU (graphical processing units)

Re: [R] problem with 'svyby' function from SURVEY package

2010-06-03 Thread Thomas Lumley
On Thu, 3 Jun 2010, Roni Kobrosly wrote: Hello, I'm using a complex survey dataset and my goal is to simply spit out a bunch of probability-weighted outcome variable means for the different levels of covariate. So I first define the structure of the study design (I'm using the CDC's NHANES d

Re: [R] gam error

2010-06-03 Thread Joris Meys
This doesn't tell us much either. What does the variable "incline" represent, and what does the variable "ToC" represent? I could guess your data looks something like : ToC Incline x1-90 x2-60 x3-30 x4 0 x5 30 x6 60 x7 90 x8 -90 ... ... Or incline could be the

Re: [R] (no subject)

2010-06-03 Thread Sarah Goslee
I don't have any idea where you came up with superpose.ep - rseek.org doesn't return any results for a function of that name. If you check the package information for gplots you'll see that plotCI() is available to plot error bars. There's also the errbar() function from hmisc, and probably sever

Re: [R] Shell command help

2010-06-03 Thread Uwe Ligges
On 03.06.2010 06:40, RICHARD M. HEIBERGER wrote: #Error that is returned from above code….. 'C:\Program' is not recognized as an internal or external command, operable program or This statement means that the Windows CMD processor does not realize that 'C:\Program Files' is a single word.

Re: [R] Draw text with a box surround in plot.

2010-06-03 Thread Bert Gunter
?legend perhaps. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Ehlers Sent: Wednesday, June 02, 2010 4:14 PM To: g...@ucalgary.ca Cc: r-help@r-project.org Subject: Re: [R

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread Bert Gunter
Below. -- Bert Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Joris Meys Sent: Thursday, June 03, 2010 5:20 AM To: zhu yao Cc: R-help Subject: Re: [R] Continous variables with imp

Re: [R] rgl problem on Fedora 13

2010-06-03 Thread Allan Engelhardt
You could try stepping through the open3d function to see where it hangs: I assume in rgl.open()? You should probably also remove all installed packages and re-install and re-compile them. On 03/06/10 14:00, HÃ¥vard Rue wrote: > Just installed Fedora 13, and reinstalled the lastest rgl package

Re: [R] For Loop help needed

2010-06-03 Thread Allan Engelhardt
One option: t <- data.frame(x1=c(1,1,0,0,0,1), x2=c(0,0,0,1,0,1), Count=c(523,23,2,45,3,433)) t.sum <- function(df, x1, x2) sum(df[df$x1==x1 & df$x2==x2,]$Count) t.sum(t, 1, 0) # [1] 546 t.sum(t, 0, 0) # [1] 5 Hope this helps a little. Allan On 03/06/10 16:18, Geeti Khan wrote: Hi, I have a

Re: [R] Question about avoid the for loop

2010-06-03 Thread Jorge Ivan Velez
Hi Carrie, Here are two options: # Option 1 d <- data.frame(x, t) y <- with(d, ifelse(t == 0, rbinom(2, 1, 0.2), rbinom(3, 1, 0.8))) y # Option 2 -- more general case, e.g. you do not know # how many 0's and 1's you have within each strata spd <- with(d, split(d, x)) do.call(c, lapply(spd, fun

Re: [R] Comparing a 4-point and 5-point Likert scale

2010-06-03 Thread Joshua Wiley
Dear Simon, These two questions already are comparable (using a strict sense of that word). What is your goal in trying to put them both on the same scale? Even if both were measured 1-5, it would be unreasonable to say that a 3 on one question meant the same as a 3 on the other question because

Re: [R] For Loop help needed

2010-06-03 Thread Jorge Ivan Velez
Hi Geeti, If d is your data.frame, the following is an option: as.data.frame.table(with(d, tapply(Count, list(x1, x2), sum))) HTH, Jorge On Thu, Jun 3, 2010 at 11:18 AM, Geeti Khan <> wrote: > Hi, > I have a dataset with three column like this > x1 x2 Count > 1 0 523 > 1 0 23 > 0 0 2 > 0 1

Re: [R] (no subject)

2010-06-03 Thread Jorge Ivan Velez
Hi Rosario, It saying that because you could have not loaded that function in your R session. It availbale at [1]. Go there, copy and paste it in your session. You should be ready to go after doing this. HTH, Jorge [1] http://egret.psychol.cam.ac.uk/statistics/R/graphs1.html On Thu, Jun 3, 201

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread Joris Meys
You're right, it is the same. using I() won't work for the same reason sqrt don't, so : > x2 <- x^2 > lrm(y~x+x2) Thx for the correction. Cheers Joris On Thu, Jun 3, 2010 at 6:14 PM, Bert Gunter wrote: > Below. -- Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > ---

Re: [R] (no subject)

2010-06-03 Thread John Kane
It looks like superpose.eb is someone's function and not in a package. https://stat.ethz.ch/pipermail/r-help/2002-November/027299.html --- On Thu, 6/3/10, Rosario Garcia Gil wrote: > From: Rosario Garcia Gil > Subject: [R] (no subject) > To: "r-help@r-project.org" > Received: Thursday, June 3

Re: [R] deduplication

2010-06-03 Thread Allan Engelhardt
Maybe something like the following will get you started: library("igraph") g <- graph.data.frame(id, directed=FALSE) neighborhood(g, +Inf) There is perhaps a more efficient way, but I hope this helps a little. Allan. On 03/06/10 14:14, Epi-schnier wrote: Colleagues, I am trying to de-dupli

Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: "the global deviance is increasing"

2010-06-03 Thread Joris Meys
See below. On Thu, Jun 3, 2010 at 5:35 PM, Gavin Simpson wrote: > On Thu, 2010-06-03 at 17:00 +0200, Joris Meys wrote: > > On Thu, Jun 3, 2010 at 9:27 AM, Gavin Simpson >wrote: > > > > > > > > vegan is probably not too useful here as the response is univariate; > > > counts of ducks. > > > > > >

Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: "the global deviance is increasing"

2010-06-03 Thread Joris Meys
Correction : That should give some clarity on the question whether it is the optimization of GAMLSS that goes wrong, or whether the problem is inherent to the data. On Thu, Jun 3, 2010 at 7:00 PM, Joris Meys wrote: > See below. > > On Thu, Jun 3, 2010 at 5:35 PM, Gavin Simpson wrote: > >> On Thu

Re: [R] rgl problem on Fedora 13

2010-06-03 Thread Håvard Rue
Thanks for suggestions. I installed from Fedora repos as `GL' related libraries, and restarted, and then restarted. The it worked perfect again. Weird behaviour considering I did a clean install, and no complains when compiling 'rgl'. I cannot explain it. Thanks! best, H On Thu, 2010-06-03 a

Re: [R] Creating dummy variables

2010-06-03 Thread Arantzazu Blanco Bernardeau
hey thanks I did solve it already, it had more mistakes as you see :S bye Arantzazu Blanco Bernardeau Dpto de Química Agrícola, Geología y Edafología Universidad de Murcia-Campus de Espinardo > Date: Thu, 3 Jun 2010 14:40:30 + > From: bt_jan...@yahoo.de > Subject: AW: [R] Creating du

Re: [R] import text file into R

2010-06-03 Thread John Kane
What does the text look like? --- On Thu, 6/3/10, dhanush wrote: > From: dhanush > Subject: [R] import text file into R > To: r-help@r-project.org > Received: Thursday, June 3, 2010, 7:32 AM > > can anyone tell me how to import a text file in R? the text > file I want to > import is a large

[R] selecting the most recent files

2010-06-03 Thread Albert-Jan Roskam
Hi, I am writing a program that returns the a vector of the most recent R files in a given dir. The files are named like "f1.R", "f2.R", and sometimes "f3a.R". I want to use the resulting vector to easily source() all the most recent file versions of a given dir. Here's what I've cooked up till

Re: [R] Creating dummy variables

2010-06-03 Thread Bert Gunter
Do **NOT** use dummy variables in R. R's modeling functions takes care of this themselves using factors. You say you are a beginner. OK, so begin **properly** -- by reading An Introduction to R. Chapter 11 on Statistical Models in R was written precisely to help people like you learn what to do and

[R] split a row into multiple columns

2010-06-03 Thread Kevin Burnham
Would somebody please help me break this row: "Main Group\t1000\tMP Test\tMP Test, 1\tAudio (1, f1-qaddara.aiff)\tl (target is right word)\tl\tPressed\tl (target is right word)\tC\t3111\t\t\t\t\t" into multiple columns along the \t separator? When I try the strsplit (x,"\t") command I get: [[1]

Re: [R] plot polar coordinates

2010-06-03 Thread Greg Snow
It looks like polar.plot does not handle negative lengths, you can preprocess the data and just add 180 degrees to the angles corresponding to negative lengths and then use their absolute values. The radial.lim is not ignored, based on the documentation the range is then made pretty (and 100 is

Re: [R] cumsum function with data frame

2010-06-03 Thread Joris Meys
See ?split and ?unsplit. Data <- read.table(textConnection("variableYear value EC01 2005 5 EC01 2006 10 AAO12005 2 AAO1 2006 4"),header=T) Datalist <-split(Data,Data$variable) resultlist <- lapply(Datali

Re: [R] Use apply only on non-missing values

2010-06-03 Thread Doran, Harold
Actually, this is clever. I modified your advice and vectorized this as: 1/ (1 + exp(b_vector - t(matrix(theta, nrow= nrow(dat) , ncol= ncol(dat) Instead of using the apply() function as I did before. In terms of speed, this new solution is immensely faster, as you also noted. Now, whether

[R] R linux install: FORTRAN compiling error

2010-06-03 Thread R P Herrold
On Thu, 3 Jun 2010, vaneet wrote: Is there any way I can get an RPM that has all the necessary packages built in to install and run R? Or do I have to find all these packages that are needed to install these 'R' rpms for which many are not found on the FedoraProject website (libgfortran, gcc-for

Re: [R] Deleting duplicate rows in a matrix at random

2010-06-03 Thread Magnus Torfason
> I need to remove all but one of each [row in a matrix], which > must be chosen at random. This request (included in full at the bottom), has been unanswered for a while, but I had the same problem and ended up writing a function to solve it. I call it "duplicated.random()" and it does exactly

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread Frank E Harrell Jr
On 06/03/2010 11:32 AM, Joris Meys wrote: You're right, it is the same. using I() won't work for the same reason sqrt don't, so : x2<- x^2 lrm(y~x+x2) Thx for the correction. Cheers Joris On Thu, Jun 3, 2010 at 6:14 PM, Bert Gunter wrote: Below. -- Bert Bert Gunter Genentech Nonclinical

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
You can also use ddply from the plyr package: library(plyr) Data <- read.table(textConnection("variable    Year  value EC01    2005    5 EC01    2006    10 AAO1    2005  2 AAO1  2006  4"),header=T) Data ddply(Data,.(variable),summaris

  1   2   >