Re: [R] Date_Time detected as Duplicated (but they are not!)

2011-05-17 Thread Michael Sumner
See under "Note" in ?strptime: Remember that in most timezones some times do not occur and some occur twice because of transitions to/from summer time. ‘strptime’ does not validate such times (it does not assume a specific timezone), but conversion by ‘as.POSIXct’) will d

[R] Date_Time detected as Duplicated (but they are not!)

2011-05-17 Thread Agustin Lobo
I have a problem with duplicated date_time stamps that I do not see as duplicated. I read a file with observations taken every 30 minutes: > aur2009=read.csv(paste(datadir,"AUR_ECPP_2009.csv",sep="/"),sep=";",stringsAsFactors=F) > aur2009[1:3,1:5] Date.Time E_filled E_filled_flag LE_filled

[R] text mining analysis and word visualization of pdfs

2011-05-17 Thread Ajay Ohri
Dear Lists, What is the appropriate software package for dumping say 20 PDFS in a folder, then creating data visualization with frequency counts of certain words as well as measure correlation within each file for certain key relationships or key words. I am doing text analysis of biases in enter

[R] How to make array of regression objects

2011-05-17 Thread Dmitrij Kudriavcev
Dear all, I have made couple logistic regressions, what making a distribution of some event. Currently, i store it like this: o1 <- lrm(...) o2 <- lrm(...) o3 <- lrm(...) ... Then, i have made a function to peak required regression object from this variables by it number: get_object <- functio

[R] scatter plot: multiple Y variables and error bars

2011-05-17 Thread B77S
#Hi all, #Using the example data that follows, can someone please show me how to get a scatterplot of points with #error bars in the Y direction. something like this works for one Y: xYplot(Cbind(y1, l1, u1) ~x1, data=y) #but this: xYplot(Cbind(y1, l1, u1) + Cbind(y2, l2, u2)~x1, data=y) #

[R] Constrainted Nonlinear Optimization - lack of convergence

2011-05-17 Thread mcgrete
Hello, I am attempting to utilize the 'alabama' package to solve a constrained nonlinear optimization problem. The problem has both equality and inequality constraints (heq and hin functions are used). All constraints are smooth, i.e. I can differentiate easily to produce heq.jac and hin.jac fun

[R] PAM Clustering Ignores Cluster Number Parameter

2011-05-17 Thread Dario Strbenac
I am using PAM with k = 10 clusters, but I only get one cluster ID for all my observations. I couldn't find any discussion about this in the help file, or mailing lists. Is there a reasonable explanation for this result ? cIDs <- pam(all, 10, cluster.only = TRUE, do.swap = FALSE) > table(cIDs)

Re: [R] Multiple plots on one device using stl

2011-05-17 Thread Ben Madin
G'day Bill, On 18/05/2011, at 10:36 AM, wrote: > If you > > ?plot.stl > > you will see that that the second argument, set.pars, is a list of argument > settings for par(), including a (variable) default setting for mfrow. I.e. > plot.stl overrides your external setting (which will also ove

Re: [R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2011-05-17 Thread Frank Harrell
I converted code using the Design package to be what rms expects but hadn't bothered to re-run the code. For the first note you sent, you can attach(counties) (or better: use with(counties) inside the show.pts function. But I'm getting a warning I'll need to track down before it works 100%: Warn

Re: [R] Multiple plots on one device using stl

2011-05-17 Thread Bill.Venables
If you ?plot.stl you will see that that the second argument, set.pars, is a list of argument settings for par(), including a (variable) default setting for mfrow. I.e. plot.stl overrides your external setting (which will also override any layout() setting). It looks like to override it ba

[R] Simple MC integration question

2011-05-17 Thread Kehl Dániel
Dear Community, I try to compute the variance of a MC integral where I know the analytical solution. The function is exp(-x) integrated on the interval (2,4). (Rizzo example) The true value is exp(-2)-exp(-4)~.1170196 I have the following short code: iter <- 1 MCs <- numeric(iter) n <- 50

[R] Multiple plots on one device using stl

2011-05-17 Thread Ben Madin
G'day, I am looking at monthly reports, and have three series of monthly data from 2007 to 2009. I would like to show the season decomposition of these two series side by side on the one device, however using plot doesn't seem to respect any use of layout(matrix(1:3, ncol=3)) or par(mfcol=c(1,3

Re: [R] simprof test using jaccard distance

2011-05-17 Thread Bill.Venables
The documentation for simprof says, with respect to the method.distance argument, "This value can also be any function which returns a "dist" object." So you should be able to use the Jaccard index by setting up your own function to compute it. e.g. Jaccard <- function(X) vegan::vegdist(X, me

Re: [R] hierarchical gamma model in lme4

2011-05-17 Thread Benjamin Caldwell
Addendum: I tried a gamma fit in glmmPQL and got the same errors. *Ben Caldwell* PhD Candidate University of California, Berkeley On Tue, May 17, 2011 at 3:51 PM, Benjamin Caldwell wrote: > Hello > After seeing this ( > https://stat.ethz.ch/pipermail/r-sig-mixed-models/2011q1/005213.html) ema

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Bill.Venables
PS I should have followed the example with one using with() for something that would often be done with attach(): Consider: with(polyData, { plot(x, y, pch=".") o <- order(x) lines(x[o], eta[o], col = "red") }) I use this kind of dodge a lot, too, but now you can mostly use data= argument

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Lara Poplarski
Thank you all, this is exactly what I had in mind, except that I still have to get my head around apply et al. Back to the books for me then! Lara On Tue, May 17, 2011 at 2:41 PM, Jannis wrote: > Have a look at lapply(). Something like: > > entries.with.nrows=lapply(data,function(x)dim(x)[1]>1)

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Bill.Venables
Amen to all of that, Bert. Nicely put. The google style guide (not perfect, but a thoughtful contribution on these kinds of issues, has avoiding attach() as its very first line. See http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html) I would add, though, that not enough pe

Re: [R] gsub() issue...

2011-05-17 Thread Andrew Robinson
Hi Charles, It's not clear to me what you mean by "doesn't work". > test <- "Interesting 1\nPoint\n" > cat(test) Interesting 1 Point > test1 <- gsub("ing 1\nP","ing 3\nP", test) > cat(test1) Interesting 3 Point > Cheers Andrew On Tue, May 17, 2011 at 10:45:31AM +0200, Thibault Charles wrote:

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread David Winsemius
On May 17, 2011, at 6:00 PM, Alaios wrote: and what about the cdf of function? Did you read the help page for dnorm? -- David. Regards Alex --- On Tue, 5/17/11, Downey, Patrick wrote: From: Downey, Patrick Subject: RE: [R] pdf (probability distribution function) and cdf To: "Alaios"

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
and what about the cdf of function? Regards Alex --- On Tue, 5/17/11, Downey, Patrick wrote: > From: Downey, Patrick > Subject: RE: [R] pdf (probability distribution function) and cdf > To: "Alaios" , "Jonathan Daily" > Cc: R-help@r-project.org > Date: Tuesday, May 17, 2011, 6:17 PM > ?dnorm

Re: [R] reshaping issue

2011-05-17 Thread Dennis Murphy
Hi: Here's one way, using an abbreviated example: du <- data.frame(v1 = factor(rep(1:10, each = 4)), v2 = factor(rep(rep(1:2, each = 2), 10)), v3 = factor(rep(1:2, 20)), x1 = rnorm(40), y1 = rnorm(40), x2 = rnorm

Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-17 Thread Benjamin Caldwell
Rolf, Taking out the scalar multiples did it. Thanks for that. *Ben Caldwell* PhD Candidate University of California, Berkeley On Sun, May 15, 2011 at 10:30 PM, Rolf Turner wrote: > > In your example it appears that you are plotting a histogram (on the > frequency > scale) and then superim

Re: [R] Aware of MaxDiff in R?

2011-05-17 Thread VikR
Bumping this thread in order to see if there's any new info on this. :) I'm interested in doing MaxDiff Scaling. Will Maximum Likelihood Difference Scaling give me the same results as MaxDiff Scaling? I found a paper, Discrete-Choice Logit Models with R, by Philip A. Viton. It discusses using

Re: [R] Summarize by two or more attributes

2011-05-17 Thread ROLL Josh F
I will take a look. In my real data I need to interpolate the 16 points into 64 points for each of the categories. Thanks Marc JR -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Tuesday, May 17, 2011 1:09 PM To: ROLL Josh F Cc: r-help@r-project.org Subjec

[R] Email out of R (code)

2011-05-17 Thread Daniel Malter
Hi all, I thought I would post code to send an email out of R. The code uses Grothendieck and Bellosta's interface package rJython for executing Python from R. The code itself provides basic email functionality for email servers requiring authentication. It should be easy to extend it (e.g., for

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Jannis
Have a look at lapply(). Something like: entries.with.nrows=lapply(data,function(x)dim(x)[1]>1) should give you a vector with the elements of the list that you seek marked with TRUE. This vector can then be used to extract a subset from your list by: data.reduced=data[entries.with.nrows] Or s

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Rolf Turner
On 18/05/11 08:24, Lara Poplarski wrote: Hello All, I have a list of dataframes, and I need to subset it by keeping only those dataframes in the list that meet a certain criterion. Specifically, I need to generate a second list which only includes those dataframes whose number of rows is> 1. C

Re: [R] subsetting a list of dataframes

2011-05-17 Thread William Dunlap
shouldKeep <- sapply(listOfDataFrames, function(df)nrow(df)>1) listOfDataFrames[shouldKeep] or, compressed to get rid of the intermediate variable listOfDataFrames[sapply(listOfDataFrames, function(df)nrow(df)>1)] If you are writing production code and there is any chance that listOfDataFra

Re: [R] subsetting a list of dataframes

2011-05-17 Thread Jorge Ivan Velez
Hi Lara, You might try the following (untested): yourlistofdataframes[sapply(yourlistofdataframes, function(d) nrow(d) > 1)] HTH, Jorge On Tue, May 17, 2011 at 4:24 PM, Lara Poplarski <> wrote: > Hello All, > > I have a list of dataframes, and I need to subset it by keeping only those > dataf

Re: [R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2011-05-17 Thread John Smith
Also I can not reproduce figure 7.11 by f <- Newlabels(f, list(turnout='voter turnout (%)')) windows() nomogram(f, interact=list(income=incomes), turnout=seq(30,100,by=10), lplabel='estimated % voting Democratic', cex.var=.8, cex.axis=.75) On Tue, May 17, 2011 at 4:04 PM, John Smith w

[R] subsetting a list of dataframes

2011-05-17 Thread Lara Poplarski
Hello All, I have a list of dataframes, and I need to subset it by keeping only those dataframes in the list that meet a certain criterion. Specifically, I need to generate a second list which only includes those dataframes whose number of rows is > 1. Could someone suggest how to do this? I have

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Dennis Murphy
Hi: I'm assuming this is a snippet of a much larger data set, because one certainly would not use box plots on singleton observations. You have four grouping variables in your example, so the best you could likely do on one graphics page would be to, for example, plot time vs. distance, 'dodged' b

Re: [R] Using a sting in variable names

2011-05-17 Thread Ken
olafgy gmail.com> writes: > > Hi there, > > I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 > .dat" > into a respective table calld vpn1 to vpn100. > > I therfore have created a variable X<-1:100 > > I not want to use X as a subtitute for the number in my filename,

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 2:55 PM, ROLL Josh F wrote: > Marc, > How could I also apply the spline function to each of the 'columns' found in > the result from > > tapply(Df$Rate,list(Df$Bin,Df$Type),sum) > > ?? Something along the lines of the following: apply(tapply(Df$Rate,list(Df$Bin,Df$

[R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2011-05-17 Thread John Smith
Dear R-users, I am using R 2.13.0 and rms 3.3-0 , but can not reproduce figure 7.8 of the handouts *Regression Modeling Strategies* ( http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf) by the following code. Could any one help me figure out how to solve this? setwd('C:/Rharrell') re

Re: [R] Summarize by two or more attributes

2011-05-17 Thread ROLL Josh F
Marc, How could I also apply the spline function to each of the 'columns' found in the result from tapply(Df$Rate,list(Df$Bin,Df$Type),sum) ?? -Original Message- From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Tuesday, May 17, 2011 12:42 PM To: ROLL Josh F Cc: r-help@r

Re: [R] submit R package

2011-05-17 Thread Uwe Ligges
On 17.05.2011 19:17, Sebastian Gibb wrote: Hello Yan, please use an empty password and write an e-mail to c...@r-project.org afterwards. Bye, Sebastian Dear all, I'm just wondering how to submit a package to cran? I followed the instruction, using anonymous as username and my email addr

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 12:53 PM, LCOG1 wrote: > I will hit my own ball on this one > > > tapply(Df$Rate,list(Df$Bin,Df$Type),sum) > Ahayou had mentioned creating a new column in your initial post, presumably added to 'Df', as opposed to creating a new independent matrix of the results. You

Re: [R] issue with odfWeave running on Windows XP; question about installing packages under Linux

2011-05-17 Thread rmailbox
I also have a problem using odfWeave on Windows XP with R > R2.11.1. odfWeave fails, giving mysterious error messages. (Not quite the same as yours, but similar. I sent the info to Max Kuhn privately, but did not get a response after two tries.) My odfWeave reporting system worked fine prior to

Re: [R] adding up elements within a list

2011-05-17 Thread Martin Hughes
Brilliant! Thanks Martin Quoting Henrique Dallazuanna : Try this: sapply(intvl.period.myrs, sum) On Tue, May 17, 2011 at 1:13 PM, Martin Hughes wrote: Dear R users I have a list, as follows: intvl.period.myrs $Devonian [1] 4.8 4.2 9.5 5.7 $Ordovician [1]  7.2  5.1 10.2  1.9 $Silu

Re: [R] Summarize by two or more attributes

2011-05-17 Thread LCOG1
I will hit my own ball on this one tapply(Df$Rate,list(Df$Bin,Df$Type),sum) -- View this message in context: http://r.789695.n4.nabble.com/Summarize-by-two-or-more-attributes-tp3529825p3530034.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] graphs and arrays

2011-05-17 Thread Bogdan Tanasa
Dear all, it might not be a R-related question, however, I would appreciate if anyone could suggest a mathematical/statistical framework that integrates graphs and arrays, and potentially has a R implementation. to give an example : given a graph of interactions (gene1 --- gene2, gene3 --- gene5,

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Marc Schwartz
On May 17, 2011, at 11:48 AM, LCOG1 wrote: > Okay everyone heres a likely softball for someone. > > Consider the following data frame: > > #Create data > x<-rep(c(1,15),10) > y<-rnorm(20) > z<-c(rep("auto",10),rep("bus",10)) > a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) > #Create Data frame > Df<-data.fram

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Felipe Carrillo
Like This? x<-rep(c(1,15),10) y<-rnorm(20) z<-c(rep("auto",10),rep("bus",10)) a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) #Create Data frame Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z) Df ddply(Df,c('Type','Bin'),summarise,Summed=sum(Rate))  # Adding a column to Df ddply(Df,c('Type','Bin'),mutate,Summed=s

Re: [R] reshaping issue

2011-05-17 Thread Scott Chamberlain
Can you provide a brief reproducible example for us to play with? Scott On Tuesday, May 17, 2011 at 12:31 PM, Stijn Van Daele wrote: > Dear R users, > > I have a problem with reshaping data. I know such questions have been asked > before, but I can't get it right, neither with the reshape funct

Re: [R] Summarize by two or more attributes

2011-05-17 Thread Abhijit Dasgupta
One possibility is: library(doBy) summaryBy(Rate~Source+Bin, data=Df, FUN=sum) On 5/17/2011 12:48 PM, LCOG1 wrote: > Okay everyone heres a likely softball for someone. > > Consider the following data frame: > > #Create data > x<-rep(c(1,15),10) > y<-rnorm(20) > z<-c(rep("auto",10),rep("bus",10))

Re: [R] Problem on glmer

2011-05-17 Thread Zhang,Yanwei
Hglm does the work! Thanks! Also, I find that the developing version of lme4, called lme4a, has the capability to fit Gamma models. And both lme4a and hglm produce results consistent with the published ones. Problems solved! Wayne (Yanwei) Zhang Statistical Research >CNA -Original Me

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Frank Harrell
It's worse if the model does converge because then you don't have a warning about the result being nonsense. Frank Terry Therneau-2 wrote: > > -- begin included message --- > I did realize that there are way more predictors in the model. My > initial thinking was use that as an initial model fo

Re: [R] Problem on glmer

2011-05-17 Thread Dennis Murphy
Hi: This might be helpful: http://glmm.wikidot.com/faq It has some commentary and potential workarounds re gamma GLMMs toward the bottom of the page. I might also suggest that r-sig-mixed-models might be a better forum for these types of questions; you can subscribe by going to http://www.r-pro

Re: [R] adding up elements within a list

2011-05-17 Thread Henrique Dallazuanna
Try this: sapply(intvl.period.myrs, sum) On Tue, May 17, 2011 at 1:13 PM, Martin Hughes wrote: > > > Dear R users > > I have a list, as follows: > >> intvl.period.myrs > > $Devonian > [1] 4.8 4.2 9.5 5.7 > > $Ordovician > [1]  7.2  5.1 10.2  1.9 > > $Silurian > [1] 4.7 3.0 7.8 2.0 3.3 1.6 2.6 2.

[R] reshaping issue

2011-05-17 Thread Stijn Van Daele
Dear R users, I have a problem with reshaping data. I know such questions have been asked before, but I can't get it right, neither with the reshape function nor with the melt function. My dataset has about 407 variables and about 48000 cases. Each case looks as follows: V1 v2 v3v4

[R] adding up elements within a list

2011-05-17 Thread Martin Hughes
Dear R users I have a list, as follows: intvl.period.myrs $Devonian [1] 4.8 4.2 9.5 5.7 $Ordovician [1] 7.2 5.1 10.2 1.9 $Silurian [1] 4.7 3.0 7.8 2.0 3.3 1.6 2.6 2.7 I want to write a loop that will sum up the values in each part, and give me a vector containing the (in this case 3)

[R] Summarize by two or more attributes

2011-05-17 Thread LCOG1
Okay everyone heres a likely softball for someone. Consider the following data frame: #Create data x<-rep(c(1,15),10) y<-rnorm(20) z<-c(rep("auto",10),rep("bus",10)) a<-rep(c(1,1,2,2,3,3,4,4,5,5),2) #Create Data frame Df<-data.frame(Source=x,Rate=y,Bin=a,Type=z) I want to create a new column th

[R] help with PLSR Loadings

2011-05-17 Thread Amit Patel
Hi When I call for the loadings of my plsr using the command, x <- loadings(BHPLS1) my loadings contain variable names rather than numbers. >str(x) loadings [1:94727, 1:10] -0.00113 -0.03001 -0.00059 -0.00734 -0.02969 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:94727] "PCIList1" "PCIL

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Downey, Patrick
?dnorm -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Tuesday, May 17, 2011 12:50 PM To: Jonathan Daily Cc: R-help@r-project.org Subject: Re: [R] pdf (probability distribution function) and cdf I am assuming a Gaussian

Re: [R] submit R package

2011-05-17 Thread Sebastian Gibb
Hello Yan, please use an empty password and write an e-mail to c...@r-project.org afterwards. Bye, Sebastian > Dear all, > > I'm just wondering how to submit a package to cran? > I followed the instruction, using anonymous as username and my email > address as password, but it didn't connect.

Re: [R] submit R package

2011-05-17 Thread stephen sefick
I followed the directions and all was well. Sorry I have no insight. On Tue, May 17, 2011 at 11:51 AM, Yan Jiao wrote: > Dear all, > > I'm just wondering how to submit a package to cran? > I followed the instruction, using anonymous as username and my email address > as password, but it didn't

[R] submit R package

2011-05-17 Thread Yan Jiao
Dear all, I'm just wondering how to submit a package to cran? I followed the instruction, using anonymous as username and my email address as password, but it didn't connect. Any hints? Yan [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
I am assuming a Gaussian distribution with specific mean and standard deviation --- On Tue, 5/17/11, Jonathan Daily wrote: > From: Jonathan Daily > Subject: Re: [R] pdf (probability distribution function) and cdf > To: "Alaios" > Cc: R-help@r-project.org > Date: Tuesday, May 17, 2011, 3:18 PM

[R] Help with PLSR with jack knife

2011-05-17 Thread Amit Patel
Hi I am analysing a dataset of 40 samples each with 90,000 intensity measures for various peptides. I am trying to identify the Biomarkers (i.e. most significant peptides). I beleive that PLS with jack knifing, or alternativeley CMV(cross-model-validation) are multivariateThe 40 samples belong

Re: [R] extract value from mer object ?

2011-05-17 Thread Ben Bolker
Maas James Dr (MED uea.ac.uk> writes: > > > What is the easiest way to extract a value from a 'mer' > object from glmer? The first I need is the > trtpair Std.Dev. which in this case is 0.17542? > > I've managed to get the fixed effects numbers from > summary(fednmaout)@coeffs You sho

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Downey, Patrick
I like the function Ecdf in the Hmisc package. For the pdf, you can also use plot(density(x)), which is in the stats package. ??Ecdf -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Tuesday, May 17, 2011 10:09 AM To: R

Re: [R] Problem with MLE

2011-05-17 Thread Bazman76
sorry I solved it, was a typo on my part!! -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-MLE-tp3529445p3529597.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Liviu Andronic
On Tue, May 17, 2011 at 2:15 PM, Jannis wrote: >  Otherwise I would stick to SPSS/Excel/Sigmaplot or browse for some R GUIs > with some basics beeing implemented on a "click basis" like RStudio, Rkward > or TinnR. All R GUI implementations are however limited to basic > plotting/analysis routin

Re: [R] scales argument in bwplot (lattice)

2011-05-17 Thread Peter Ehlers
On 2011-05-17 06:50, Doran, Harold wrote: Suppose I have data such as the following set.seed(12345) tmp<- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30)) tmp1<- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100)) var3 is on a different scale, but I cr

Re: [R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-17 Thread Uwe Ligges
- Reduce the model to a reasonable size with far less variables than observations. - Code factors as factors rather than numerics - don't use variables with perfect correlation to other nor any duplicates Best, Uwe Ligges On 17.05.2011 15:46, Songer, Katherine B - DNR wrote: Uwe, Thank you

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
The result is good, thanks a lot, but how can I with this method fill my raster to color? Le 17 mai 2011 à 15:43, Duncan Murdoch a écrit : > I don't think filled.contour gives you access to the contour lines. If you > use contourLines() to compute them, then you can draw them using code like

Re: [R] epi.2by2

2011-05-17 Thread pcc
Thank you! I'm a bit of a newby but this has really helped. thank you -- View this message in context: http://r.789695.n4.nabble.com/epi-2by2-tp3528814p3529025.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
I work with large datasets (1 points) so I can't post them , but my function is : create_map <- function(grd, level ,map_output, format = c("jpeg"), width_map = 150, height_map = 150,...) { ##sp <- spline(x = grd[,1], y = grd[,2]) grd2 <- matrix(grd[,

Re: [R] Smooth contour of a map

2011-05-17 Thread Pierre Bruyer
Thank you for your answer, but the function spline() (and a lot of other function in R) can't take in its parameters the original contour which are define by a vector, i.e. : ##creation of breaks for colors i<-1 paliers <- c(-1.0E300) while(i<=length(level[,1

Re: [R] Rscript hangs on exit with ubuntu 11.04

2011-05-17 Thread Mikael Högqvist
Hi Dirk, for me the following still hangs: R --vanilla -e 'library(plyr); ddply(data.frame(a=1:101,b=1:101), .(a,b), nrow)' but... when running the script via littler with "r -p bug.R" it returns. Thanks, Mikael On 17 May 2011 13:50, Dirk Eddelbuettel wrote: > > On 17 May 2011 at 12:18, Mikae

[R] Problem with MLE

2011-05-17 Thread Bazman76
Hi there, I am trying to run the following code: > dcOU<-function(x,t,x0,theta,log=FALSE){ + Ex<-theta[1]/theta[2]+(x0-theta[1]/theta[2])*exp(-theta[2]*t) + Vx<-theta[3]^2*(1-exp(-2*theta[2]*t))/(2*theta[2]) + dnorm(x,mean=Ex,sd=sqrt(Vx),log=log) + } > OU.lik<-function(theta1,theta2,theta3){ + n<

[R] Display data.frame as tree?

2011-05-17 Thread Fredrik Karlsson
Dear list, I have a data.frame with aggregated frequencies of occurrence of two-way (and in one case three-way) features in my observations. Like this: location condition transient fricationmrallvoiced correctstop vpresent frequency 1 STNPOSTON TRUE FALSE FALSE

Re: [R] Minimum value by ID

2011-05-17 Thread Ivan Calandra
Two other options (which I prefer): aggregate(x~id.var, data=dat, FUN=min) or library(doBy) summaryBy(x~id.var, data=dat, FUN=min) HTH, Ivan Le 5/17/2011 16:09, John Kane a écrit : A bit convolulted but it works library(reshape2) yy<- melt(dat) zz<- cast(yy, id.var ~ variable, min) zz[,2] --

Re: [R] pdf (probability distribution function) and cdf

2011-05-17 Thread Jonathan Daily
Do you have a reproducible example? As posed I have no idea what this vector contains. Are you assuming a specific distribution type and using these vectors to parameterize it? On Tue, May 17, 2011 at 10:08 AM, Alaios wrote: > Dear all, > I would like for a given vector to calculate the pdf and

Re: [R] Problem on glmer

2011-05-17 Thread Zhang,Yanwei
Hi Dennis, Thanks for your input. I am quite shocked that the Gamma model is not implemented in glmer yet, but do you happen to know if there is other packages in R that could fit Gamma hierarchical models besides MASS? The glmmPQL results are a bit off compared to what have been published. T

Re: [R] Minimum value by ID

2011-05-17 Thread John Kane
A bit convolulted but it works library(reshape2) yy <- melt(dat) zz <- cast(yy, id.var ~ variable, min) zz[,2] --- On Tue, 5/17/11, Downey, Patrick wrote: > From: Downey, Patrick > Subject: [R] Minimum value by ID > To: r-help@r-project.org > Received: Tuesday, May 17, 2011, 9:44 AM > Hello, >

Re: [R] Minimum value by ID

2011-05-17 Thread Downey, Patrick
Perfect. Thank you. -Mitch -Original Message- From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] Sent: Tuesday, May 17, 2011 9:51 AM To: Downey, Patrick Cc: r-help@r-project.org Subject: Re: [R] Minimum value by ID have a look at help file of function tapply(), and try this:

[R] pdf (probability distribution function) and cdf

2011-05-17 Thread Alaios
Dear all, I would like for a given vector to calculate the pdf and the cdf and then plot these two graphs. Is there in R any toolkit that can help me do that fast? Regards Alex __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Bert Gunter
Folks: > Only if the user hasn't yet been introduced to the with() function, > which is linked to on the ?attach page. > > Note also this sentence from the ?attach page: >  " attach can lead to confusion." > > I can't remember the last time I needed attach(). > > Peter Ehlers Yes. But perhaps

Re: [R] Inverse autocorrelation fonction

2011-05-17 Thread Jean-Baptiste Lepetit
In fact, my previous post is not correct: you have to replace : acfth <- ARMAacf(ar=numeric(0),ma=artest$ar) by : acfth <- ARMAacf(ar=numeric(0),ma=-artest$ar) Then it coincides exactly the same correlations as SAS The error comes from the equation estimated by the ar() function : "For defini

Re: [R] Minimum value by ID

2011-05-17 Thread Dimitris Rizopoulos
have a look at help file of function tapply(), and try this: with(dat, tapply(x, id.var, min)) I hope it helps. Best, Dimitris On 5/17/2011 3:44 PM, Downey, Patrick wrote: Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the follo

[R] scales argument in bwplot (lattice)

2011-05-17 Thread Doran, Harold
Suppose I have data such as the following set.seed(12345) tmp <- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30)) tmp1 <- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100)) var3 is on a different scale, but I create the following plot, which looks terr

Re: [R] Linear Discriminant Analysis error: "Variables appear constant"

2011-05-17 Thread Songer, Katherine B - DNR
Uwe, Thank you very much for looking at this. I'm attaching the data, in case you have any wisdom on why variables 10, 38, and 42 would appear constant. Meanwhile, I'll remove colinear variables and read up a little more... Thanks, Katie -Original Message- From: Uwe Ligges [mailto:lig.

[R] Minimum value by ID

2011-05-17 Thread Downey, Patrick
Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the following structure: x <- runif(12) id.var <- factor(c(rep("D1",4),rep("D2",2),rep("D3",3),rep("D4",3))) dat <- as.data.frame(x) dat$id.var <- id.var dat > dat x id

Re: [R] Smooth contour of a map

2011-05-17 Thread Duncan Murdoch
I don't think filled.contour gives you access to the contour lines. If you use contourLines() to compute them, then you can draw them using code like this: contours <- contourLines(V2b,levels=paliers) for (i in seq_along(contours)) { x <- contours[[i]]$x y <- contours[[i]]$y lines(

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Terry Therneau
-- begin included message --- I did realize that there are way more predictors in the model. My initial thinking was use that as an initial model for stepwise model selection. Now I wonder if the model selection result is still valid if the initial model didn't even converge? --- end inclusion -

Re: [R] Smooth contour of a map

2011-05-17 Thread Duncan Murdoch
On 17/05/2011 8:24 AM, Pierre Bruyer wrote: Thank you for your answer, but the function spline() (and a lot of other function in R) can't take in its parameters the original contour which are define by a vector, i.e. : If you post some reproducible code to generate the contours, someone wi

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Peter Ehlers
On 2011-05-17 02:22, Timothy Bates wrote: Dear Bryony: the suggestion was not to change the name of the data object, but to explicitly tell glm.nb what dataset it should look in to find the variables you mention in the formula. so the salient difference is: m1<- glm.nb(Cells ~ Cryogel*Day, da

Re: [R] Subsetting depth profiles based on maximum depth by group with plyr

2011-05-17 Thread Peter Ehlers
On 2011-05-16 17:14, Sam Albers wrote: Hello, Apologies for a similar earlier post. I didn't include enough details in that one. I am having a little trouble subsetting some data based on a grouping variable. I am using an instrument that does depth profiles of a water column. The instrument re

[R] extract value from mer object ?

2011-05-17 Thread Maas James Dr (MED)
What is the easiest way to extract a value from a 'mer' object from glmer? The first I need is the trtpair Std.Dev. which in this case is 0.17542? I've managed to get the fixed effects numbers from summary(fednmaout)@coeffs but no luck with the Random effects stuff. TIA Jim > fednmaout

Re: [R] changes in coxph in "survival" from older version?

2011-05-17 Thread Frank Harrell
The problem is the use of variable selection without simultaneous shrinkage. It will result in an entirely unreliable model and essentially will choose a random sample of the predictors. See http://www.childrensmercy.org/stats/faq/faq12.asp Frank Shi, Tao wrote: > > Hi Frank, > > I know it's k

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Jannis
--- Vikas Garud schrieb am Di, 17.5.2011: > Von: Vikas Garud > Betreff: [R] Box Plot under GUI (R Commander/RKward) > An: r-help@r-project.org > Datum: Dienstag, 17. Mai, 2011 11:31 Uhr > Hi, > > I tried to search the mailing list on box plot, but could > not find > anything relevant.  I have

Re: [R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Timothy Bates
something like this will get you going, assuming your data are in a dataframe called “qual” # qual <- read.table(pipe("pbpaste"), header=T, sep='\t') boxplot(formula=Time~Distance+Season, data=qual) Followup question from me: i can’t see why boxplot(formula=Time, data=qual) should return the

Re: [R] epi.2by2

2011-05-17 Thread peter dalgaard
On May 17, 2011, at 12:57 , pcc wrote: > This is a really simple question, I'm sure,but I can't make EpiR work! > I keep getting the following: > >> epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95) > Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time", > c

Re: [R] Dealing with null values Aggregate function

2011-05-17 Thread Jonathan Daily
Furthermore, aggregate passes extra arguments to FUN, so explicit declaration of na.rm = T can be done in the call to aggregate directly: aggregate(cbind(v1, v2) ~ v3, data = testDF, FUN = mean, na.rm = T) HTH, Jon On Tue, May 17, 2011 at 5:22 AM, Jannis wrote: > Andy, > > > have a look at ?mea

Re: [R] Rscript hangs on exit with ubuntu 11.04

2011-05-17 Thread Dirk Eddelbuettel
On 17 May 2011 at 12:18, Mikael Högqvist wrote: | Hi, | | I have run into a strange issue with Rscript and plyr. When running | the following Rscript: | | #!/usr/bin/Rscript | library(plyr) | d = ddply(data.frame(a=1:101,b=1:101), .(a,b), nrow) | head(d) | | the script does not terminate. It pr

[R] Box Plot under GUI (R Commander/RKward)

2011-05-17 Thread Vikas Garud
Hi, I am a consultant in Quality Management. I am exploring the use of R with any GUI - R commander/Rkward for doing analytical work. Have installed R, R Commander and Rkward. I hope to learn by doing various exercises that I use for teaching analytical techniques to my clients. I would be pos

[R] epi.2by2

2011-05-17 Thread pcc
This is a really simple question, I'm sure,but I can't make EpiR work! I keep getting the following: > epi.2by2(47, 263483, 282, 935028, method="cohort.time", conf.level=0.95) Error in epi.2by2(47, 263483, 282, 935028, method = "cohort.time", conf.level = 0.95) : unused argument(s) (935028)

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread David Winsemius
On May 17, 2011, at 4:09 AM, Bryony Tolhurst wrote: Dear Bill Many thanks. I will try this. One question: why is the attach()function problematic? I have always done it that way (well in my very limited R-using capacity!) as dictated by 'Statistics, an Introduction using R' by Michael Cra

  1   2   >