Re: [R] problem with spline

2010-10-01 Thread Michael Bedward
I'm not overly familiar with the spilne function in R but I was under the impression that for a hermite spline fit the xs had to be strictly increasing (as in your toy example) whereas in your actual data the x values increase then decrease. Michael On 2 October 2010 11:59, Matthew Finkbeiner wr

Re: [R] Pass Arguments to R with an LSF submit

2010-10-01 Thread Joshua Wiley
Hi, I have no idea about LSF managed clusters, but on Windows at least I use (and maybe you can try it): Create a script file (.R) with: # toprint <- commandArgs() length(toprint) print(toprint) # Now moving to the command prompt, either

Re: [R] Script auto-detecting its own path

2010-10-01 Thread Henrik Bengtsson
See findSourceTraceback() of R.utils, e.g. library("R.utils"); example(findSourceTraceback); However, in general I would avoid using the above, because in nearly all cases there is a better solution which does not rely on knowing paths, e.g. setting up functions and calling those instead of using

Re: [R] Pass Arguments to R with an LSF submit

2010-10-01 Thread Thomas Stewart
On further review, it appears that & has nothing to do with the problems I'm experiencing. For some reason, the computer gods don't like --args 1 3. A solution I've found is outlined in the R-help archives: http://tolstoy.newcastle.edu.au/R/help/05/02/13163.html . If you know of another solution

[R] function which can apply a function by a grouping variable and also hand over an additional variable, e.g. a weight

2010-10-01 Thread Ozan Bakis
Hi, I was wondering if there is an easy way to accomplish the following in R: Often I want to apply a function, e.g. weighted.quantile from the Hmisc package to grouped subsets of a data.frame (grouping variable) but then I also need to hand over the weights which seems not possible with summaryBy

[R] hclust with method = “ward”

2010-10-01 Thread PeterB
The clustering function hclust has a method = "ward”, and apparently many people use that option. However, the Ward method seems to minimize an increase in the error sums of squares, which are calculated with respect to the cluster mean. However, hclust has only a dissimilarity matrix as an input.

Re: [R] Contrasts for MANOVA

2010-10-01 Thread Thomas Stewart
There are several ways to perform a MANOVA analysis in R. You'll have to be more specific about your approach. For example, which function are you using? -tgs On Fri, Oct 1, 2010 at 3:31 PM, Ali S wrote: > Can anyone tell me how to run contrasts for MANOVA? > Thanks! > > > >[[alternati

Re: [R] Sweave and LaTeX beamer class

2010-10-01 Thread Johannes Huesing
Charles C. Berry [Fri, Oct 01, 2010 at 01:24:43AM CEST]: [...] > \begin{uncoverenv}<4-> > <>= > 5*5*101 > @ %def > \end{uncoverenv} Thanks! Seems I was not familiar enough with the beamer documentation. -- Johannes Hüsing There is something fascinating about science.

[R] problem with spline

2010-10-01 Thread Matthew Finkbeiner
I am trying to interpolate missing values using spline and am running into some strange problems. first, this works just fine: x<- c(1:10, rep(NA, 3), 14:20) y<- c(rnorm(10), rep(NA,3), rnorm(7)) s<- spline(x,y, n=length(x)) plot(x,y) lines(s, col="blue") but look at what happens with my real d

[R] [Fwd: RE: maximum likelihood problem]

2010-10-01 Thread mlarkin
I forgot to add that I first gave a starting value for K. Nonlinear least squares won't work because my errors are not normally distributed. Any advide on my maximum likelihood function would be greatly appreciated. Original Message Subj

Re: [R] Memory allocation in 64 bit R

2010-10-01 Thread Peter Langfelder
Hi Mete, I think you should look at the help for memory.limit. Try to set a higher one, for example memory.limit(16000) (I think 16GB is what xenon will take). Peter On Fri, Oct 1, 2010 at 6:02 PM, Mete Civelek wrote: > Hi Everyone, > > I am getting the following error message > > Error: cann

Re: [R] Help its urgent

2010-10-01 Thread Joshua Wiley
Hi Josue, This should help, you are almost there. # consider this dat <- c(1, 2) # passing TRUE/FALSE to the extraction function dat[c(TRUE, FALSE)] # Now moving to an array # Create an array with dimensions 100, 13 filled with random normal numbers dat <- array(data = rnorm(100*13), dim = c(100

[R] Memory allocation in 64 bit R

2010-10-01 Thread Mete Civelek
Hi Everyone, I am getting the following error message Error: cannot allocate vector of size 2.6 Gb In addition: Warning messages: 1: In dim(res$res) = dim(bi) : Reached total allocation of 8122Mb: see help(memory.size) 2: In dim(res$res) = dim(bi) : Reached total allocation of 8122Mb: see hel

[R] Help its urgent

2010-10-01 Thread Josue Nuñez Rico
Hi I am student of Masters and wanted to know if you can help with a problem I have. I have an array of 100 * 13 and need to extract all values of that array that are less than a value p = x, insert this code data = c (dat [, 1]> = p1), but only and managed to tell me if is false or true that

[R] trouble with RODBC -- chopping off part of column names

2010-10-01 Thread Mike Williamson
Hello all, I have a strange / interesting problem that might be 'R' settings themselves, or it might be something with the OS. I am using the RODBC library. I have a script that goes out and, before making a query for a big data set, will first query for the column names of the data set.

Re: [R] Suppressing printing in the function

2010-10-01 Thread Jonathan Christensen
Dimitri, Maybe ?invisible will help? Jonathan On Fri, Oct 1, 2010 at 4:27 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Hello! > > I wrote a function that returns a data frame. Nowhere in the function > do I say print(my.data.frame), but when I run the function - the data

Re: [R] element wise conditional assignment in r

2010-10-01 Thread Henrique Dallazuanna
You've tried: v - r On Fri, Oct 1, 2010 at 6:53 PM, yunjiangster wrote: > > Hi, > I am looking for a one-liner code for the following situation > say I have a vector r of 0 and 1's, and another vector v of equal length. I > want to assign v[i]-1 to v[i] if r[i]=1, for all i. How would I do tha

Re: [R] How many R packages are not free?

2010-10-01 Thread Ajay Ohri
http://depts.washington.edu/uwc4c/express-licenses/files/view/license/35/ Only Revolution charges (but they have atleast 5 packages by now) apart from enhanced core libraries. Rattle has a commercial version as well _it is

Re: [R] Suppressing printing in the function

2010-10-01 Thread Dimitri Liakhovitski
Thank you - exactly what I was looking for! Dimitri On Fri, Oct 1, 2010 at 6:30 PM, Phil Spector wrote: > ?invisible >                                        - Phil Spector >                                         Statistical Computing Facility >                                         Departmen

Re: [R] Suppressing printing in the function

2010-10-01 Thread Phil Spector
?invisible - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] element wise conditional assignment in r

2010-10-01 Thread Phil Spector
John - Is this what you're looking for? r = sample(c(0,1),10,replace=TRUE) r [1] 0 1 0 1 1 0 0 1 0 1 v = 1:10 ifelse(r == 1,v-1,v) [1] 1 1 3 3 4 6 7 7 9 9 - Phil Spector Statistical Computing Facility

[R] Suppressing printing in the function

2010-10-01 Thread Dimitri Liakhovitski
Hello! I wrote a function that returns a data frame. Nowhere in the function do I say print(my.data.frame), but when I run the function - the data frame is printed on the console. Is there any way to suppress it? Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com ___

[R] element wise conditional assignment in r

2010-10-01 Thread yunjiangster
Hi, I am looking for a one-liner code for the following situation say I have a vector r of 0 and 1's, and another vector v of equal length. I want to assign v[i]-1 to v[i] if r[i]=1, for all i. How would I do that using mapply or any other batch processing keywords? thanks. John -- View this

[R] How many R packages are not free?

2010-10-01 Thread Paul Miller
Hello Everyone,   Just finished reading A Handbook of Statistical Analyses using R by Everitt and Hothorn. I'll begin by saying that I quite liked the book. It's both little and mighty in the sense that it's very compact but contains a tremendous amount of useful material.   The last chapter of

Re: [R] Interpreting the example given by Frank Harrell in the predict.lrm {Design} help

2010-10-01 Thread Frank Harrell
Well put Greg. The job of the statistician is to produce good estimates (probabilities in this case). Those cannot be translated into action without subject-specific utility functions. Classification during the analysis or publication stage is not necessary. Frank - Frank Harrell Departme

Re: [R] How to apply vector value function to a multidimensional array indexed by the remaining dimensions?

2010-10-01 Thread Charles C. Berry
On Fri, 1 Oct 2010, yunjiangster wrote: Hi, I am looking for some generalization of colSums and rowSums for general vector valued functions, and for arrays of more than 2 dimensions. So as a concrete example, suppose I have a 3 dimensional array, given by x = array(1:100,c(3,4,5)). and I want

[R] plm: lag() and diff() do not (always) recognize a gap in the time dimension

2010-10-01 Thread Christian Schoder
Hello! I came accross a strange behavior of the plm package. When using an unbalanced panel with years lag() and diff() do not recognize a break in the time dimension. It does, however, if there is only one more year after the break. This is strange, right? Consider the following example: > lib

Re: [R] writing an R code for a given model

2010-10-01 Thread Ben Bolker
Shige Song gmail.com> writes: > > Hi Abderrahim, > > I find this book particularly helpful: > http://www.meb.ki.se/~yudpaw/likelihood/likelihood-index.htm > > Shige > > On Fri, Oct 1, 2010 at 12:15 PM, abderrahim youssef > googlemail.com> wrote: > > Dear R help list, > > > > I am desperately

[R] [R-pkgs] ff version 2.2.0

2010-10-01 Thread Jens Oehlschlägel
Dear R community, The next release of package ff is available on CRAN. With kind help of Brian Ripley it now supports the Win64 and Sun versions of R. It has three major functional enhancements: a) new fast in-memory sorting and ordering functions (single-threaded) b) ff now supports on-disk so

Re: [R] maximum likelihood problem

2010-10-01 Thread Ravi Varadhan
Do you want to do a nonlinear least-squares estimation (which is MLE if the errors are Gaussian)? If so, you have to define a function that takes the parameter (k) and data matrix (LR, T, LM), as arguments, and returns a scalar, which is the residual sum of squares. Then you can optimize (minimiz

Re: [R] How to generate scatterplot - with a twist

2010-10-01 Thread Greg Snow
If it is important to have points rather than just create the grid, then you could do something using the my.symbols function in the TeachingDemos package. One of the examples on the help page fills the plot with hexagons, the calculations for squares should be simpler. -- Gregory (Greg) L. S

[R] maximum likelihood problem

2010-10-01 Thread mlarkin
I am trying to figure out how to run maximum likelihood in R. Here is my situation: I have the following equation: equation<-(1/LR-(exp(-k*T)*LM)*(1-exp(-k))) LR, T, and LM are vectors of data. I want to R to change the value of k to maximize the value of equation. My attempts at optim and opt

Re: [R] can I add line breaks to the paste() function?

2010-10-01 Thread David LeBauer
Thanks for the help. This solves my problem - I wanted to print out errors and warnings on separate lines with a single call. Thanks, David On Thu, Sep 30, 2010 at 3:42 PM, Jeremy Miles wrote: > Try using cat instead.  Then "\n" is the new line character. > > E.g. >  cat("1st line\n2nd line\n")

Re: [R] How to generate scatterplot - with a twist

2010-10-01 Thread Marc Schwartz
On Oct 1, 2010, at 10:41 AM, thernubblet wrote: > > Hi. I would like to make a scatterplot where all of the points are evenly > spaced from each other - however, they are all the same size and occupy the > entire graph. For example: > > x = rep(c(1:10), 10) > y = rep(c(10:1), each = 10) > plot(x

Re: [R] [Help]:How to use "loop" to achieve this aim?

2010-10-01 Thread Jeffrey Spies
Correcting Karena's solution: for(i in 1:22) { chrn <- paste("chr",i,sep="") chrn=MEDIPS.readAlignedSeqences(BSgenome="hg19", file=chrn,numrows= ?) # no quotes around chrn chrn=MEDIPS.genomeVector(data=chrn, bin_size=50,extend=250) frames=? # I don't know how you get this variable ... ou

Re: [R] writing an R code for a given model

2010-10-01 Thread Shige Song
Hi Abderrahim, I find this book particularly helpful: http://www.meb.ki.se/~yudpaw/likelihood/likelihood-index.htm Shige On Fri, Oct 1, 2010 at 12:15 PM, abderrahim youssef wrote: > Dear R help list, > > I am desperately looking for any reference explaining by examples how to > write  R codes i

[R] writing an R code for a given model

2010-10-01 Thread abderrahim youssef
Dear R help list, I am desperately looking for any reference explaining by examples how to write R codes in order to fit the parameters of a given model using maximum likelihood or any other criteria function. I know the general structure: First write a code for the maximum likelihood function an

Re: [R] [Help]:How to use "loop" to achieve this aim?

2010-10-01 Thread qcshare
It doesn't work... where should change? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Help-How-to-use-loop-to-achieve-this-aim-tp2819894p2922193.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

[R] How to apply vector value function to a multidimensional array indexed by the remaining dimensions?

2010-10-01 Thread yunjiangster
Hi, I am looking for some generalization of colSums and rowSums for general vector valued functions, and for arrays of more than 2 dimensions. So as a concrete example, suppose I have a 3 dimensional array, given by x = array(1:100,c(3,4,5)). and I want to sum the 3rd index of x to obain a 3

[R] How to generate scatterplot - with a twist

2010-10-01 Thread thernubblet
Hi. I would like to make a scatterplot where all of the points are evenly spaced from each other - however, they are all the same size and occupy the entire graph. For example: x = rep(c(1:10), 10) y = rep(c(10:1), each = 10) plot(x, y, pch = 0) Gives me a scatter plot with 100 square points eac

Re: [R] Interpreting the example given by Frank Harrell in the predict.lrm {Design} help

2010-10-01 Thread Greg Snow
I have this discussion fairly often with doctors that I work with. The issue is that you can certainly predict from a model, but you can predict on different scales. Let's consider the simpler case of just 2 outcomes (disease yes/no): Let's say you have 4 patients that you want to predict the

Re: [R] gridExtra question

2010-10-01 Thread Felipe Carrillo
It looks like the list of packages is not refreshing on my pc because If I go to packages > install packages I don't see it there next to 'gridBase' but I went to the CRAN website and there it is right next to 'gridBase'.  I had to manually download the Windows binary from there, saved it to my des

[R] Contrasts for MANOVA

2010-10-01 Thread Ali S
Can anyone tell me how to run contrasts for MANOVA?  Thanks! [[alternative HTML version deleted]] __ 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

Re: [R] mhtplot?

2010-10-01 Thread Ben Bolker
Mohsen Jafarikia gmail.com> writes: > I was wondering why many plot options are not working with mhtplot. I could > not find much info about this function on the web too. Any comments, any > detailed manual ... I'm afraid this one gets the usual answers: 1. what does "not work" mean? (Please

Re: [R] gridExtra question

2010-10-01 Thread Felipe Carrillo
I must be blind, CRAN was  my first try and didn't see it there. It is Friday and time to take a break I guess :-)   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA > >From: Ista Zahn >To: Felipe Carrillo >Cc: r-h...@st

Re: [R] gridExtra question

2010-10-01 Thread Ista Zahn
Is there some reason you don't want the CRAN version? -Ista On Fri, Oct 1, 2010 at 3:08 PM, Felipe Carrillo wrote: > > Hi: > I get a couple of warnings when trying to download gridExtra: > install.packages("gridExtra",repos=http://R-Forge.R-project.org) > > Warning: unable to access index for

Re: [R] gridExtra question

2010-10-01 Thread Erik Iverson
Forgot to mention you should be able to install from a CRAN mirror. Felipe Carrillo wrote: Hi: I get a couple of warnings when trying to download gridExtra: install.packages("gridExtra",repos=http://R-Forge.R-project.org) Warning: unable to access index for repository http://R-Forge.R-proj

Re: [R] gridExtra question

2010-10-01 Thread Erik Iverson
Well, a quick check of http://r-forge.r-project.org/bin/windows/contrib/ shows that there is no 2.10 directory, possibly because it's not very new, 2.12 is scheduled for release in 2 weeks. Felipe Carrillo wrote: Hi: I get a couple of warnings when trying to download gridExtra: install.pack

[R] gridExtra question

2010-10-01 Thread Felipe Carrillo
  Hi: I get a couple of warnings  when trying to download gridExtra: install.packages("gridExtra",repos=http://R-Forge.R-project.org)  Warning: unable to access index for repository http://R-Forge.R-project.org/bin/windows/contrib/2.10 Warning message: In getDependencies(pkgs, dependencies, avail

[R] Pass Arguments to R with an LSF submit

2010-10-01 Thread Thomas Stewart
I'm trying to run R in batch mode on an LSF managed cluster. In simple settings, I can do it just fine. The trouble I'm having is when I try to pass arguments to the batch job. For example, bsub R CMD BATCH --args 1 3 commandfile.R & LSF doesn't like the &, and it doesn't run. I'm hoping one

Re: [R] Small p-value good or bad?

2010-10-01 Thread Ben Bolker
T. Smithson yahoo.de> writes: > > Dear R-community, > > I have a short question: How do I interpret the result of a > likelihood ratio test correctly? > > I am fitting a parametric survival model (with aftreg {eha}) and the > output tells me the overall p-value of my model is < 0.001. My > sim

Re: [R] add a new column to data frame

2010-10-01 Thread Henrique Dallazuanna
Try this: merge(dat, factor(with(dat[!dat$time,], tapply(y, id, function(x)ifelse(all(mean(x) == x), 1, which.max(x, labels = c('right', 'left')), by.x = 'id', by.y = 0) On Fri, Oct 1, 2010 at 3:15 PM, array chip wrote: > Thank you Phil. The only problem with the code is when the 2 y values

Re: [R] how to avoid NaN in optim()

2010-10-01 Thread Ravi Varadhan
You do not have to worry about re-defining your function to handle the constraints on parameters. You can let the optimizer worry about it. lik <- function(nO, nA, nB, nAB){ loglik <- function(par) { p=par[1] q=par[2] r <- 1 - p - q -(2 * nO * log

[R] [Fwd: Re: cleaning up a vector]

2010-10-01 Thread mlarkin
It turns out I didn't have to filter out the 1-20 values. The code of x[is.finite(x)] did the trick. Thanks!!! Mike Original Message Subject: Re: [R] cleaning up a vector From:"Henrique Dallazuanna" Date:Fri, October 1, 2010

Re: [R] add a new column to data frame

2010-10-01 Thread array chip
Thank you Phil. The only problem with the code is when the 2 y values are equal, it should default to "right". Your code would default to the first maximum. But it's ok, I see the logic here and can figure it out. I wondered whether there is some one-line thing that can do this, I guess not po

Re: [R] cleaning up a vector

2010-10-01 Thread Henrique Dallazuanna
Complementing: findInterval(x[is.finite(x)], 1:20) On Fri, Oct 1, 2010 at 2:55 PM, Henrique Dallazuanna wrote: > Try this: > > x[is.finite(x)] > > > > On Fri, Oct 1, 2010 at 2:51 PM, wrote: > >> I calculated a large vector. Unfortunately, I have some measurement error >> in my data and some o

Re: [R] cleaning up a vector

2010-10-01 Thread Marc Schwartz
On Oct 1, 2010, at 12:51 PM, mlar...@rsmas.miami.edu wrote: > I calculated a large vector. Unfortunately, I have some measurement error > in my data and some of the values in the vector are erroneous. I ended up > wih some Infs and NaNs in the vector. I would like to filter out the Inf > and Na

Re: [R] How to Install R Commander?

2010-10-01 Thread Uwe Ligges
Reinstall R and select the option for tcltk support in the installer. Uwe Ligges On 01.10.2010 19:42, kreamysaverz wrote: Hi, I am trying to install R commander. I used the command: install.packages("Rcmdr", dependencies = TRUE) It gives me this: Warning in install.packages("Rcmdr", dependen

Re: [R] cleaning up a vector

2010-10-01 Thread Peter Langfelder
On Fri, Oct 1, 2010 at 10:51 AM, wrote: > I calculated a large vector.  Unfortunately, I have some measurement error > in my data and some of the values in the vector are erroneous.  I ended up > wih some Infs and NaNs in the vector.  I would like to filter out the Inf > and NaN values and only k

Re: [R] cleaning up a vector

2010-10-01 Thread Erik Iverson
Mike, Small, reproducible examples are always useful for the rest of the us. x <- c(0, NA, NaN, 1 , 10, 20, 21, Inf) x[!is.na(x) & x >=1 & x<= 20] Is that what you're looking for? mlar...@rsmas.miami.edu wrote: I calculated a large vector. Unfortunately, I have some measurement error in my d

Re: [R] add a new column to data frame

2010-10-01 Thread Phil Spector
Here are two ways: dat0 = subset(dat,time==0) one = as.data.frame(as.table(by(dat0,dat0$id, function(x)as.character(x$mode)[which.max(x$y)]))) names(one) = c('id','type') merge(dat,one) two = sapply(split(dat0,dat0$id), function(x)as.character(x$mode)[which.max(

Re: [R] cleaning up a vector

2010-10-01 Thread Henrique Dallazuanna
Try this: x[is.finite(x)] On Fri, Oct 1, 2010 at 2:51 PM, wrote: > I calculated a large vector. Unfortunately, I have some measurement error > in my data and some of the values in the vector are erroneous. I ended up > wih some Infs and NaNs in the vector. I would like to filter out the Inf

[R] cleaning up a vector

2010-10-01 Thread mlarkin
I calculated a large vector. Unfortunately, I have some measurement error in my data and some of the values in the vector are erroneous. I ended up wih some Infs and NaNs in the vector. I would like to filter out the Inf and NaN values and only keep the values in my vector that range from 1 to 2

Re: [R] Facets in ggplot2

2010-10-01 Thread baptiste auguie
Try this, qplot(outcome, counts, data=d.AD, facets=.~ treatment) HTH, baptiste __ 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/posting-guide.html and provide c

[R] How to Install R Commander?

2010-10-01 Thread kreamysaverz
Hi, I am trying to install R commander. I used the command: install.packages("Rcmdr", dependencies = TRUE) It gives me this: Warning in install.packages("Rcmdr", dependencies = TRUE) : argument 'lib' is missing: using 'C:\Users\Karimi\Documents/R/win-library/2.11' trying URL 'http://cran.opens

[R] Facets in ggplot2

2010-10-01 Thread Prew, Paul
>Hello, > >I'm trying to introduce myself to ggplot2. I'm using syntax from the help >file, but pasting in my own data. I don't understand the error message I'm >getting. Can anyone clue me in? A Google search of this error statement >didn't return anything I could recognize as useful. >

Re: [R] 'all subsets' fitting algorithm for Bayesian approach

2010-10-01 Thread Bert Gunter
u... You are reinventing the wheel. In fact, several wheels: the statistical literature already has several different approaches worked out for this. For example, George Box and David Steinberg did one about 20 years ago, and it has been incorporated as one of the options in the JMP DOE model c

[R] add a new column to data frame

2010-10-01 Thread array chip
Hi, I am wondering if anyone can propose a simple/best way to do the following: Let's say I have a data frame dat <- cbind(expand.grid(mode=c('right','left'),time=0:3,id=c('p1','p2','p3')),y=c(3,5,rep(4,6),6,2,rep(3,6),4,4,rep(2,6))) dat mode time id y 1 right0 p1 3 2 left0 p1

Re: [R] Question about Reduce

2010-10-01 Thread Charles C. Berry
On Fri, 1 Oct 2010, Dimitri Liakhovitski wrote: Hello! In the example below the Reduce() function by default assigns "a" to be the last accumulated value and "b" to be the current value in "x". I could not find this documented anywhere as the default settings for the Reduce() function. Does an

[R] mhtplot?

2010-10-01 Thread Mohsen Jafarikia
Hello All: I was wondering why many plot options are not working with mhtplot. I could not find much info about this function on the web too. Any comments, any detailed manual ... Thanks, MJK [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] R-Square for Robust Regression Model

2010-10-01 Thread Bert Gunter
The usual way, I suppose: (1 - RSS (model with only a constant)/RSS(full model)). However, it's not particularly meaningful to do this, because points are weighted differently depending on the model. This means that the usual interpretation as the proportion of unexplained variation is wrong; and

Re: [R] help regarding the package installation

2010-10-01 Thread Neeti
Thank you so much... it is working fine -- View this message in context: http://r.789695.n4.nabble.com/help-regarding-the-package-installation-tp2894726p2925020.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mail

Re: [R] Creating R objects in Java

2010-10-01 Thread Abhijit Dasgupta, PhD
On 10/1/10 9:18 AM, lord12 wrote: How do you call R methods from Java? I want to create a GUI using Swing in Jaa that calls R methods in Java. Look in the documentation for the rJava package -- Abhijit Dasgupta, PhD Director and Principal Statistician ARAASTAT Ph: 301.385.3067 E: adasgu...@

Re: [R] Need to incorporate the use of na.rm into custom function

2010-10-01 Thread Ochsner, Scott A
Jeff, Thanks for the help. I should have thought of passing na.rm to sum. This worked nicely. Scott Scott A. Ochsner, PhD One Baylor Plaza BCM130, Houston, TX 77030 Voice: (713) 798-6227 Fax: (713) 790-1275 -Original Message- From: jsp...@gmail.com [mailto:jsp...@gmail.com] On Beha

Re: [R] help regarding the package installation

2010-10-01 Thread Duncan Murdoch
On 01/10/2010 7:39 AM, Neeti wrote: hii everyone! Recently i have started working with R and it would be nice if anyone can help me with this. I am vista user (32 bit). I wanted to install package in my parent directory i.e .Library. whenever I try to install nnet (package) it is showing me the

Re: [R] R 2.11.1 crashes

2010-10-01 Thread Ben Bolker
Tal Galili gmail.com> writes: > You'll need to give more information for people to help you. > > 1) Is this the first time you installed R? Or was it a working R version > that suddenly started having this problem? > 2) Did you try uninstalling this version, downloading a new version, > install

Re: [R] Converting a dataframe column from string to datetime

2010-10-01 Thread MacQueen, Don
You’re working too hard. Use this: tms <- as.POSIXct(strptime(v, "%a %b %d %H:%M:%OS %Y")) Take note of the fact that there are two types of datetime objects: POSIXct and POSIXlt. Your unlist() gave what seemed a strange result because you used on an “lt” object. Had you given it a “ct” ob

[R] 'all subsets' fitting algorithm for Bayesian approach

2010-10-01 Thread Michael Hopkins
Hi R experts I am just wondering if something is already available (or easily adaptable) to do the following. I am planning to build linear models for all possible combinations of terms, so for example if the terms are sent into a function as this string " X1 + X2 + X3 + X4 + X1:X2" I would

Re: [R] Interpreting the example given by Frank Harrell in the predict.lrm {Design} help

2010-10-01 Thread peterfrancis
The reason I am trying to assign them is because I have a data set where i have arrived at the most likely model that describes the data and now I have another dataset where I know the factors but not the response. Therefore, surely I need to assign the predicted values to a response in order

[R] Looping through different arguments

2010-10-01 Thread lord12
If for example I have garchFit(~garch(1,1) but I want to loop through all the different combinations of ARMA/GARCH/APARCH. Another model could be ~arma(2,1)+apaarch(1,1). How do I transition between garch(1,1) and arma(2,1)+apaarch(1,1) using a for loop. -- View this message in context: http://

[R] help regarding the package installation

2010-10-01 Thread Neeti
hii everyone! Recently i have started working with R and it would be nice if anyone can help me with this. I am vista user (32 bit). I wanted to install package in my parent directory i.e .Library. whenever I try to install nnet (package) it is showing me the following error: > install.packag

Re: [R] Inserting a plot into another

2010-10-01 Thread jamec9869
hi I'll take a look at it. - [url=http://moviesonlineworld.com]watch free movies online[/url] -- View this message in context: http://r.789695.n4.nabble.com/Inserting-a-plot-into-another-tp2720936p2877931.html Sent from the R help mailing list archive at Nabble.com. _

[R] help regarding the package installation

2010-10-01 Thread Neeti
hii everyone! Recently i have started working with R and it would be nice if anyone can help me with this. I am vista user (32 bit). I wanted to install package in my parent directory i.e .Library. whenever I try to install nnet (package) it is showing me the following error: > install.packages(

[R] Small p-value good or bad?

2010-10-01 Thread T. Smithson
Dear R-community, I have a short question: How do I interpret the result of a likelihood ratio test correctly? I am fitting a parametric survival model (with aftreg {eha}) and the output tells me the overall p-value of my model is < 0.001. My simple question is: Does the result mean my model fits

Re: [R] colored rasterImage()

2010-10-01 Thread Ben Tupper
Doh! Of course! Thanks for this. I convinced myself that the input image to rasterImage() had to be scaled 0-1. I think I started down that path by trying the following with as.raster() ... > m <- matrix(data = rep(seq(0,3, length = nx), ny), ncol = nx, nrow = ny, byrow = TRUE) > r <- as

[R] Creating R objects in Java

2010-10-01 Thread lord12
How do you call R methods from Java? I want to create a GUI using Swing in Jaa that calls R methods in Java. -- View this message in context: http://r.789695.n4.nabble.com/Creating-R-objects-in-Java-tp2904497p2904497.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Need to incorporate the use of na.rm into custom function

2010-10-01 Thread Jeffrey Spies
You can use na.omit on x after it is passed into your apply function if na.rm == T, or simply pass your na.rm to functions that use it, such as sum. Hope that helps, Jeff. On Fri, Oct 1, 2010 at 11:07 AM, Ochsner, Scott A wrote: > Hi, > > Take a matrix with missing values: > >> X = matrix(rnorm

[R] Need to incorporate the use of na.rm into custom function

2010-10-01 Thread Ochsner, Scott A
Hi, Take a matrix with missing values: > X = matrix(rnorm(10), ncol = 5) > X[2,4]=NA > X [,1] [,2] [,3] [,4] [,5] [1,] -0.1566427 -0.7382232 -1.0564624 -0.8412139 0.9370319 [2,] -1.0289865 -0.8452054 -0.1349459 NA -0.1749113 I want to apply a custom fu

Re: [R] Scatterplot matrix - Pearson linear correlation and Density Ellipse

2010-10-01 Thread Peter Ehlers
On 2010-09-30 15:42, ashz wrote: Hi, I have modified a known script to generate a scatterplot matrix: panel.cor = function(x, y, digits=2, prefix="Rho=", cex.cor) { usr = par("usr"); on.exit(par(usr)) par(usr = c(0, 1, 0, 1)) r = abs(cor(x, y, use="pairwise.complete.obs", metho

[R] Question about Reduce

2010-10-01 Thread Dimitri Liakhovitski
Hello! In the example below the Reduce() function by default assigns "a" to be the last accumulated value and "b" to be the current value in "x". I could not find this documented anywhere as the default settings for the Reduce() function. Does any sort of documentation for this behavior exist? x

Re: [R] plotting wind rose data (Karl Ropkins)

2010-10-01 Thread Karl Ropkins
David, Following on from Jim Lemon's suggest that polar plots might be more what you need, there are both wind rose and polar plot functions in the openair package that might be of use (particularly windRose and polarFreq). They will not do everthing you are after without some careful condition

[R] Fwd: Interpreting the example given by Frank Harrell in the predict.lrm {Design} help

2010-10-01 Thread John Haart
Frank and list, The reason I am trying to assign them is because I have a data set where i have arrived at the most likely model that describes the data and now I have another dataset where I know the factors but not the response. Therefore, surely I need to assign the predicted values to a r

Re: [R] Fitting with error on data

2010-10-01 Thread Michael Bedward
There is the lmodel2 package... http://cran.r-project.org/web/packages/lmodel2/vignettes/mod2user.pdf Geometric mean regression has been discussed on this list in the past, for example: https://stat.ethz.ch/pipermail/r-help/2005-June/072927.html I've used that approach with nls (rightly or wrongl

Re: [R] Accessing Element of a Table

2010-10-01 Thread Peter Ehlers
On 2010-10-01 7:43, Gundala Viswanath wrote: I have the following structure: str(propn) table [1:2(1d)] 0.674 0.326 - attr(*, "dimnames")=List of 1 ..$ label: chr [1:2] "o" "x" print(propn) label o x 0.6738347 0.3261653 How can I access the value of "o" and "x" I

Re: [R] RGL and Windows 7

2010-10-01 Thread Duncan Murdoch
On 01/10/2010 9:53 AM, Sven Wagner wrote: Thanks, but your suggestions don't solve the problem. Though, the plot is storable via the rgl.postscript command, but this increases computation time and memory requirements. rgl.postscript is limited in the kinds of scenes it can render, so check care

Re: [R] RGL and Windows 7

2010-10-01 Thread Sven Wagner
Thanks, but your suggestions don't solve the problem. Though, the plot is storable via the rgl.postscript command, but this increases computation time and memory requirements. -- View this message in context: http://r.789695.n4.nabble.com/RGL-and-Windows-7-tp2844487p2910131.html Sent from the R

Re: [R] Interpreting the example given by Frank Harrell in the predict.lrm {Design} help

2010-10-01 Thread Frank Harrell
Why assign them at all? Is this a "forced choice at gunpoint" problem? Remember what probabilities mean. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Interpreting-the-example-given-by-Frank-Harrell

[R] Accessing Element of a Table

2010-10-01 Thread Gundala Viswanath
I have the following structure: > str(propn) table [1:2(1d)] 0.674 0.326 - attr(*, "dimnames")=List of 1 ..$ label: chr [1:2] "o" "x" > print(propn) label o x 0.6738347 0.3261653 How can I access the value of "o" and "x" I tried this but fail > print(propn$label[,"o"]; -

Re: [R] Fitting with error on data

2010-10-01 Thread Ted Harding
On 27-Sep-10 08:55:13, Maayt wrote: > As this forum proved to be very helpful, I got another question... > I'd like to fit data points on which I have an error, dx and dy, > on each x and y. What would be the common procedure to fit this > data by a linear model taking into account uncertainty on e

Re: [R] function which can apply a function by a grouping variable and also hand over an additional variable, e.g. a weight

2010-10-01 Thread Hadley Wickham
You might want to check out the plyr package. Hadley On Fri, Oct 1, 2010 at 6:05 AM, Werner W. wrote: > Hi, > > I was wondering if there is an easy way to accomplish the following in R: > Often I want to apply a function, e.g. weighted.quantile from the Hmisc > package > to grouped subsets of a

  1   2   >